826 Commits

Author SHA1 Message Date
Nathnael
e823874d39 feat(auth): add login audience middleware (EDRFREIGHT-415) 2026-07-28 10:46:55 +00:00
Marshal
653d5782ee update body-parser implementation to use Nest's API and improve dependency handling 2026-07-28 07:21:04 +00:00
Marshal
c1c35e78d4 increase JSON body size limit, update awaiting shipment endpoint handling, and enhance contract document editor UI 2026-07-28 06:18:04 +00:00
Marshal
f40a079420 update contract document handling and improve clarity in UI messages 2026-07-28 05:51:24 +00:00
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
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
5e10c97294 add dispute functionality for contract duty and implement collection dates 2026-07-26 16:58:51 +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
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
d603c0973d Merge pull request #944 from Tria-plc/freight_feature/usermanagement
changes
2026-07-23 17:31:29 +03:00
Marshal
40f16f3cec changes 2026-07-23 14:30:49 +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
Hagernesh
67f606e50a Portal: truck assignment — template download next to Bulk Upload
The External Truck Assignment card only exposed the Excel template from inside the Bulk Upload modal. A Download Template  button now sits beside Bulk Upload in the card header, matching the container-import pattern in the booking form, so customers can grab the template without opening the modal first.
2026-07-23 09:24:13 +00:00
Hagernesh
f2f6ac616f KM-Based Maintenance Scheduling 2026-07-23 07:53:11 +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
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
Hagernesh Tadesse
11437cfd35 Merge pull request #905 from Tria-plc/testfixes
Fixes
Download Excel template with instructions
Parse uploaded file, preview trucks
Validate container assignments (1x40ft OR 2x20ft per truck)
Commit bulk upload in one call
2026-07-22 13:54:59 +03:00
Hagernesh
7763d67ea8 feat: bulk upload for customer truck assignments
Add Excel template-based bulk upload for customer truck assignments
(self-haul + EDR). Supports up to 2x20ft or 1x40ft containers per truck.

API: POST /bookings/:id/customer-trucks/bulk accepts array of trucks.
Portal: DownloadTemplate → ParseExcel → PreviewUpload → Commit flow.
Validates truck load rules per booking container configuration.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-22 08:01:16 +00:00
Nathnael
16dc143e66 fix: the invoice and receipt documents in the booking 2026-07-22 08:00:38 +00:00
Nathnael
82c5fb88dc fix: type errors 2026-07-22 07:29:16 +00:00
Nathnael
1da08131ea fix: merge 2026-07-22 07:26:25 +00:00
Nathnael
8d4b133277 fix: port 2026-07-22 07:20:51 +00:00
Nathnael
179d6eea9e Merge branch 'dev' into freight/feat/fixes-v1 2026-07-22 07:20:08 +00:00
Nathnael
82cb5508cc chore: rm the active company profile 2026-07-22 06:43:05 +00:00
Hagernesh
b54cb2483e Card called GET /warehouse-inventory (staff perm) → 403 swallowed as
empty state. New customer-safe bookings/:id/location endpoint returns
location fields only; card now uses it.
2026-07-21 14:15:56 +00:00
Hagernesh
89d82f45c6 fix padding on portal 2026-07-21 14:01:10 +00:00
Nathnael
d95af0ea72 style: show the profile and the review ont the settings 2026-07-21 12:13:18 +00:00
Hagernesh
86569f7490 Customer portal card displays warehouse location data (warehouse/yard/zone + arrival time) once cargo arrives at warehouse. Shows loading state during fetch, placeholder text if not yet received. Type-check passes. 2026-07-21 11:55:18 +00:00
Hagernesh
ed503f1e6b feat(portal): show warehouse location for arrived cargo
Display cargo warehouse location (warehouse, yard, zone, arrival time) on
the portal booking detail page once the cargo has been received and
assigned to a warehouse location.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-07-21 11:55:18 +00:00
Marshal
6f8456631c Implement intercity document handling and rejection notes for contracts 2026-07-21 10:20:36 +00:00
Marshal
ceb32e0a80 Implement intercity document handling and rejection notes for contracts 2026-07-21 10:15:18 +00:00
Nathnael
4afffca3d2 fix(companies): honest status errors and per-role suspension visibility
A suspended customer trying to create a contract was told their account
was "awaiting approval" - the guards collapsed every non-active status
into the pending message. Contract and booking creation now go through a
shared assertCompanyActiveFor that names the real company status, and
the per-role guard names the role's actual state (suspended,
blacklisted, rejected - with the reviewer note) so a customer suspended
for one operation knows the others still work.

Portal: the operation dropdown gets a Suspended badge, the block modal a
suspended branch quoting the staff message, and the wizard a
suspended/blacklisted gate instead of falling through to a submit error.

EDRFREIGHT-234
2026-07-21 09:09:34 +00:00
Nathnael
4f6a559ae3 feat(portal): reviewer note and resubmit for rejected roles in settings
A customer whose role was rejected saw only a bare "Rejected" chip in
settings - the reviewer's note and the resubmit action existed solely
inside the contract wizard's block modal, so fixing and reapplying from
the profile page was impossible. The settings role card now shows the
reviewer note (for suspended roles too) and offers "Resubmit for
approval", which flips the role back to Pending and notifies the
backoffice through the existing roleReapplied inbox event.

RoleCard's locked variant now renders as a plain box instead of a
button so it can host the action button (buttons cannot nest) and the
new detail line.

EDRFREIGHT-233
2026-07-21 09:09:04 +00:00
Marshal
603537a20b add yard distances management to rule engine
- Introduced new yard distances resource with CRUD operations.
- Created migration for yard distances table with necessary constraints.
- Implemented service and repository for yard distances handling.
- Added controller for API endpoints to manage yard distances.
- Updated rule engine configuration to include yard distances.
- Enhanced rule engine resource page to support yard distance selection.
- Updated contracts and train builder pages to handle new yard distance logic.
- Added error handling utility for better error message extraction.
2026-07-21 08:50:50 +00:00
Nathnael
af171974f8 Merge branch 'dev' into freight/feat/fixes-v1 2026-07-21 07:36:09 +00:00
Nathnael
fd5aedcec7 feat(companies): per-document change requests and resubmission review queue
Two review-workflow gaps for freight customer onboarding:

Request for change per document. Backoffice can now flag a single uploaded
document (company document, profile licence, or POA delegation letter) with a
note the customer sees, instead of rejecting the whole role over it. Adds
review_status/review_note/reviewed_by/reviewed_at to freight.files (migration
AddFileReviewStatus, partial index for the gate), a POST
documents/:fileId/request-change endpoint, the backoffice action + modal, and a
portal banner/badge so the customer knows what to re-upload. Re-uploading clears
the flag. Approving a role is blocked while any of its documents has an open
correction; the gate check and the status write share a pessimistic write lock
on the company row (as does the change-request write) so a correction can never
slip in between the check and the profile going Active.

Resubmission is visible to reviewers. When a customer resubmits a rejected role
or amends a change request, backoffice staff are notified (allBackoffice inbox
item, deep-linked to the customer) and the resubmission surfaces in a new
"Pending changes" list view + KPI, since such companies are status = active and
never matched the pending-approval filter.
2026-07-21 07:34:40 +00:00
Nathnael
1cfc0f0fa8 fix(onboarding): stop duplicate company-document upload on finalize
The documents step of CompanyProfileForm uploads company documents via
onUploadDocuments() and then triggers submit synchronously in the same
nextStep() call. The setDocumentFiles({}) that clears the staged files has
not re-rendered by the time finishMutation's closure runs, so reading
documentFiles there re-sent the exact same files and created a duplicate
row per document.

Drop the company-document upload from finishMutation — the documents step
already persisted them. Licenses stay, since they have no auto-upload path.
2026-07-21 07:34:20 +00:00
marshal
92375caa59 Merge pull request #852 from Tria-plc/freight_feature/usermanagement
Fix CSS formatting for bookings table class to ensure proper styling …
2026-07-20 22:35:50 +03:00
marshalyordanos
8e74604a07 Fix CSS formatting for bookings table class to ensure proper styling and layout. 2026-07-20 22:35:01 +03:00
marshal
73f067aeed Merge pull request #849 from Tria-plc/freight_feature/usermanagement
Add container and contract information cards to booking detail views
2026-07-20 21:55:57 +03:00
marshalyordanos
43df24142c Add container and contract information cards to booking detail views
- Integrated CompanyInfoCard, ContainersCard, and ContractInfoCard into ChangesRequestedView, DraftBookingView, and ReadonlyBookingView components.
- Updated utils to handle new booking detail types and improve container summary calculations.
- Enhanced ShipmentDetailsCard and ScheduleCard to utilize updated booking detail structure and display relevant information more effectively.
2026-07-20 21:55:17 +03:00