Commit Graph

1398 Commits

Author SHA1 Message Date
yaschalew
e2bc5aab83 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 16:39:17 +03:00
natib21
814db8a17d feat: fleet dashboard page
Shows fleet overview + key metrics:
- Total vehicles, active count
- Total fuel spending
- Total maintenance spending
- Average fuel efficiency
- Fleet status (active/idle/maintenance)
- Operating cost breakdown (fuel vs maintenance pie chart)
- Fleet vehicle list (first 10)

Route: /dashboard/fleet-dashboard
Sidebar: Added to Fleet Management section

Metrics aggregate from:
- /vehicles (fleet size)
- /fuel/stats (fuel spending + efficiency)
- /maintenance/stats (maintenance spending)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 13:38:35 +00:00
yaschalew
cb0deb0268 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 16:11:16 +03:00
natib21
8e0cc7d5ee fix: vehicles data extraction in maintenance + financial pages
Both MaintenancePage and FinancialReportsPage were calling
vehiclesService.getAll() but not extracting res.data property.
Result was vehicles being undefined, causing .map error.

Fixed to match FuelPurchasePage pattern:
  const res = await vehiclesService.getAll()
  return res.data || []

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 13:10:47 +00:00
yaschalew
c455264da4 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 16:07:27 +03:00
natib21
373c0356f2 feat: maintenance + financial reports frontend
MaintenancePage:
- Schedule maintenance (PREVENTIVE/CORRECTIVE/INSPECTION/REPAIR)
- View upcoming by vehicle
- Modal form with date, cost, provider, notes

FinancialReportsPage:
- Aggregate fuel + maintenance costs
- Period selector (3/6/12 months)
- Cost breakdown (percentages, ring progress)
- Operating insights (purchases, efficiency, items, avg cost)
- Cost per month calculation

Routes:
- /dashboard/maintenance
- /dashboard/financial-reports

Sidebar:
- "Maintenance" in Fleet Management
- "Financial Reports" in Fleet Management

QUERY_KEYS:
- FUEL, MAINTENANCE, FINANCIAL_REPORTS cache patterns

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 12:41:23 +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
yaschalew
32e67f337e Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 15:29:54 +03: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
yaschalew
7c48f02a15 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 13:16:20 +03:00
natib21
f27f00d480 fix: use vehiclesService and add VEHICLES QUERY_KEYS
- Add VEHICLES to QUERY_KEYS constant
- Use vehiclesService.getAll() instead of direct API call
- Remove duplicate Vehicle type definitions
- Fix TypeScript type references

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 10:15:43 +00:00
yaschalew
dc3f6797c9 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 13:12:02 +03:00
natib21
3f81bb77ad feat: add fuel management frontend pages
- FuelPurchasePage: Record fuel purchases, calculate total costs
- FuelStatsPage: View fuel consumption stats, efficiency metrics
- Routes: /dashboard/fuel-purchases and /dashboard/fuel-stats
- Sidebar menu items in Fleet Management section

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 10:11:13 +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
yaschalew
fc82c5c636 Merge branch 'freight/hot_fix' of github.com:Tria-plc/edr-platform into freight/hot_fix 2026-06-30 07:05:53 +03:00
natib21
360e61ac15 fix: use byId() instead of detail() in QUERY_KEYS
QUERY_KEYS.FIRST_MILE and QUERY_KEYS.LAST_MILE have byId() not detail().

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 04:04:56 +00:00
natib21
0bc9534172 fix: replace apiClient with api in FirstMilePage
Use correct import 'api' from '@/auth/http' instead of undefined 'apiClient'.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 04:03:29 +00:00
yaschalew
a3741c45bf fix 2026-06-30 07:01:32 +03:00
natib21
14dde418f7 fix(migrations): check if tables exist before CREATE TABLE
Make invoices migration idempotent - skip table/index creation if they
already exist. Prevents 'relation already exists' errors on redeployment.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 03:55:57 +00: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
b1d9045d0b fix: remove isPostPaymentCompleted filter check
Property removed from entities until migration creates column.
Temporarily skip this filter until feature is fully implemented.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 03:15:58 +00:00
natib21
f9ef473cff fix(migrations): check pg_type before CREATE TYPE enum
PostgreSQL doesn't support IF NOT EXISTS on CREATE TYPE AS ENUM.
Query pg_type table to check if enum exists before creating.
Compatible with all PostgreSQL versions.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 02:45:37 +00:00
natib21
76b25bd214 fix 2026-06-30 02:33:29 +00:00
natib21
1c1e98960e fix 2026-06-30 02:24:52 +00:00
natib21
ec82f8eb9f fix(migrations): use CREATE TYPE IF NOT EXISTS for invoices enum
Allows migration to run when enum already exists in prod DB. Prevents
'type already exists' error on redeployment.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 02:22:09 +00:00
natib21
3ceacbe9a9 fix(migrations): use CREATE TYPE IF NOT EXISTS for invoices enum
Allows migration to run when enum already exists in prod DB. Prevents
'type already exists' error on redeployment.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-06-30 02:03:20 +00:00
Stephanos A.
9bd7edbd03 Update Dockerfile 2026-06-30 00:42:39 +03:00
Stephanos A.
592efd0bf9 Merge pull request #361 from Tria-plc/alpha
fix(passenger-api): remove trailing backslash in Dockerfile
2026-06-30 00:31:52 +03:00
Stephanos A
bd372cce32 fix(passenger-api): remove trailing backslash in Dockerfile 2026-06-30 00:30:42 +03:00
Stephanos A.
aa974b940c Merge pull request #360 from Tria-plc/alpha
fix(passenger-api): ensure Prisma client is properly copied to runtim…
2026-06-30 00:17:57 +03:00
Stephanos A
0cefd9ffb2 fix(passenger-api): ensure Prisma client is properly copied to runtime container 2026-06-30 00:16:31 +03:00
Stephanos A.
8da6f5c1e1 Merge pull request #359 from Tria-plc/alpha
fix(passenger-api): resolve all pre-init legacy migrations
2026-06-30 00:06:27 +03:00
Stephanos A
44930b5eab fix(passenger-api): resolve all pre-init legacy migrations 2026-06-30 00:03:38 +03:00
Stephanos A.
538b433afb Merge pull request #358 from Tria-plc/alpha
Skip different schema version migrations
2026-06-29 23:56:49 +03:00
Stephanos A
140a989d34 Skip different schema version migrations 2026-06-29 23:55:24 +03:00
Stephanos A.
944bf544c8 Merge pull request #357 from Tria-plc/alpha
Resolve migrations
2026-06-29 23:49:44 +03:00
Stephanos A
f069ee985d Resolve migrations 2026-06-29 23:45:59 +03:00
Stephanos A.
0433285c1c Merge pull request #356 from Tria-plc/alpha
Move the fix before the failing migration
2026-06-29 23:29:19 +03:00
Stephanos A
c52b02ef72 Move the fix before the failing migration 2026-06-29 23:27:36 +03:00
Stephanos A.
43f15426d8 Merge pull request #355 from Tria-plc/alpha
Fix failed migration state
2026-06-29 23:21:00 +03:00
Stephanos A
7d8e19b37d Fix failed migration state 2026-06-29 23:19:10 +03:00
Stephanos A.
8a5b1891ae Merge pull request #354 from Tria-plc/alpha
Migration issue resolution - individual ticket no timezone
2026-06-29 23:09:45 +03:00
Stephanos A
8c2a2e34bf Migration issue resolution - individual ticket no timezone 2026-06-29 23:08:27 +03:00
Nathnael
10cde2b2e3 fix 2026-06-29 19:44:40 +00:00
Stephanos A.
d9020aa3c6 Merge pull request #352 from Tria-plc/alpha
Alpha
2026-06-29 21:23:08 +03:00
Stephanos A
2539fe8bba Merge branch 'alpha' of github.com:Tria-plc/edr-platform into alpha 2026-06-29 21:13:32 +03:00
Stephanos A
32ca68f68c TypeError issue resolution 2026-06-29 21:12:20 +03:00