mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 06:28:12 +00:00
43 lines
743 B
TypeScript
43 lines
743 B
TypeScript
import { IsUUID, IsNumber, IsPositive, IsDateString, IsString, IsOptional, IsEnum } from 'class-validator';
|
|
import { PaymentMethod } from '../entities/fuel-purchase.entity';
|
|
|
|
export class CreateFuelPurchaseDto {
|
|
@IsUUID()
|
|
vehicleId!: string;
|
|
|
|
@IsDateString()
|
|
purchaseDate!: string;
|
|
|
|
@IsNumber()
|
|
@IsPositive()
|
|
liters!: number;
|
|
|
|
@IsNumber()
|
|
@IsPositive()
|
|
costPerLiter!: number;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
fuelStation?: string;
|
|
|
|
@IsEnum(PaymentMethod)
|
|
@IsOptional()
|
|
paymentMethod?: PaymentMethod;
|
|
|
|
@IsOptional()
|
|
@IsNumber()
|
|
odometerReading?: number;
|
|
|
|
@IsOptional()
|
|
@IsUUID()
|
|
driverId?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
receiptNumber?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
notes?: string;
|
|
}
|