mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Adding exact reason why train is not available to users search results
This commit is contained in:
@@ -34,6 +34,34 @@ export enum ScheduleStatus {
|
||||
Delayed = "DELAYED",
|
||||
}
|
||||
|
||||
/**
|
||||
* Why a /search leg (outbound or inbound) came back with zero bookable schedules.
|
||||
* Priority order applied by the API when classifying: NoRoute > NoScheduleOnDate >
|
||||
* Cancelled > PackageOnly > CheckinClosed > FullyBooked (see search.service.ts
|
||||
* classifyEmptySearch). The frontend uses this to show a specific empty-state
|
||||
* message instead of a generic "no trains available".
|
||||
*/
|
||||
export enum SearchEmptyReasonCode {
|
||||
/** No route (in either direction) ever connects these two stations. */
|
||||
NoRoute = "NO_ROUTE",
|
||||
/** A route connects these stations, but no schedule lands on the requested date at all. */
|
||||
NoScheduleOnDate = "NO_SCHEDULE_ON_DATE",
|
||||
/** Every schedule for this pair on this date was cancelled. */
|
||||
Cancelled = "CANCELLED",
|
||||
/** Every schedule for this pair on this date is package-only (excluded from ticket search). */
|
||||
PackageOnly = "PACKAGE_ONLY",
|
||||
/** A bookable schedule exists, but its check-in cutoff has already passed for every option. */
|
||||
CheckinClosed = "CHECKIN_CLOSED",
|
||||
/** A bookable, still-open schedule exists but has no seats left for the requested party. */
|
||||
FullyBooked = "FULLY_BOOKED",
|
||||
}
|
||||
|
||||
export interface ISearchEmptyReason {
|
||||
code: SearchEmptyReasonCode;
|
||||
originStationName: string;
|
||||
destinationStationName: string;
|
||||
}
|
||||
|
||||
export enum PaymentStatus {
|
||||
Pending = "PENDING",
|
||||
Paid = "PAID",
|
||||
|
||||
Reference in New Issue
Block a user