mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Reproduces the monthly count sheet a port warehouse publishes: trains, containers by size and laden state, wagons, TEU and bulk wagons per cargo type, each split into export and import beside an overall total. Two departures from the spreadsheet it replaces: - Wagons are counted distinctly from the marshalling record rather than derived as 20ft/2 + 40ft + bulk wagons, which overstates whenever a wagon ran part-loaded. - Total is counted over everything rather than summed across the direction columns — a train carrying both an import and an export booking belongs to both and would otherwise count twice. Demurrage is billed on invoice lines and is left to Revenue by Category. Adds a station filter matching either end of the corridor, so one warehouse can report the trains it worked in both directions.
89 lines
4.4 KiB
TypeScript
89 lines
4.4 KiB
TypeScript
import { ReportKey } from "../../seed/freight-permissions.registry";
|
|
import { revenueByCustomerReport } from "./definitions/revenue-by-customer.report";
|
|
import { agingReceivablesReport } from "./definitions/aging-receivables.report";
|
|
import { contractUtilizationReport } from "./definitions/contract-utilization.report";
|
|
import { wagonFleetStatusReport } from "./definitions/wagon-fleet-status.report";
|
|
import { wagonStatusDurationReport } from "./definitions/wagon-status-duration.report";
|
|
import { wagonRequestsReport } from "./definitions/wagon-requests.report";
|
|
import { locomotiveFleetStatusReport } from "./definitions/locomotive-fleet-status.report";
|
|
import { bookingStatusBreakdownReport } from "./definitions/booking-status-breakdown.report";
|
|
import { trainScheduleStatusReport } from "./definitions/train-schedule-status.report";
|
|
import { trainTurnaroundReport } from "./definitions/train-turnaround.report";
|
|
import { wagonTeuUtilizationReport } from "./definitions/wagon-teu-utilization.report";
|
|
import { loadedCapacityReport } from "./definitions/loaded-capacity.report";
|
|
import { globalLogisticsWagonsReport } from "./definitions/global-logistics-wagons.report";
|
|
import { customsDocumentsReport } from "./definitions/customs-documents.report";
|
|
import { invoicingPipelineReport } from "./definitions/invoicing-pipeline.report";
|
|
import { firstLastMileBookingsReport } from "./definitions/first-last-mile-bookings.report";
|
|
import { cargoSummaryReport } from "./definitions/cargo-summary.report";
|
|
import { revenueByCategoryReport } from "./definitions/revenue-by-category.report";
|
|
import { revenueTransactionsReport } from "./definitions/revenue-transactions.report";
|
|
import { revenueByPeriodReport } from "./definitions/revenue-by-period.report";
|
|
import { revenueByRouteReport } from "./definitions/revenue-by-route.report";
|
|
import { revenueTopCustomersReport } from "./definitions/revenue-top-customers.report";
|
|
import { paymentClassificationReport } from "./definitions/payment-classification.report";
|
|
import { revenueReconciliationReport } from "./definitions/revenue-reconciliation.report";
|
|
import { receivablesPayablesReport } from "./definitions/receivables-payables.report";
|
|
import { revenueAnomaliesReport } from "./definitions/revenue-anomalies.report";
|
|
import { stationStayingTimeReport } from "./definitions/station-staying-time.report";
|
|
import { turnaroundCycleReport } from "./definitions/turnaround-cycle.report";
|
|
import { trainDelaysReport } from "./definitions/train-delays.report";
|
|
import { trainsetPerformanceReport } from "./definitions/trainset-performance.report";
|
|
import { teuPerformanceReport } from "./definitions/teu-performance.report";
|
|
import { cargoVolumePerformanceReport } from "./definitions/cargo-volume-performance.report";
|
|
import { chargedVsActualVolumeReport } from "./definitions/charged-vs-actual-volume.report";
|
|
import { cargoVolumeByStationReport } from "./definitions/cargo-volume-by-station.report";
|
|
import { portWarehouseSummaryReport } from "./definitions/port-warehouse-summary.report";
|
|
import { ReportDefinition } from "./report.types";
|
|
|
|
/**
|
|
* Every report the platform knows about. Adding one = a new file under
|
|
* definitions/ + a key in REPORT_KEYS (freight-permissions.registry.ts) +
|
|
* an entry here. Nothing else — no frontend edit, no route, no sidebar edit.
|
|
*/
|
|
export const REPORTS: ReportDefinition[] = [
|
|
revenueByCustomerReport,
|
|
agingReceivablesReport,
|
|
contractUtilizationReport,
|
|
wagonFleetStatusReport,
|
|
wagonStatusDurationReport,
|
|
wagonRequestsReport,
|
|
locomotiveFleetStatusReport,
|
|
bookingStatusBreakdownReport,
|
|
trainScheduleStatusReport,
|
|
trainTurnaroundReport,
|
|
wagonTeuUtilizationReport,
|
|
loadedCapacityReport,
|
|
globalLogisticsWagonsReport,
|
|
customsDocumentsReport,
|
|
invoicingPipelineReport,
|
|
firstLastMileBookingsReport,
|
|
cargoSummaryReport,
|
|
revenueByCategoryReport,
|
|
revenueTransactionsReport,
|
|
revenueByPeriodReport,
|
|
revenueByRouteReport,
|
|
revenueTopCustomersReport,
|
|
paymentClassificationReport,
|
|
revenueReconciliationReport,
|
|
receivablesPayablesReport,
|
|
revenueAnomaliesReport,
|
|
stationStayingTimeReport,
|
|
turnaroundCycleReport,
|
|
trainDelaysReport,
|
|
trainsetPerformanceReport,
|
|
teuPerformanceReport,
|
|
cargoVolumePerformanceReport,
|
|
chargedVsActualVolumeReport,
|
|
cargoVolumeByStationReport,
|
|
portWarehouseSummaryReport,
|
|
];
|
|
|
|
const BY_KEY = new Map<ReportKey, ReportDefinition>(
|
|
REPORTS.map((r) => [r.key, r]),
|
|
);
|
|
|
|
export function getReport(key: string): ReportDefinition | undefined {
|
|
return BY_KEY.get(key as ReportKey);
|
|
}
|