mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 12:28:21 +00:00
feat(loading): notify loaded and left-behind containers, surface the CAS
A booking is routinely loaded in parts, and nothing told the customer which containers boarded and which stayed behind. The carriage acceptance sheet was the only record, and it both totalled up cargo still sitting in the yard and lived inside a Warehouse documents bundle that direct truck-to-train cargo has no business in. The sheet now marks each wagon Loaded or Not loaded and totals only the loaded ones. On load, the customer gets an in-app, SMS and email notice carrying the train number, route, departure time and both container lists — capped to a summary on SMS and email, complete in the inbox. Anything left behind also raises a warehouse-desk notice so somebody owns finding it space. That desk is addressed by a new warehouse_inventory:get_notification permission: a recipient selector, not a route guard, so ops can assign who gets pinged without granting access to anything. The GRN notice went out over SMS alone, to whatever phone number the gate clerk typed. Where the receive carries a booking it now resolves the company and delivers in-app, SMS and email, skipping the typed phone so the customer is not texted twice; manual and backlog receives keep the old path.
This commit is contained in:
@@ -31,7 +31,11 @@ import { TrainCheckpointEvent } from './entities/train-checkpoint-event.entity';
|
||||
import { assertExportReceivedWithGrn, DIRECT_TO_TRAIN } from '../../common/export-received-gate';
|
||||
import { NotificationsService } from '../notifications/notifications.service';
|
||||
import { NotificationInboxService } from '../notification-inbox/notification-inbox.service';
|
||||
import { notifyCarriageAcceptanceReady } from '../notifications/notify-company.util';
|
||||
import {
|
||||
notifyCarriageAcceptanceReady,
|
||||
notifyLoadManifest,
|
||||
} from '../notifications/notify-company.util';
|
||||
import { FREIGHT_PERMS } from '../../seed/freight-permissions.registry';
|
||||
|
||||
/**
|
||||
* Per-booking journey along a train's corridor — for EVERY trade direction.
|
||||
@@ -267,6 +271,20 @@ export class BookingJourneyService {
|
||||
});
|
||||
});
|
||||
|
||||
// What actually boarded, and what did not. A booking is routinely loaded in
|
||||
// parts; the customer is told both halves, and the warehouse desk is told
|
||||
// about the leftovers so somebody owns placing them. After the transaction:
|
||||
// the lists are read back from the allocation statuses it just wrote.
|
||||
void notifyLoadManifest(
|
||||
this.dataSource,
|
||||
this.notifications,
|
||||
this.inbox,
|
||||
bookingId,
|
||||
scheduleId,
|
||||
FREIGHT_PERMS.warehouseInventory.getNotification,
|
||||
this.logger,
|
||||
);
|
||||
|
||||
// Customer tracking: cargo is on the train — loading milestones plus the
|
||||
// direction's "departed" handoff. Doc-trigger path no-ops non-customs
|
||||
// bookings (intercity) and already-completed codes.
|
||||
|
||||
Reference in New Issue
Block a user