Commit Graph

427 Commits

Author SHA1 Message Date
natib21
eb5d8a7411 fix 2026-07-02 14:42:04 +00:00
natib21
b7da024968 fix 2026-07-02 14:37:38 +00:00
natib21
2424e96e74 fix 2026-07-02 14:34:22 +00:00
natib21
e5fed081fc fix 2026-07-02 14:27:09 +00:00
natib21
7d85f5dc2e fix 2026-07-02 14:18:53 +00:00
natib21
c2c29f0735 fix 2026-07-02 14:14:13 +00:00
natib21
7f6c9c6313 fix 2026-07-02 13:55:08 +00:00
natib21
58b3805d0b fix 2026-07-02 12:43:03 +00:00
natib21
a0f4de05f8 log full error 2026-07-02 12:37:02 +00:00
natib21
ff7e20d2ee fix 2026-07-02 11:22:35 +00:00
natib21
4519a1d75d fix 2026-07-02 10:33:32 +00:00
yaschalew
10e442deb1 fix 2026-07-02 13:18:49 +03:00
natib21
07abe9b679 fix 2026-07-02 08:51:21 +00:00
yaschalew
54b2114e7f fix issue 2026-07-02 11:28:56 +03:00
yaschalew
8b8a993953 fix conflict 2026-07-02 09:28:02 +03:00
ghost2023
2f79178496 fix: booking invoice issue 2026-07-01 16:11:47 +03:00
ghost2023
aef868bc40 fix: the invoice status syncing with booking payment window 2026-07-01 15:46:13 +03:00
ghost2023
7e96fa65b9 feat: rm the hardcoded invoice types 2026-07-01 15:10:04 +03:00
Nathnael
94982d3c5a feat: setup pdf on the central billing 2026-07-01 06:25:24 +00:00
Nathnael
8ab27a6721 feat: add expiration to invoice 2026-07-01 06:19:07 +00:00
natib21
558f7f38cd feat: add fleet-wide fuel and maintenance stats endpoints
Backend:
FuelService + FuelController:
- Added getFleetFuelStats() aggregating all vehicles
- Route: GET /api/fuel/stats (before :vehicleId route)
- Returns: totalCost, totalLiters, totalPurchases, averagePricePerLiter

MaintenanceService + MaintenanceController:
- Added getFleetMaintenanceStats() aggregating all vehicles
- Route: GET /api/maintenance/stats (before :vehicleId route)
- Returns: totalCost, numberOfMaintenanceItems, averageCostPerMaintenance, costByType

Both endpoints aggregate over past 12 months (customizable via query param).

Enables dashboard to show fleet-wide operating costs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 14:32:12 +00:00
natib21
fea869a19c feat: display vehicle name instead of ID in fuel purchases table
Backend:
- FuelService.getAllFuelPurchases() now loads vehicle relationship
- Uses leftJoinAndSelect to eagerly load Vehicle data
- Returns complete FuelPurchase with nested vehicle object

Frontend:
- Table displays vehicle.registrationNumber (primary)
- Falls back to vehicle.plateNumber if registration unavailable
- Falls back to vehicleId as last resort

Better UX: shows human-readable vehicle info instead of UUID.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 14:23:54 +00:00
natib21
796e63cc59 fix: add missing GET /api/fuel/purchases endpoint
Problem:
- Frontend calls GET /fuel/purchases (all purchases)
- Backend only had GET /fuel/purchases/:vehicleId (specific vehicle)
- Result: 404 when loading fuel purchases list

Solution:
- Added getAllFuelPurchases() to FuelService
- Added GET /fuel/purchases route to FuelController
- Route placed before parameterized route so it gets matched first
- Returns all fuel purchases ordered by date DESC

Endpoints:
- GET /api/fuel/purchases → all purchases
- GET /api/fuel/purchases/:vehicleId → specific vehicle
- POST /api/fuel/purchases → record purchase

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 14:18:26 +00:00
Nathnael
0056dec924 style: clean up the invoice and setup event for warehouse. 2026-06-30 13:28:14 +00:00
Nathnael
fa3138f2ac refactor: migrate the warehouse invoice to use the central one 2026-06-30 12:54:04 +00:00
natib21
f436916c42 feat: complete maintenance tracking backend
Service/Controller/Module:
- scheduleMaintenanceAsync: schedule work
- recordMaintenanceCost: log expenses
- getUpcomingMaintenance: due items
- getVehicleMaintenanceStats: cost aggregation

Endpoints:
- POST /maintenance/schedules
- POST /maintenance/costs
- PATCH /maintenance/schedules/:id
- GET /maintenance/upcoming/:vehicleId
- GET /maintenance/history/:vehicleId
- GET /maintenance/stats/:vehicleId

Migration: idempotent maintenance tables creation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 12:33:29 +00:00
natib21
e59a77b859 feat: add maintenance tracking module foundation
Entities:
- MaintenanceSchedule: track preventive/corrective maintenance
- MaintenanceCost: record actual maintenance expenses

DTOs:
- CreateMaintenanceScheduleDto: schedule maintenance
- CreateMaintenanceCostDto: log costs
- UpdateMaintenanceScheduleDto: mark complete/adjust cost

Repository:
- getUpcomingMaintenance(): find due maintenance
- getMaintenanceCosts(): historical costs by date
- getTotalMaintenanceCost(): aggregate spending

Also fixed fuel-consumption.entity.ts: totalDistanceKm default 0

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 12:28:00 +00:00
natib21
5d70c3b557 fix 2026-06-30 12:13:48 +00:00
Nathnael
5ad4efd7eb feat: add pdf to the central invoice system 2026-06-30 11:58:28 +00:00
Nathnael
7fa18b8ee7 fix: reference type in payment service 2026-06-30 11:54:43 +00:00
Nathnael
228b840c26 Merge branch 'dev' into freight/feat/invoice 2026-06-30 11:26:32 +00:00
Nathnael
21cf24950d feat: add partial payment to match the warehouse invoice before migration 2026-06-30 10:50:43 +00:00
natib21
7b9cd88712 fix: correct fuel module TypeScript errors
- Use @InjectRepository decorators for proper dependency injection
- Fix BaseRepository initialization with Repository instance
- Remove unnecessary DataSource references
- Add proper type annotations to reduce handlers

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 10:08:56 +00:00
natib21
df6e417a56 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>
2026-06-30 10:07:13 +00:00
hagiye
831ac59a8e Merge branch 'dev' of github.com:Tria-plc/edr-platform into importhandover 2026-06-30 07:20:10 +03:00
hagiye
9f5c22c1ee Goods recieved notes and Booking delivery 2026-06-30 07:19:12 +03:00
natib21
b142552f17 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 03:46:26 +00:00
natib21
25e91c6d93 fix: comment out isPostPaymentCompleted column decorator
Column doesn't exist in DB yet. Commenting out @Column decorator
prevents TypeORM from trying to select non-existent column.
Fixes 500 QueryFailedError on first-mile/last-mile list endpoints.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 03:33:54 +00:00
natib21
76b25bd214 fix 2026-06-30 02:33:29 +00:00
marshal
97992da1b5 Merge pull request #351 from Tria-plc/freight_feature/contrat
Freight feature/contrat
2026-06-29 18:49:16 +03:00
Marshal
ce3584cd4a cfix payment 2026-06-29 15:41:00 +00:00
natib21
04bc9eded6 fix 2026-06-29 15:28:04 +00:00
natib21
d94b73fe02 fix 2026-06-29 15:09:34 +00:00
natib21
c728b249c2 fix 2026-06-29 14:48:47 +00:00
natib21
6fa315db0f fix 2026-06-29 14:45:22 +00:00
Nathnael
31a2e93c49 fix: rm the hardcode false for general contract 2026-06-29 14:42:53 +00:00
Nathnael Wondisha
4cf8e89780 Merge branch 'dev' into freight/feat/invoice 2026-06-29 17:24:29 +03:00
natib21
7dba546254 fix 2026-06-29 13:59:51 +00:00
Nathnael
69955bc0e6 feat: setup the invoice backend 2026-06-29 13:53:32 +00:00
Nathnael
f7f0f6aef3 fix: update the invoice generation to the new booking creation 2026-06-29 13:45:35 +00:00