Commit Graph

1127 Commits

Author SHA1 Message Date
Marshal
2429f6b629 implement contract cancellation feature and update contract statuses
- Added functionality to cancel contracts, allowing users to provide a reason for cancellation.
- Updated contract statuses to include SUSPENDED and changed CLOSED to COMPLETED.
- Enhanced the UI to reflect the new cancellation option and updated messaging for contract statuses.
- Refactored contract booking actions to accommodate changes in booking logic for ONE_TIME and GENERAL contracts.
- Removed clearance document management from the contract detail page, as it is now handled per booking.
- Introduced a SQL script to reset bookings and train schedules for development purposes.
2026-07-28 05:02:58 +00:00
Marshal
481878e553 paginate wagons, locomotives and routes lists server-side 2026-07-27 21:27:36 +00:00
Marshal
496c66017f update locaomotive and fix wagon transfer issue 2026-07-27 20:34:14 +00:00
Marshal
deadc59277 fix: correct column name in orderBy clause for listRequests method 2026-07-27 14:44:16 +00:00
Marshal
15d78e1d67 fix issue 2026-07-27 05:59:49 +00:00
Marshal
bcf25538b6 add contract hazard declaration, DO collection dates, and booking request currency migrations; implement article body diff component and integrate into contract revision timeline 2026-07-26 19:14:39 +00:00
Marshal
5fa012cad3 add contract hazard declaration, DO collection dates, and booking request currency migrations; implement article body diff component and integrate into contract revision timeline 2026-07-26 19:09:01 +00:00
Marshal
bfea9de660 add dispute functionality for contract duty and implement collection dates 2026-07-26 17:30:00 +00:00
Marshal
5e10c97294 add dispute functionality for contract duty and implement collection dates 2026-07-26 16:58:51 +00:00
Marshal
9b13fa2ac6 feat: implement wagon transfer management modals and page
- Add TransferFulfillModal for fulfilling wagon transfer requests.
- Create TransferRequestFormModal for filing new wagon transfer requests.
- Introduce TransferCloseShortModal for closing requests that cannot be fully fulfilled.
- Develop WagonTransfersPage to manage and display wagon transfer requests.
- Implement utility functions for handling wagon transfer request data and UI components.
- Enhance UI with Mantine components for better user experience.
2026-07-26 15:11:50 +00:00
Marshal
9a1c8e5603 feat: add hazardous goods declaration feature
- Introduced HazardDeclarationPanel component to display dangerous goods declaration details.
- Updated URL constants to include CLEARANCE_PROCEED endpoint for re-requesting operations.
- Enhanced permissions to include hazardous approval roles for contract approvals.
- Integrated HazardDeclarationPanel into ContractRequestDetailPage and ContractClearanceDetailPage.
- Added proceedToOperation method in bookings service for handling operation re-requests.
- Updated contract forms and schemas to include hazard class and UN number fields.
- Implemented validation for hazardous contracts in the contract creation flow.
- Added expiry notice functionality for contracts nearing validity end.
- Created tests for expiry notice calculations and labels.
- Updated UI components to reflect hazardous cargo information and validation errors.
2026-07-25 21:10:09 +00:00
Marshal
fde5e6de4b add company stamp upload functionality for contract signing
- Introduced StampUpload component for uploading company stamp images.
- Integrated stamp upload in contract signing modal, supporting PNG and JPG formats.
- Implemented validation for file type and size (max 5 MB).
- Added visual feedback for drag-and-drop functionality.
- Updated contract-related pages to handle duplicate contract alerts and pricing notices.
- Enhanced contract expiry management with a nightly sweep service.
- Added unit tests for new features and updated existing tests for contract handling.
2026-07-25 17:14:58 +00:00
Marshal
54b5882355 changes 2026-07-25 06:05:20 +00:00
Marshal
286390a3cf change contrat creation 2026-07-24 13:26:19 +00:00
Hagernesh
2f124bc666 Intercity load unload with grn ,Warehouse , fleet , and allocation endpoints permission 2026-07-24 11:55:05 +00:00
Hagernesh
cf8a2e928d fix(warehouses): detention groups by canonical truck type
Join truck_types via vehicles.truck_type_id (normalized legacy
vehicle_type only as fallback) so type renames can't unmatch detention
rules and FK-less vehicles keep billing.
2026-07-24 11:55:05 +00:00
Marshal
668b5e1c9d add permissions and fix issues 2026-07-23 20:24:20 +00:00
marshal
d585351501 Merge pull request #943 from Tria-plc/freight_feature/usermanagement
changes
2026-07-23 17:20:24 +03:00
Marshal
127676055b changes 2026-07-23 14:18:24 +00:00
marshal
cf13c8d175 Merge pull request #942 from Tria-plc/freight_feature/usermanagement
revert back the clerance payment
2026-07-23 16:56:56 +03:00
Marshal
15a6bab5d0 revert back the clerance payment 2026-07-23 13:54:09 +00:00
Nathnael Wondisha
b6c4a72d2b Merge pull request #941 from Tria-plc/freight/feat/fixes-v1
Freight/feat/fixes v1
2026-07-23 16:50:18 +03:00
Nathnael
dcc94643d0 feat(companies): enforce customers:* permissions on customer endpoints
The customers:* keys were seeded and present in the backoffice constants but
enforced nowhere except reset-password. Customer CRUD sat behind the coarse
edr_freight_app:admin umbrella, and every company read endpoint was unguarded.

Two routes could not be gated on the route alone, because the authority they
need depends on the request BODY, not the path:

  - PATCH /companies/:id carries `status` (UpdateCompanyDto extends
    PartialType(CreateCompanyDto)), so it both edits fields and blacklists.
  - PATCH /company-profiles/:profileId/status is approve, reject, suspend and
    blacklist on one route.

Both now take a one-of route guard and assert per-status against a shared
STATUS_PERM map: approving/reactivating needs customers:verify, suspending or
blacklisting needs customers:deactivate. PATCH /companies/:id additionally
requires customers:update when any non-status field is present, so a caller
holding only deactivate cannot rename a company. The backoffice mirrors the
same map so no button is offered that the server would reject.

GET /companies/:companyId/documents is left authenticated-only with the split
in the handler: it is dual-audience. The portal reads its own documents during
onboarding, and the contract-request detail page (gated on contracts:view)
reads the applicant's. Gating it on customers:view alone would have 403'd
customers on their own documents and blanked the contract reviewer's panel.

The two by-company customer-view reads take a one-of guard for the same reason
— otherwise a staffer granted only customers:view gets a detail page whose tabs
403 individually.

Frontend: the customers routes were sidebar-filtered but not wrapped in
RequirePermission, so direct URL navigation rendered them for anyone.

Verified: freight-api type-check clean; backoffice type-check unchanged from
HEAD (pre-existing errors only); 25 tests pass across the companies and
freight-permission suites. Not exercised against a running API.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 13:48:42 +00:00
Hagernesh Tadesse
1fc49c291f Merge pull request #939 from Tria-plc/Truckmaintenance
disputes only before acknowledgement, registered disputes immutable (…
2026-07-23 15:07:05 +03:00
Hagernesh
cee3a4f429 disputes only before acknowledgement, registered disputes immutable (view-only), cancel action removed end-to-end, and internal UUIDs removed from the document, detail view, and list. 2026-07-23 12:02:57 +00:00
Nathnael
48f1d08faf Merge branch 'dev' into freight/feat/fixes-v1 2026-07-23 11:51:04 +00:00
Hagernesh
73f36fe46e Export interchange document — a generation error after Djibouti unloading failed the whole request and left the document missing until a manual rerun. Generation is now best-effort (unload never fails on paperwork) and reruns backfill the document. 2026-07-23 11:31:44 +00:00
marshal
4df17f36ce Merge pull request #935 from Tria-plc/freight_feature/usermanagement
changes
2026-07-23 14:07:03 +03:00
Marshal
13609f8d59 changes 2026-07-23 11:06:10 +00:00
ghost2023
eab6f54e98 fix: rm iam seeder 2026-07-23 11:43:46 +03:00
Hagernesh
fb1e4ffcb3 fix(maintenance): schema-qualify maintenance_intervals migration
createUniqueConstraint/createForeignKey used bare table names, which
resolve against the default schema (public) while the table was created
in freight — the migration failed on boot and rolled back every start.
Rewritten as idempotent schema-qualified SQL (unique index replaces the
constraint, FK inline on the column).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 08:18:33 +00:00
Hagernesh
f2f6ac616f KM-Based Maintenance Scheduling 2026-07-23 07:53:11 +00:00
Hagernesh
4abcc909af feat(warehouses): persist saved signature image on handover sign
Store the signer's saved-signature URL on booking_handovers (new
signature_image_url column) when a handover is signed — per-truck or
booking-level — so signed handover documents can render the actual
signature, matching the contract-signing flow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 07:53:11 +00:00
Hagernesh
fa59ccfc95 feat: implement KM-based maintenance scheduling
Add maintenance intervals configuration to track maintenance by kilometers
driven. When a maintenance is marked COMPLETED, automatically calculate and
schedule the next maintenance based on interval + current odometer reading.

Features:
- MaintenanceInterval entity: stores KM/day intervals per vehicle & type
- scheduleNextMaintenance(): creates next SCHEDULED item after completion
- nextDueKm field: tracks when next maintenance is due (in kilometers)
- getDueBoard() queries already support KM-based tracking

Maintenance now "marches forward" based on distance driven, not just dates.
Each vehicle type can have different intervals (e.g., oil every 10k km, tires 50k km).

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-23 07:53:11 +00:00
Nathnael
cbff529e31 feat: rebuild the admin pages 2026-07-23 07:40:48 +00:00
marshal
b756ae2f1c Merge pull request #929 from Tria-plc/freight_feature/usermanagement
fix configratio
2026-07-23 09:50:49 +03:00
Marshal
8f143b2341 fix configratio 2026-07-23 06:48:03 +00:00
marshal
b43763ad39 Merge pull request #927 from Tria-plc/freight_feature/usermanagement
implement freight permissions for trains, wagons, and routes
2026-07-23 09:04:24 +03:00
Marshal
fd05655ecc implement freight permissions for trains, wagons, and routes 2026-07-23 06:03:43 +00:00
marshal
f5f41e0a5a Merge pull request #926 from Tria-plc/freight_feature/usermanagement
implement freight permissions for trains, wagons, and routes
2026-07-23 08:57:59 +03:00
Marshal
129a4d1d0a implement freight permissions for trains, wagons, and routes 2026-07-23 05:57:14 +00:00
marshal
edfd0a859d Merge pull request #925 from Tria-plc/freight_feature/usermanagement
add e2e test
2026-07-23 08:27:29 +03:00
Marshal
2481f43f1f add e2e test 2026-07-22 23:44:32 +00:00
marshal
091dd0bfa3 Merge pull request #923 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-23 00:02:55 +03:00
Marshal
b0f561a935 Add end-to-end tests for import corridor flows
- Implement full train import journey with six container bookings filling a 54-wagon train.
- Create tests for split offer and rebooking scenarios, handling payment expiry and waiting list promotions.
- Add tests for handling waiting bookings expiration when the train is full.
- Implement tests for reopening booking windows after expired reservations.
- Seed database with necessary corridor data for import flows, including yards, container types, locomotives, and rates.
2026-07-22 21:02:17 +00:00
Marshal
5709801590 enhance shipment form and booking process 2026-07-22 17:25:01 +00:00
Hagernesh
15540f78e2 fix(portal): Table has no size prop in BulkTruckUploadModal 2026-07-22 14:11:58 +00:00
Hagernesh
ec066f3d29 Fix:
Added assertCapacity() checks before saving (matches single receive)
Added applyCapacityDelta() after save to increment counters
Now validates warehouse → yard → zone capacity hierarchy
Single receive already had both checks; bulk receive was gap.
2026-07-22 13:18:36 +00:00
marshal
a3037749b4 Merge pull request #912 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-22 15:35:11 +03:00
Marshal
ef840241c0 permision 2026-07-22 12:34:08 +00:00