This commit is contained in:
Marshal
2026-07-07 12:28:47 +00:00
parent 1c18fdbd52
commit f300600bfa
63 changed files with 2587 additions and 428 deletions

View File

@@ -55,6 +55,17 @@ export class TrainSetWagon extends BaseEntity {
@Column({ name: 'status', type: 'varchar', length: 20, default: 'PLANNED' })
status!: string;
// ── Leg occupancy (segment corridor bookings) ──────────────────────────────
// A slot may occupy only part of the route: it boards (attaches/loads) at
// board_yard_id and alights (unloads/detaches) at alight_yard_id. NULL on both
// means the slot rides the whole route (legacy full-route bookings). Slots
// whose legs don't overlap coexist without consuming each other's capacity.
@Column({ name: 'board_yard_id', type: 'uuid', nullable: true })
boardYardId?: string | null;
@Column({ name: 'alight_yard_id', type: 'uuid', nullable: true })
alightYardId?: string | null;
@OneToMany(() => WagonBookingAllocation, (allocation) => allocation.trainSetWagon)
allocations?: WagonBookingAllocation[];
}