feat: add fuel management system backend

- 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>
This commit is contained in:
natib21
2026-06-30 10:07:13 +00:00
parent 360e61ac15
commit df6e417a56
9 changed files with 425 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
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;
}