Files
dyolink/backend/src/modules/treatments/dto/treatment.dto.ts

100 lines
1.6 KiB
TypeScript

import {
ArrayMinSize,
IsArray,
IsOptional,
IsString,
IsUUID,
MaxLength,
ValidateNested,
} from 'class-validator';
import { Type } from 'class-transformer';
export class SaveTreatmentDetailDto {
@IsString()
@MaxLength(64)
clientId: string;
@IsOptional()
@IsUUID()
id?: string;
@IsString()
@MaxLength(64)
treatmentType: string;
@IsArray()
@IsString({ each: true })
teeth: string[];
@IsOptional()
@IsString()
@MaxLength(5000)
comment?: string;
@IsOptional()
@IsArray()
@IsUUID(undefined, { each: true })
attachmentIds?: string[];
}
export class SaveTreatmentDraftDto {
@IsArray()
@ArrayMinSize(1)
@ValidateNested({ each: true })
@Type(() => SaveTreatmentDetailDto)
details: SaveTreatmentDetailDto[];
}
export class LabCaseToothProsthesisDto {
@IsUUID()
treatmentDetailId: string;
@IsString()
@MaxLength(8)
tooth: string;
@IsString()
@MaxLength(64)
prosthesisTypeCode: string;
}
export class SaveLabCaseDto {
@IsString()
@MaxLength(64)
clientId: string;
@IsOptional()
@IsUUID()
id?: string;
@IsOptional()
@IsUUID()
destinationOrganizationId?: string;
@IsUUID()
treatmentDetailId: string;
@IsOptional()
@IsArray()
@ValidateNested({ each: true })
@Type(() => LabCaseToothProsthesisDto)
toothProsthesis?: LabCaseToothProsthesisDto[];
@IsOptional()
@IsArray()
@IsUUID(undefined, { each: true })
attachmentIds?: string[];
}
export class SaveTreatmentLabCasesDto {
@IsArray()
@ValidateNested({ each: true })
@Type(() => SaveLabCaseDto)
labCases: SaveLabCaseDto[];
}
export class ListPatientTreatmentHistoryDto {
@IsOptional()
limit?: number;
}