add lashing surcharge for cargo types with hasLashing flag

add lashing surcharge for cargo types with hasLashing flag
This commit is contained in:
Marshal
2026-07-17 23:25:53 +00:00
parent 6467173c76
commit 3a1a08b1e1
59 changed files with 1919 additions and 140 deletions

View File

@@ -73,6 +73,16 @@ export class TrainSchedule extends BaseEntity {
@Column({ name: 'direction', type: 'varchar', length: 10, nullable: true })
direction?: string | null;
/**
* Reverse the wagon ORDER on this train: when true, the built wagon plan is
* flipped at build so the physically-last wagon sits at position 1. Only the
* order (sequenceNo) changes — composition and allocations travel with their
* slot. Frozen at create; every (re)assignment rebuilds under this flag so the
* stored train order and the schedule order always match. Default false.
*/
@Column({ name: 'reverse_wagon_order', type: 'boolean', default: false })
reverseWagonOrder!: boolean;
@Column({ name: 'actual_departure_at', type: 'timestamptz', nullable: true })
actualDepartureAt?: Date | null;
@@ -149,6 +159,14 @@ export class TrainSchedule extends BaseEntity {
@Column({ name: 'rule_export_booking_lead_hours', type: 'int', nullable: true })
ruleExportBookingLeadHours?: number | null;
/** Frozen import booking-close offset (minutes before departure). NULL = none. */
@Column({ name: 'rule_import_close_offset_minutes', type: 'int', nullable: true })
ruleImportCloseOffsetMinutes?: number | null;
/** Frozen export booking-close offset (minutes before departure). NULL = none. */
@Column({ name: 'rule_export_close_offset_minutes', type: 'int', nullable: true })
ruleExportCloseOffsetMinutes?: number | null;
// Frozen wagon plan captured once when the schedule leaves the editable
// DRAFT/SCHEDULED phase (dispatch / arrive / cancel). Admin views of a
// non-editable schedule read THIS instead of the live wagon↔slot joins, so the