mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 01:48:12 +00:00
- FuelPurchase entity: record fuel purchases with cost tracking - FuelConsumption entity: monthly aggregation of fuel metrics - FuelService: record purchases, calculate stats, efficiency - FuelController: REST API for fuel operations - FuelModule: integrated into app - Migration: create fuel_purchases and fuel_consumption tables Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
41 lines
699 B
TypeScript
41 lines
699 B
TypeScript
import { IsUUID, IsNumber, IsDateString, IsString, IsOptional, IsEnum } from 'class-validator';
|
|
import { PaymentMethod } from '../entities/fuel-purchase.entity';
|
|
|
|
export class CreateFuelPurchaseDto {
|
|
@IsUUID()
|
|
vehicleId!: string;
|
|
|
|
@IsDateString()
|
|
purchaseDate!: string;
|
|
|
|
@IsNumber()
|
|
liters!: number;
|
|
|
|
@IsNumber()
|
|
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;
|
|
}
|