47 lines
934 B
TypeScript
47 lines
934 B
TypeScript
import { IsIn, IsObject, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
|
|
|
|
const missionStatuses = ['planning', 'active', 'paused', 'completed', 'failed'] as const;
|
|
|
|
export class CreateMissionDto {
|
|
@IsString()
|
|
@MaxLength(255)
|
|
name!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(10_000)
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
projectId?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(missionStatuses)
|
|
status?: 'planning' | 'active' | 'paused' | 'completed' | 'failed';
|
|
}
|
|
|
|
export class UpdateMissionDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(255)
|
|
name?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(10_000)
|
|
description?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
projectId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsIn(missionStatuses)
|
|
status?: 'planning' | 'active' | 'paused' | 'completed' | 'failed';
|
|
|
|
@IsOptional()
|
|
@IsObject()
|
|
metadata?: Record<string, unknown> | null;
|
|
}
|