38 lines
843 B
TypeScript
38 lines
843 B
TypeScript
import { IsString, IsOptional, IsIn, MinLength, IsUUID, IsNumber } from 'class-validator';
|
|
import { Transform } from 'class-transformer';
|
|
|
|
export class UpdateTicketDto {
|
|
@IsOptional()
|
|
@IsUUID()
|
|
assigneeId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MinLength(3)
|
|
title?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
description?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(['low', 'normal', 'high', 'urgent'])
|
|
priority?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsIn(['open', 'in_progress', 'resolved', 'cancelled'])
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => value !== undefined && value !== null ? Number(value) : undefined)
|
|
@IsNumber()
|
|
latitude?: number;
|
|
|
|
@IsOptional()
|
|
@Transform(({ value }) => value !== undefined && value !== null ? Number(value) : undefined)
|
|
@IsNumber()
|
|
longitude?: number;
|
|
}
|