Commit Graph

919 Commits

Author SHA1 Message Date
Nathnael
6dde17fa4d fix: premature payable invoice 2026-07-16 08:38:49 +00:00
Nathnael
08faf56c4f fix: payment autopay on the payment init added for testing 2026-07-16 06:43:30 +00:00
marshal
50d5ce5ad9 Merge pull request #721 from Tria-plc/freight_feature/usermanagement
fix issue
2026-07-16 04:06:52 +03:00
Marshal
fe29b38377 fix issue 2026-07-16 01:05:57 +00:00
marshal
ea22f38adf Merge pull request #720 from Tria-plc/freight_feature/usermanagement
fix issue
2026-07-16 03:34:14 +03:00
Marshal
41fe04652f fix issue 2026-07-16 00:33:31 +00:00
marshal
67bc835458 Merge pull request #719 from Tria-plc/freight_feature/usermanagement
implement empty-container return service: add return quantity handlin…
2026-07-16 02:06:08 +03:00
Marshal
234a74e812 implement empty-container return service: add return quantity handling, update related DTOs, services, and UI components 2026-07-15 22:48:04 +00:00
marshal
e3fccbd24d Merge pull request #717 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-15 23:18:55 +03:00
Marshal
fc44eee25e implement update train details feature: add DTO, service method, and UI modal for editing train name and run numbers 2026-07-15 20:14:39 +00:00
Hagernesh
2647776d19 feat(warehouse): stamp actor as display name instead of UUID
Add actorLabel(user) — resolves the authenticated user to a readable name
(name → username → email → id) — and use it for the performed_by audit stamp on
every warehouse action, so the activity log shows a person, not a UUID. The
freight DB has no users table to join, so the name is stamped at write time.
approve-delivery keeps the raw user id (it is an id argument, not the audit
label). Existing rows keep their prior value; this applies going forward.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 15:24:05 +00:00
Hagernesh
2044312d93 feat(warehouse): stamp authenticated user as action actor (performedBy)
Warehouse mutation endpoints now record the JWT-authenticated user as the actor
(user.id) instead of trusting a client-supplied performedBy string, unlocking
per-operator productivity metrics and a trustworthy audit trail. Covers receive,
receive-bulk, reserve, store, ready-for-loading, ready-for-pickup, load-onto-
train, bulk-dispatch, dispatch, deliver, gate-clearance, approve-delivery, the
Djibouti/import auto-unload actions, and fee-invoice generation. The prior
client value is kept only as a fallback for unauthenticated/internal calls.

move/load do not yet carry an actor (their DTOs have no performedBy) — separate
follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 14:51:21 +00:00
Marshal
d7d9db9c3a changes 2026-07-15 14:27:00 +00:00
Hagernesh
ac90b04be0 feat(warehouse): P2 dashboard — gate/dock throughput + live auto-refresh
- gateStats(): items cleared through the gate today, average arrival→gate
  turnaround (hours, 30d), and clearances per hour over the last 24h → new
  GateThroughputCard in the dashboard Performance section.
- Live board: every dashboard query (dashboard, ops, throughput, dwell, cycle,
  on-time, zone occupancy, accrual, gate) now auto-refreshes on a 60s interval,
  with a "Live" indicator in the header.

New endpoint GET /warehouse-inventory/gate-stats (guarded). Deferred (need
upstream data): capacity forecast, labour productivity, WebSocket push, yard map.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 14:26:02 +00:00
Hagernesh
fc4aadbc57 feat(warehouse): P1 dashboard analytics — dwell/aging, cycle-time + on-time, live deltas
Adds the operational-performance layer to the warehouse cockpit:

- Dwell time & aging: dwellStats() (avg + 0-3/4-7/8-14/15+ buckets over
  in-warehouse items) → DwellAgingCard histogram.
- Cycle time & on-time: cycleStats() (arrived→ready→loaded→dispatched stage
  averages + dock-to-dispatch) and onTimeDispatchStats() (share of items that
  left before their storage free-days expired, resolved via the fee engine's
  own rule matching) → CycleTimeCard.
- Live tiles: opsStats() now returns receivedYesterday; KpiStrip renders an
  optional ▲/▼ delta, and the ops strip shows received-today vs yesterday.

New endpoints: GET /warehouse-inventory/{dwell-stats,cycle-stats} and
/warehouse-fees/on-time-dispatch (all guarded). New "Performance" section on
WarehouseDashboardPage. On-time reads N/A when there is no sample / no active
storage rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 13:55:39 +00:00
marshal
6391ba837a Merge pull request #707 from Tria-plc/freight_feature/usermanagement
changes
2026-07-15 16:30:28 +03:00
Marshal
19c9da28ae changes 2026-07-15 13:29:01 +00:00
Hagernesh
2e22b72e27 feat(warehouse): assemble dashboard cockpit + server-side throughput series
- WarehouseDashboardPage now composes the ops KPI strip, lifecycle cards, flow
  charts, zone-occupancy heatmap and demurrage/accrual exceptions into one
  control-tower view; drop the redundant lifecycle donut.
- New GET /warehouse-inventory/throughput (date_trunc time series) replaces the
  client-side buildTrend that downloaded the entire inventory list to bucket it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:27:53 +00:00
SennayT
f9706c9fb0 refactor: separate base image configuration into Dockerfile.base for improved build management 2026-07-15 10:51:35 +00:00
SennayT
3416585a01 add puppeteer support 2026-07-15 13:42:42 +03:00
marshal
7700aa6358 Merge pull request #701 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-15 13:32:37 +03:00
Marshal
c71a0043d6 implement wagon maintenance feature: add functionality to detach wagons and move them to maintenance status 2026-07-15 10:32:09 +00:00
Marshal
11771e5f92 remove reopen delay minutes from global rules and update related types
- Removed the  field from  and related components.
- Updated  to reflect the removal of the reopen delay input field.
- Modified  to include new train number fields:  and .
- Added  interface to manage active schedules with trade direction.
- Introduced  interface to track wagon shortages in bookings.
- Updated  logic to ensure consistent UI state representation.
- Created migrations to drop the  column and add  and  columns to the  table.
- Added tests for the new booking window display logic and wagon planning functionality.
2026-07-15 09:13:02 +00:00
Marshal
9be7f356f0 enhance train scheduling logic to exclude cancelled trains and refine window filtering 2026-07-15 07:07:10 +00:00
Hagernesh
7e934b3433 feat(warehouse,last-mile): truck load size rule, dedup last-mile, driver-required + arrival prefill
Truck loading:
- loadTruck enforces max 2 containers / one 40ft (two 20ft) and auto-marks an
  assigned truck arrived on load; container-items payload + modal expose
  container size with a client-side selection cap.
- Show "#x containers pending assignment" in the portal truck card and the
  backoffice container modal.

Last-mile:
- create() is idempotent — return the existing record for a booking instead of
  inserting a duplicate delivery row (fixed the same booking showing twice in
  Assign-Mile).
- setVehicles/update reject a truck with no assigned driver; the Assign toast
  now surfaces the reason.
- New GET /last-mile/booking/:id/arrival-trucks returns assigned EDR trucks with
  driver details; ReleaseOrderModal fetches and auto-fills them so an assigned
  EDR truck no longer reads as "not assigned yet".

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 14:16:45 +00:00
Marshal
5cffe2860c fix train builder and consolidation 2026-07-14 13:49:39 +00:00
Marshal
01459bd73c train 2026-07-14 13:11:38 +00:00
Marshal
b5a97d344a train 2026-07-14 13:10:00 +00:00
Hagernesh
65f6015c5e feat(warehouse): guard warehouse/inventory/fee endpoints with RBAC permissions
Apply JwtGuard + FreightPermissionGuard (via @BookingStaff) to 83 staff
endpoints across the 8 warehouse controllers, using existing
edr_freight_app:warehouse* permissions: warehouses/yards/zones,
inventory receive/move/load/unload/dispatch/gate-pass/release/deliver/inspect
(incl. import & export queues), allocation + fee rules (demurrage/storage/
double-handling), accrual dashboard + acknowledge, and fee invoices.

Customer-portal endpoints (booking-scoped documents, approve-delivery,
portal fee-invoice view/document/receipt/pay-online) are intentionally left
unguarded — they need a customer-ownership guard, not staff permissions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 12:54:41 +00:00
Hagernesh
a367306565 feat(warehouse): accrual acknowledge/snooze + zone weight fix, handover signer, portal delivery
Accrual dashboard:
- warehouse_accrual_acks table (migration 2140) + acknowledge/unacknowledge
  endpoints; dashboard rows carry acknowledged/snoozeUntil, acked items sink
  and are skipped by the alert cron. Row menu: mark reviewed / snooze 3d / 7d /
  un-acknowledge; acked rows dimmed with a "Reviewed" badge.
- Fix zone weight occupancy: normalise inventory kg vs zone-capacity tonnes.

Handover (rode along, shared files):
- Require signer full name on delivery handover (signature optional);
  migration 2130 adds signer_name.

Portal delivery/docs (rode along, shared files):
- Approve-delivery name capture, booking-scoped GRN/release docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 12:54:41 +00:00
Hagernesh
d9fe79e160 accrual dashboard for port and terminal or warehouse related documents 2026-07-14 12:54:40 +00:00
Hagernesh
a542a13893 wAREHOUSE kPI strips 2026-07-14 12:54:40 +00:00
marshal
f7f311660b Merge pull request #672 from Tria-plc/freight_feature/usermanagement
train
2026-07-14 14:09:18 +03:00
Marshal
6d0cf50b4d train 2026-07-14 11:06:49 +00:00
marshal
42f948b835 Merge pull request #659 from Tria-plc/freight_feature/usermanagement
enhance contract clearance and train scheduling logic; add filters fo…
2026-07-14 09:54:00 +03:00
Marshal
957a185a4d enhance contract clearance and train scheduling logic; add filters for clearance documents and improve booking validation 2026-07-13 21:40:10 +00:00
Hagernesh
4e8d35a7fb Warehouse zone occupancy heatmap
Visualize live per-zone occupancy on the warehouse detail page.
2026-07-13 12:09:43 +00:00
marshal
1034756bab Merge pull request #647 from Tria-plc/freight_feature/usermanagement
update train scheduling logic to clear trainScheduleId when unassigni…
2026-07-13 14:48:06 +03:00
Marshal
3fe4ea72ac update train scheduling logic to clear trainScheduleId when unassigning bookings 2026-07-13 11:47:27 +00:00
marshal
19fc480cc1 Merge pull request #646 from Tria-plc/freight_feature/usermanagement
improve group window
2026-07-13 14:08:10 +03:00
Marshal
9e748d6291 improve group window 2026-07-13 11:07:14 +00:00
Hagernesh
f655289eec :Merge branch 'dev' of github.com:Tria-plc/edr-platform into uienhancement
Please enter a commit message to explain why this merge is necessary,
:qa!
2026-07-13 09:57:21 +00:00
Hagernesh
ae30441f07 Truck assignment for Export before loading and import after arrival 2026-07-13 09:53:33 +00:00
marshal
7001bf9c7f Merge pull request #644 from Tria-plc/freight_feature/usermanagement
remove Puppeteer from docker
2026-07-13 12:30:27 +03:00
Marshal
55bc36742b remove Puppeteer from docker 2026-07-13 09:29:35 +00:00
marshal
61cc4fab00 Merge pull request #643 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-13 12:11:12 +03:00
Marshal
93884a43e8 Puppeteer PDF rendering by adding necessary dependencies and skipping Chrome download 2026-07-13 09:02:04 +00:00
marshal
43cd0223aa Merge pull request #642 from Tria-plc/freight_feature/usermanagement
add wagon allocation snapshot to train schedules
2026-07-13 11:57:24 +03:00
Marshal
a4ccdb1173 add wagon allocation snapshot to train schedules 2026-07-13 08:56:06 +00:00
marshal
2e87e60776 Merge pull request #641 from Tria-plc/freight_feature/usermanagement
enhance booking and contract management features
2026-07-13 09:44:36 +03:00