export type VehicleAPIResponse = IVehicleAPI[]; export type VehicleGroupAPIResponse = IVehicleGroup[]; export interface IVehicleAPI { id: number; name: string; type: string; cabinName?: string; restrictions?: IVehicleRestrictions; vehicleGroupsId: number; hidden: boolean; } export interface ICreateVehicleBody { name: string; type: string; cabinName?: string; restrictions?: IVehicleRestrictions; vehicleGroupsId: number; hidden: boolean; } export interface IVehicle { id: number; name: string; type: string; cabinName?: string; restrictions?: IVehicleRestrictions; group: IVehicleGroup; hidden: boolean; } export interface IVehicleRestrictions { sponsorOnly?: number; teamOnly?: boolean; } export interface IVehicleGroupMassSpeeds { none: number; passenger: Record | null; cargo: Record | null; } export interface IVehicleGroup { id: number; name: string; speed: number; speedLoaded: number | null; speedLoco: number | null; length: number; weight: number; cargoTypes: IVehicleCargoType[] | null; locoProps: IVehicleLocoProps | null; massSpeeds: IVehicleGroupMassSpeeds | null; _count: { vehicles: number }; } export interface IVehicleCargoType { id: string; weight: number; } export interface IVehicleLocoProps { coldStart: boolean; doubleManned: boolean; } export interface IVehicleTableRow { vehicleRef: IVehicle; // pendingChanges: Partial; } export interface IVehicleGroupTableRow { vehicleGroupRef: IVehicleGroup; // pendingChanges: Partial; } export enum VehicleEditRowKey { NAME = 'name', TYPE = 'type', CABIN = 'cabinName', HIDDEN = 'hidden', } export enum VehicleEditRestrictionKey { SPONSOR_ONLY = 'sponsorOnly', TEAM_ONLY = 'teamOnly', }