/** SeatReservation defines all information about a vehicle and the wagons it contains */ export interface SeatReservation { vehicleType: VehicleType; deckCoachIndex: number; deckCoachLevel: CoachDeckLevel; coachItems: CoachItem[]; } /** Describes a coach (wagon) in the reservation. */ export interface CoachItem { id: string; number: string; dimension: ElementDimension; type?: CoachType; places?: Place[]; graphicElements?: BaseElement[]; serviceElements?: BaseElement[]; travelClass: PlaceTravelClass[]; propertyIds?: string[]; } /** Describes a coach (wagon) details */ export interface CoachItemDetails { id: string; travelClass: PlaceTravelClass; propertyIds: string[]; freePlaces: CoachNumberOfFreePlaces; isDriverArea: boolean; isLocomotive?: boolean; driverAreaSide?: Record; } /** Extends BaseElement with seat-specific data. */ export interface Place extends BaseElement { number: string; state: PlaceState; type: PlaceType; travelClass?: PlaceTravelClass; propertyIds?: string[]; } /** Base properties for any renderable element within a coach. */ export interface BaseElement { icon?: string | null; rotation?: number; position: ElementPosition; dimension: ElementDimension; mounting?: ElementMounting | null; } export interface ElementDimension { w: number; h: number; } export interface ElementPosition { x: number; y: number; z: number; } /** Info about */ export interface CoachNumberOfFreePlaces { seats: number; bicycles: number; } /** Selection info for a single place. */ export interface PlaceSelection { id: string; number: string; deckIndex: number; coachIndex: number; state: PlaceState; placeType: PlaceType; } export interface SeatReservationPlaceSelection { id: string; coachId: string; coachNumber: string; coachIndex: number; deckIndex: number; placeNumber: string; placeType: PlaceType; placeTravelClass: PlaceTravelClass; propertyIds: string[]; } export interface SeatReservationSelectedCoach { coachId: string; coachNumber: string; coachIndex: number; coachType?: CoachType; coachTravelClass: PlaceTravelClass[]; coachPropertyIds?: string[]; coachNumberOfFreePlaces?: CoachNumberOfFreePlaces; } export interface SeatReservationSelectedPlaces { seats: SeatReservationPlaceSelection[]; bicycles: SeatReservationPlaceSelection[]; } export type PlaceType = 'SEAT' | 'BICYCLE'; export type CoachDeckLevel = 'SINGLE_DECK' | 'LOWER_DECK' | 'MIDDLE_DECK' | 'UPPER_DECK'; export type CoachType = 'RESTAURANT_COACH' | 'BICYCLE_COACH' | 'LUGGAGE_COACH' | 'TRAIN_HEAD' | 'LOCOMOTIVE_COACH'; export type PlaceState = 'FREE' | 'ALLOCATED' | 'RESTRICTED' | 'SELECTED'; export type PlaceTravelClass = 'FIRST' | 'SECOND' | 'ANY_CLASS'; export type VehicleType = 'TRAIN' | 'BUS'; export type TravelDirection = 'LEFT' | 'RIGHT' | 'NONE'; export type ElementMounting = 'free' | 'upper-border' | 'lower-border';