fix(expenses): fixes to dto

This commit is contained in:
Matthieu Haineault 2025-11-17 15:43:18 -05:00
parent 6e52bdb4e4
commit db78c70eb0

View File

@ -1,3 +1,4 @@
import { Type } from "class-transformer";
import { IsBoolean, IsDecimal, IsInt, IsOptional, IsString, MaxLength } from "class-validator";
export class ExpenseDto {
@ -5,8 +6,8 @@ export class ExpenseDto {
@IsString() type: string;
@IsString() date: string;
@IsBoolean() is_approved: boolean;
@IsOptional() @IsDecimal() amount?: number;
@IsOptional() @IsDecimal() mileage?: number;
@IsOptional() @Type(()=> Number) amount?: number;
@IsOptional() @Type(()=> Number) mileage?: number;
@IsOptional() @IsInt() attachment?: number;
@IsOptional() @IsInt() timesheet_id?: number;
@IsOptional() @IsString() @MaxLength(280) comment: string;