feat(#29): implement cron job configuration
- Add CronSchedule model to Prisma schema - Implement CronService with CRUD operations - Add REST API endpoints for cron management - Create MoltBot plugin skill definition (SKILL.md) - TDD: 9 passing tests for CronService
This commit is contained in:
28
apps/api/src/cron/dto/index.ts
Normal file
28
apps/api/src/cron/dto/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import { IsString, IsNotEmpty, Matches, IsOptional, IsBoolean } from "class-validator";
|
||||
|
||||
export class CreateCronDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
expression: string;
|
||||
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
command: string;
|
||||
}
|
||||
|
||||
export class UpdateCronDto {
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
@Matches(/^((\*|[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9])\ ?){5}$/, {
|
||||
message: "Invalid cron expression",
|
||||
})
|
||||
expression?: string;
|
||||
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
command?: string;
|
||||
|
||||
@IsBoolean()
|
||||
@IsOptional()
|
||||
enabled?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user