Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix

This commit is contained in:
yaschalew
2026-06-30 17:19:14 +03:00
2 changed files with 10 additions and 0 deletions

View File

@@ -14,6 +14,12 @@ export class FuelController {
return this.fuelService.recordFuelPurchase(dto);
}
@Get('purchases')
@ApiOperation({ summary: 'Get all fuel purchases' })
async getAllFuelPurchases() {
return this.fuelService.getAllFuelPurchases();
}
@Get('purchases/:vehicleId')
@ApiOperation({ summary: 'Get fuel purchases for vehicle' })
async getFuelPurchases(

View File

@@ -30,6 +30,10 @@ export class FuelService {
return saved;
}
async getAllFuelPurchases(): Promise<FuelPurchase[]> {
return this.purchaseRepository.find({ order: { purchaseDate: 'DESC' } });
}
async getFuelPurchases(
vehicleId: string,
startDate: Date,