mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 09:00:57 +00:00
87 lines
2.6 KiB
TypeScript
87 lines
2.6 KiB
TypeScript
import { BaseEntity } from '@edr/api-common';
|
|
import { Column, Entity } from 'typeorm';
|
|
|
|
@Entity({ schema: 'freight', name: 'train_scheduling_global_rules' })
|
|
export class TrainSchedulingGlobalRules extends BaseEntity {
|
|
@Column({
|
|
name: 'max_train_length_meters',
|
|
type: 'numeric',
|
|
precision: 10,
|
|
scale: 2,
|
|
default: 760,
|
|
})
|
|
maxTrainLengthMeters!: number;
|
|
|
|
@Column({
|
|
name: 'max_train_weight_tons',
|
|
type: 'numeric',
|
|
precision: 10,
|
|
scale: 3,
|
|
default: 3500,
|
|
})
|
|
maxTrainWeightTons!: number;
|
|
|
|
@Column({ name: 'max_wagons_per_train', type: 'int', default: 53 })
|
|
maxWagonsPerTrain!: number;
|
|
|
|
@Column({
|
|
name: 'max_20ft_container_weight_tons',
|
|
type: 'numeric',
|
|
precision: 8,
|
|
scale: 3,
|
|
default: 30,
|
|
})
|
|
max20ftContainerWeightTons!: number;
|
|
|
|
@Column({
|
|
name: 'max_20ft_pair_weight_diff_tons',
|
|
type: 'numeric',
|
|
precision: 8,
|
|
scale: 3,
|
|
default: 10,
|
|
})
|
|
max20ftPairWeightDiffTons!: number;
|
|
|
|
/** Days before departure the single import booking-window day falls on. */
|
|
@Column({ name: 'import_window_lead_days', type: 'int', default: 3 })
|
|
importWindowLeadDays!: number;
|
|
|
|
/** Hours before departure an export booking becomes acceptable (FCFS, no window cycle). */
|
|
@Column({ name: 'export_booking_lead_hours', type: 'int', default: 24 })
|
|
exportBookingLeadHours!: number;
|
|
|
|
/** Local (Africa/Addis_Ababa) hour at which the import window opens on its window day. */
|
|
@Column({ name: 'window_open_hour', type: 'int', default: 8 })
|
|
windowOpenHour!: number;
|
|
|
|
/**
|
|
* Local (Africa/Addis_Ababa) hour the booking desk shuts each day. A not-yet-full
|
|
* train whose next cycle would reopen at/after this hour pauses until the next
|
|
* morning's windowOpenHour. Set equal to windowOpenHour for a 24-hour desk.
|
|
*/
|
|
@Column({ name: 'window_close_hour', type: 'int', default: 17 })
|
|
windowCloseHour!: number;
|
|
|
|
// Stored in hours; 4 decimals so sub-minute UI durations (4 min = 0.0667h)
|
|
// are exact. See WidenWindowDurationHoursPrecision migration.
|
|
@Column({
|
|
name: 'window_duration_hours',
|
|
type: 'numeric',
|
|
precision: 6,
|
|
scale: 4,
|
|
default: 3,
|
|
})
|
|
windowDurationHours!: number;
|
|
|
|
/** Max time staff have to accept booking documents after the window closes. */
|
|
@Column({ name: 'doc_review_minutes', type: 'int', default: 30 })
|
|
docReviewMinutes!: number;
|
|
|
|
@Column({ name: 'payment_window_minutes', type: 'int', default: 60 })
|
|
paymentWindowMinutes!: number;
|
|
|
|
/** Delay after window close before the window reopens when the train is not yet full. */
|
|
@Column({ name: 'reopen_delay_minutes', type: 'int', default: 90 })
|
|
reopenDelayMinutes!: number;
|
|
}
|