44 lines
763 B
TypeScript
44 lines
763 B
TypeScript
import { Field, InputType, Int } from '@nestjs/graphql';
|
|
import { IsDate, IsInt, IsNotEmpty, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
|
|
|
|
@InputType()
|
|
export class CreateIssueInput {
|
|
@Field()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
key: string;
|
|
|
|
@Field()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(200)
|
|
title: string;
|
|
|
|
@Field()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
projectId: string;
|
|
|
|
@Field({ nullable: true })
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@Field(() => Int, { nullable: true })
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(0)
|
|
@Max(4)
|
|
priority?: number;
|
|
|
|
@Field({ nullable: true })
|
|
@IsOptional()
|
|
@IsString()
|
|
assignee?: string;
|
|
|
|
@Field(() => Date, { nullable: true })
|
|
@IsOptional()
|
|
@IsDate()
|
|
dueDate?: Date;
|
|
}
|