Commit Graph

3226 Commits

Author SHA1 Message Date
natib21
57f49a9333 fix 2026-07-17 11:03:23 +00:00
natib21
3376f106b7 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/user_management_UI 2026-07-17 10:37:46 +00:00
natib21
ef88240365 fix train build 2026-07-17 10:37:20 +00:00
marshal
39a48a2c30 Merge pull request #761 from Tria-plc/freight_feature/usermanagement
fix rate edit
2026-07-17 13:31:08 +03:00
yaschalew10
ae49bdedf8 Merge pull request #760 from Tria-plc/freight/feature/user_management_UI
Freight/feature/user management UI
2026-07-17 13:30:34 +03:00
natib21
b3042225e5 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/user_management_UI 2026-07-17 10:29:39 +00:00
natib21
3bb4c8fb42 fix build num 2026-07-17 10:29:27 +00:00
natib21
8671b982c5 fix null value 2026-07-17 10:18:41 +00:00
yaschalew10
88e93652a6 Merge pull request #759 from Tria-plc/freight/feature/user_management_UI
Freight/feature/user management UI
2026-07-17 13:16:38 +03:00
Marshal
801872c106 fix rate edit 2026-07-17 10:15:26 +00:00
natib21
99f67d6035 Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/user_management_UI 2026-07-17 10:13:46 +00:00
natib21
a9d65e04fc fix number of wagon 2026-07-17 10:12:43 +00:00
yaschalew10
17616af3db Merge pull request #758 from Tria-plc/freight/feature/user_management_UI
Freight/feature/user management UI
2026-07-17 12:51:48 +03:00
natib21
a2a20b4222 gti Merge branch 'dev' of github.com:Tria-plc/edr-platform into freight/feature/user_management_UI 2026-07-17 09:47:56 +00:00
natib21
84d5add58e fix four digit 2026-07-17 09:47:37 +00:00
yaschalew10
9ade4b2c83 Merge pull request #757 from Tria-plc/freight/feature/user_management_UI
Freight/feature/user management UI
2026-07-17 12:37:22 +03:00
marshal
28e67d555d Merge pull request #756 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-17 12:21:06 +03:00
Marshal
18311f22f7 Comment out payment event handling for local demos in BillingService 2026-07-17 09:20:36 +00:00
Marshal
308df1c61c fix schule issue and contianer type issue 2026-07-17 09:18:26 +00:00
Marshal
7b7e7c3f62 fix schule issue and contianer type issue 2026-07-17 09:16:35 +00:00
natib21
1abf71306e add export/inport number 2026-07-17 09:15:21 +00:00
Nathnael Wondisha
0e9705ee21 Merge pull request #755 from Tria-plc/freight/feat/fixes-v1
Freight/feat/fixes v1
2026-07-17 11:55:43 +03:00
Nathnael
ef74bc442a fix: prevent the backoffice from approve the user before he submits 2026-07-17 08:54:24 +00:00
natib21
b4118e1bd4 add export/inport number 2026-07-17 08:47:52 +00:00
Nathnael
0883c54465 Merge branch 'dev' into freight/feat/fixes-v1 2026-07-17 08:27:25 +00:00
ghost2023
bd81bbfc2c style: sidebar improvmetn 2026-07-17 11:15:58 +03:00
Hagernesh Tadesse
d0cdba6d29 Merge pull request #754 from Tria-plc/export-train-loading
Export train loading
2026-07-17 11:03:35 +03:00
Hagernesh
fc636fbe4f fix(warehouse): scope the arrival GRN stamp to EXPORT only
The previous commit made autoUnloadArrived and unloadBooking raise a GRN for any
direction, which changed import behaviour. Import keeps its own GRN handling
(autoUnloadArrivedBookings) and is left exactly as it was. Both paths now stamp a
GRN only when the booking is EXPORT — the direction whose cargo needs one to be
loaded onto a train. Import and domestic behave as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:58 +00:00
Hagernesh
a95667fde4 fix(warehouse): raise a GRN on every warehouse receipt
Requiring a GRN before loading only works if every path into the warehouse
issues one. Two did not: autoUnloadArrived and unloadBooking created RECEIVED
inventory with a null grn_number, so cargo that genuinely arrived — by first
mile or self haul — would have been stuck un-loadable behind the new gate.

Both now stamp a GRN, derived from the booking's trade direction, matching
receive/bulkReceive/autoUnloadArrivedBookings. unloadBooking keeps an
already-issued GRN when it re-unloads an existing row rather than reissuing one.

Every path that creates warehouse inventory now issues a GRN, so the chain is
seamless: booking arrives (first mile or self haul) -> received -> GRN -> loadable
onto its allocated wagon.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:58 +00:00
Hagernesh
a26fa61d66 feat(warehouse): require a GRN before export cargo can be loaded onto a train
The export chain is: paid -> received into the warehouse -> GRN raised on arrival
-> loaded onto the allocated wagon. Receipt was already structural (the inventory
row only exists once receive() runs) and the wagon was already required, but the
GRN was merely displayed, never enforced — so cargo could be loaded and
dispatched without one.

- loadable now also requires a GRN, so the queue won't offer un-GRN'd cargo.
- loadItemsOntoTrain skips items with no GRN, so the rule holds server-side and
  a hand-made API call can't bypass it.
- Read the GRN from inv.grn_number (what receive() stamps) and fall back to the
  note only for legacy/seeded rows; it previously read the note alone, which the
  real receive path merely mirrors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:57 +00:00
Hagernesh
d9db4cbc0c fix(train-scheduling): scope the not-loaded dispatch guard to EXPORT only
The guard fired on every dispatch. Loading out of an origin warehouse is an
export concept — import cargo isn't loaded from a warehouse, so its warehouse
inventory says nothing about what's aboard and the check would have blocked
legitimate import dispatches. Derive the route direction (reusing
deriveTradeDirection, as the warehouse loading queue does) and return early for
anything that isn't EXPORT. Import and domestic behave exactly as before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:57 +00:00
Hagernesh
2798fed6d8 fix(train-scheduling): block dispatch when allocated cargo is not loaded
dispatchSchedule guarded status, Djibouti departure rules, locomotives and
wagons — but never checked the cargo. A train could be dispatched while the
bookings allocated to it sat received in the warehouse, silently leaving them
behind. Dispatch now refuses when an allocated booking has warehouse inventory
in RECEIVED/STORED/READY_FOR_LOADING, naming the bookings and pointing at the
two ways out: load them, or drop the wagon allocation so they ride a later
train. Bookings with no inventory at all are not blocked — allocating a wagon
before the goods arrive is normal planning.

Also drops RESERVED from the Load-to-Train filters: reserved stock is not
awaiting loading.

The sched_bookings CTE moves to common/schedule-bookings.sql so the warehouse
loading queue and this dispatch guard resolve a train's bookings identically —
if they drift, a train departs leaving cargo the warehouse still expects to load.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:57 +00:00
Hagernesh
e115b9b753 fix(warehouse): resolve Load-to-Train bookings from wagon allocation
The Load-to-Train queue was permanently empty for real traffic. loadableTrains()
and trainLoadableItems() gated on freight.train_schedule_bookings, but nothing in
the application writes that table — only the demo seeders do. Real wagon
allocation writes wagon_booking_allocations, reached via
train_schedules -> train_sets -> train_set_wagons, so an allocated export booking
never satisfied the EXISTS gate and no train ever appeared.

Both queries now resolve a schedule's bookings through a shared sched_bookings
CTE that unions the wagon-allocation chain with train_schedule_bookings, so real
allocations show up and the seeded demo scenarios keep working. The panel already
groups the returned rows by booking with their containers, so the queue now lists
the train, its bookings and their containers for selection.

Export flow this serves: booked -> paid -> received at the warehouse (first-mile
or self-haul) -> GRN -> loaded onto the wagons allocated to the booking.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-17 08:01:57 +00:00
Abubeker Yasin
6c5ab98e4e Merge pull request #751 from Tria-plc/alpha
Alpha
2026-07-17 10:58:54 +03:00
marshal
2def8f9b0e Merge pull request #753 from Tria-plc/freight_feature/usermanagement
Comment out payment event handling for local demos in BillingService
2026-07-17 10:49:46 +03:00
Marshal
5a1e0dba4d Comment out payment event handling for local demos in BillingService 2026-07-17 07:43:17 +00:00
Roba Boru
0c584cce88 Merge branch 'dev' of https://github.com/Tria-plc/edr-platform into alpha 2026-07-17 10:21:12 +03:00
Roba Boru
610580e15e Added discrepancy management for duplicate seats 2026-07-17 10:20:35 +03:00
Nathnael Wondisha
f769d97135 Merge pull request #752 from Tria-plc/freight/feat/fixes-v1
Freight/feat/fixes v1
2026-07-17 10:01:44 +03:00
Roba Boru
4bc7d0ecf5 Merge branch 'dev' of https://github.com/Tria-plc/edr-platform into alpha 2026-07-17 08:43:20 +03:00
Roba Boru
ea8f91a415 Merge branch 'alpha' of https://github.com/Tria-plc/edr-platform into alpha 2026-07-17 08:43:08 +03:00
Roba Boru
2366b28610 remove the cron job 2026-07-17 08:42:42 +03:00
Stephanos A
f3c0fd6cbb Merge branch 'alpha' of github.com:Tria-plc/edr-platform into alpha 2026-07-17 00:49:50 +03:00
Stephanos A
e59b797477 Minor updates 2026-07-17 00:49:35 +03:00
robiman
92aa0e9252 Merge pull request #750 from Tria-plc/alpha
Added cron job that check duplicate seat and assign if free available
2026-07-16 23:24:25 +03:00
Roba Boru
1bba6dd9fc Merge branch 'dev' of https://github.com/Tria-plc/edr-platform into alpha 2026-07-16 23:22:55 +03:00
Roba Boru
969c524afe Added cron job that check duplicate seat and assign if free available 2026-07-16 23:22:20 +03:00
marshal
d8ec9b3436 Merge pull request #749 from Tria-plc/freight_feature/usermanagement
Freight feature/usermanagement
2026-07-16 23:13:01 +03:00
Marshal
71507b27fd changes 2026-07-16 20:09:59 +00:00
Marshal
35c53e3f36 changes 2026-07-16 20:03:35 +00:00