mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-08 18:18:18 +00:00
chages
This commit is contained in:
@@ -310,7 +310,10 @@ export class BookingBatchService implements OnModuleInit {
|
|||||||
private async openRouteDayGroups(): Promise<RouteDayGroup[]> {
|
private async openRouteDayGroups(): Promise<RouteDayGroup[]> {
|
||||||
const open = (
|
const open = (
|
||||||
await this.trainSchedulesRepository.findAll({
|
await this.trainSchedulesRepository.findAll({
|
||||||
where: { bookingWindowStatus: "OPEN" },
|
where: [
|
||||||
|
{ bookingWindowStatus: "OPEN", status: TrainScheduleStatusEnum.Draft },
|
||||||
|
{ bookingWindowStatus: "OPEN", status: TrainScheduleStatusEnum.Scheduled },
|
||||||
|
],
|
||||||
})
|
})
|
||||||
).filter((s) => s.windowPhase == null);
|
).filter((s) => s.windowPhase == null);
|
||||||
const groups = new Map<string, RouteDayGroup>();
|
const groups = new Map<string, RouteDayGroup>();
|
||||||
|
|||||||
@@ -2049,7 +2049,9 @@ export class TrainSchedulingService {
|
|||||||
await this.trainSchedulesRepository.updateStatus(
|
await this.trainSchedulesRepository.updateStatus(
|
||||||
id,
|
id,
|
||||||
TrainScheduleStatusEnum.Cancelled,
|
TrainScheduleStatusEnum.Cancelled,
|
||||||
{},
|
// Retire the booking window so a canceled schedule never lingers as an
|
||||||
|
// "open window" in booking-window lists or the legacy batch fill.
|
||||||
|
{ bookingWindowStatus: 'CLOSED', windowPhase: 'DONE' },
|
||||||
manager,
|
manager,
|
||||||
);
|
);
|
||||||
if (schedule.trainSetId) {
|
if (schedule.trainSetId) {
|
||||||
|
|||||||
@@ -235,6 +235,8 @@ export function GlUpcomingWindowsSection() {
|
|||||||
const rows = (data ?? []).filter(
|
const rows = (data ?? []).filter(
|
||||||
(w) => w.windowPhase != null && w.windowPhase !== "DONE" && !isPast(w),
|
(w) => w.windowPhase != null && w.windowPhase !== "DONE" && !isPast(w),
|
||||||
);
|
);
|
||||||
|
// Canceled schedules are retired to windowPhase='DONE' server-side, so the
|
||||||
|
// guard above already excludes them; they never reach the upcoming list.
|
||||||
// Open lanes first, then by opening time.
|
// Open lanes first, then by opening time.
|
||||||
return rows.sort((a, b) => {
|
return rows.sort((a, b) => {
|
||||||
const openDiff = Number(b.isOpenNow) - Number(a.isOpenNow);
|
const openDiff = Number(b.isOpenNow) - Number(a.isOpenNow);
|
||||||
|
|||||||
Reference in New Issue
Block a user