35 lines
780 B
TypeScript
35 lines
780 B
TypeScript
import { Field, InputType, Int } from '@nestjs/graphql';
|
|
import { IsIn, IsInt, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
|
|
import { ISSUE_STATUSES } from '../../domain/value-objects/issue-status.vo.js';
|
|
|
|
@InputType()
|
|
export class UpdateIssueInput {
|
|
@Field({ nullable: true })
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(200)
|
|
title?: string;
|
|
|
|
@Field({ nullable: true })
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@Field({ nullable: true })
|
|
@IsOptional()
|
|
@IsIn(ISSUE_STATUSES.map((status) => status.alias))
|
|
status?: string;
|
|
|
|
@Field(() => Int, { nullable: true })
|
|
@IsOptional()
|
|
@IsInt()
|
|
@Min(0)
|
|
@Max(4)
|
|
priority?: number;
|
|
|
|
@Field(() => String, { nullable: true })
|
|
@IsOptional()
|
|
@IsString()
|
|
assignee?: string | null;
|
|
}
|