32 lines
634 B
TypeScript
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;
|
|
}
|