fennec-be/src/pipelines/dtos/create-pipeline.input.ts
2021-07-10 18:50:01 +08:00

32 lines
634 B
TypeScript

import { Type } from 'class-transformer';
import { InputType } from '@nestjs/graphql';
import { WorkUnitMetadata } from '../../pipeline-tasks/models/work-unit-metadata.model';
import {
IsInstance,
IsOptional,
IsString,
IsUUID,
MaxLength,
ValidateNested,
} from 'class-validator';
@InputType({ isAbstract: true })
export class CreatePipelineInput {
@IsUUID()
projectId: string;
@IsString()
@MaxLength(100)
branch: string;
@IsString()
@MaxLength(32)
name: string;
@Type(() => WorkUnitMetadata)
@IsOptional()
@ValidateNested()
@IsInstance(WorkUnitMetadata)
workUnitMetadata: WorkUnitMetadata;
}