mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 14:50:57 +00:00
interchange document generation and acknowledgement
This commit is contained in:
@@ -329,7 +329,7 @@ export class SchedulingReadFacade {
|
||||
}
|
||||
if (filter.destination) {
|
||||
params.push(`%${filter.destination}%`);
|
||||
where.push(`(dy.code ILIKE $${params.length} OR dy.name ILIKE $${params.length})`);
|
||||
where.push(`(dy.code ILIKE $${params.length} OR dy.label ILIKE $${params.length})`);
|
||||
}
|
||||
if (filter.dateFrom) {
|
||||
params.push(filter.dateFrom);
|
||||
@@ -351,7 +351,7 @@ export class SchedulingReadFacade {
|
||||
ts.train_number AS "trainNumber",
|
||||
oy.code AS "origin",
|
||||
dy.code AS "destination",
|
||||
dy.name AS "destinationName",
|
||||
dy.label AS "destinationName",
|
||||
oy.country AS "originCountry",
|
||||
dy.country AS "destinationCountry",
|
||||
ts.scheduled_departure_date AS "departureTime",
|
||||
|
||||
@@ -1261,7 +1261,7 @@ export class WarehouseInventoryService {
|
||||
oy.country AS "originCountry",
|
||||
dy.country AS "destinationCountry",
|
||||
dy.code AS "destinationCode",
|
||||
dy.name AS "destinationName"
|
||||
dy.label AS "destinationName"
|
||||
FROM freight.train_schedules ts
|
||||
LEFT JOIN freight.yards oy ON oy.id = ts.origin_station_id
|
||||
LEFT JOIN freight.yards dy ON dy.id = ts.destination_station_id
|
||||
@@ -1402,6 +1402,20 @@ export class WarehouseInventoryService {
|
||||
}
|
||||
|
||||
const currentStatus = item.inventoryStatus ?? item.bookingStatus;
|
||||
if (currentStatus === 'UNLOADED_AT_DJIBOUTI_PORT') {
|
||||
seenInventory.add(item.inventoryId);
|
||||
result.unloadedCount += 1;
|
||||
result.results.push({
|
||||
bookingId: item.bookingId,
|
||||
itemType: item.itemType,
|
||||
itemId: item.itemId,
|
||||
inventoryId: item.inventoryId,
|
||||
containerNumber: item.containerNumber,
|
||||
status: 'UNLOADED_AT_DJIBOUTI_PORT',
|
||||
message: 'Already unloaded at Djibouti Port',
|
||||
});
|
||||
continue;
|
||||
}
|
||||
if (!currentStatus || !this.EXPORT_DJIBOUTI_UNLOAD_ELIGIBLE_STATUSES.includes(currentStatus)) {
|
||||
skip(`Status ${currentStatus ?? 'UNKNOWN'} is not eligible for Djibouti export unloading`);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user