Files
fiberops-api/src/ticket/dto/update-ticket.dto.ts
2026-05-04 13:21:54 +08:00

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;
}