interchange document generation and acknowledgement

This commit is contained in:
hagiye
2026-06-27 13:39:42 +03:00
parent d726927453
commit 3decc9aeea
11 changed files with 520 additions and 108 deletions

View File

@@ -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",

View File

@@ -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;