Commit Graph

1386 Commits

Author SHA1 Message Date
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
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
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
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
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
marshal
97992da1b5 Merge pull request #351 from Tria-plc/freight_feature/contrat
Freight feature/contrat
2026-06-29 18:49:16 +03:00
Marshal
d91389daac cfix payment 2026-06-29 15:46:17 +00:00
Marshal
ce3584cd4a cfix payment 2026-06-29 15:41:00 +00:00
yaschalew
1193e2bfa9 fix commit 2026-06-29 18:35:51 +03:00
natib21
04bc9eded6 fix 2026-06-29 15:28:04 +00:00
Marshal
c6979a97c2 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight_feature/contrat 2026-06-29 15:25:53 +00:00
natib21
d94b73fe02 fix 2026-06-29 15:09:34 +00:00
Eyob T.
d4fb34c572 Merge pull request #345 from Tria-plc/alpha
Update payment methods and cron job for payment cancellation
2026-06-29 18:06:08 +03:00
natib21
9b11eeb623 fix 2026-06-29 14:54:34 +00:00
natib21
c728b249c2 fix 2026-06-29 14:48:47 +00:00
natib21
fed21de634 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/last_mile_invoice 2026-06-29 14:45:37 +00:00
natib21
6fa315db0f fix 2026-06-29 14:45:22 +00:00