Files
aeroresolve_frontend/src/app/simulation/simulationConfig.ts
T

558 lines
20 KiB
TypeScript

import type { Option } from '../../components/custom/CustomDropdown';
import type { TabItem } from '../../components/custom/CustomTabs';
import type { SimulatedPassengerInput } from './SimulationTypes';
export interface FormFieldConfig {
id: string;
label: string;
type: 'text' | 'number' | 'select' | 'switch';
options?: Option[];
placeholder?: string;
defaultValue: any;
gridSpan?: 1 | 2; // 1 = half width (grid-cols-2), 2 = full width (grid-cols-1)
}
export interface ManifestColumnConfig {
key: string;
label: string;
}
export interface CategorySimulationConfig {
id: 'Flight' | 'Travel' | 'Ancillary';
label: string;
description: string;
scenarios: Option[];
scenarioSubTypes: Record<string, Option[]>;
fields: FormFieldConfig[];
passengerPool: SimulatedPassengerInput[];
manifestColumns: ManifestColumnConfig[];
defaultFormState: {
scenario: string;
scenarioSubType: string;
[key: string]: any;
};
}
export const CATEGORY_TABS: TabItem[] = [
{ id: 'Flight', label: 'FLIGHT', content: null },
{ id: 'Travel', label: 'TRAVEL', content: null },
{ id: 'Ancillary', label: 'ANCILLARY', content: null },
];
export const CATEGORY_SIMULATION_CONFIGS: Record<
'Flight' | 'Travel' | 'Ancillary',
CategorySimulationConfig
> = {
Flight: {
id: 'Flight',
label: 'Flight Operations Disruption',
description: 'Simulate flight delays, cancellations, denied boarding, and missed connections.',
scenarios: [
{ label: 'Flight Delay Disruption', value: 'Flight Delay Disruption' },
{ label: 'Flight Cancellation', value: 'Flight Cancellation' },
{ label: 'Denied Boarding / Involuntary Bumping', value: 'Denied Boarding' },
{ label: 'Missed Connection Delay', value: 'Missed Connection' },
],
scenarioSubTypes: {
'Flight Delay Disruption': [
{ label: 'Short Delay (< 2 Hours)', value: 'Short Delay' },
{ label: 'Long Delay (3-4 Hours)', value: 'Long Delay' },
{ label: 'Extreme Delay (> 4 Hours)', value: 'Extreme Delay' },
{ label: 'Overnight Delay', value: 'Overnight Delay' },
],
'Flight Cancellation': [
{ label: 'Same-Day Cancellation', value: 'Same-Day Cancellation' },
{ label: 'Short Notice Cancellation (< 14 Days)', value: 'Short Notice Cancellation' },
{ label: 'Advance Cancellation (> 14 Days)', value: 'Advance Cancellation' },
{ label: 'Weather Extraordinary Cancellation', value: 'Weather Cancellation' },
],
'Denied Boarding': [
{ label: 'Involuntary Denied Boarding', value: 'Involuntary Denied Boarding' },
{ label: 'Voluntary Denied Boarding', value: 'Voluntary Denied Boarding' },
{ label: 'Involuntary Cabin Downgrade', value: 'Cabin Downgrade' },
{ label: 'Oversale Flight Capacity', value: 'Oversale' },
],
'Missed Connection': [
{ label: 'Short Connection Miss (< 2 Hours)', value: 'Short Connection Miss' },
{ label: 'Long Connection Miss (> 3 Hours)', value: 'Long Connection Miss' },
{ label: 'Overnight Misconnection', value: 'Overnight Misconnection' },
{ label: 'Final Leg Connection Miss', value: 'Final Connection Miss' },
],
},
fields: [
{
id: 'flightNumber',
label: 'Flight No',
type: 'text',
placeholder: 'LH450',
defaultValue: '',
gridSpan: 1,
},
{
id: 'airline',
label: 'Airline',
type: 'text',
placeholder: 'Lufthansa',
defaultValue: '',
gridSpan: 1,
},
{
id: 'origin',
label: 'Origin',
type: 'text',
placeholder: 'FRA',
defaultValue: '',
gridSpan: 1,
},
{
id: 'destination',
label: 'Dest',
type: 'text',
placeholder: 'JFK',
defaultValue: '',
gridSpan: 1,
},
{
id: 'flightDistance',
label: 'Flight Distance (KM)',
type: 'select',
options: [
{ label: '1500', value: '1500' },
{ label: '3500', value: '3500' },
{ label: '6200', value: '6200' },
{ label: '8500', value: '8500' },
{ label: '11200', value: '11200' },
],
defaultValue: '',
gridSpan: 2,
},
{
id: 'arrDelay',
label: 'Arr Delay (Mins)',
type: 'number',
placeholder: '240',
defaultValue: '',
gridSpan: 1,
},
{
id: 'depDelay',
label: 'Dep Delay (Mins)',
type: 'number',
placeholder: '180',
defaultValue: '',
gridSpan: 1,
},
],
defaultFormState: {
scenario: '',
scenarioSubType: '',
flightNumber: '',
airline: '',
origin: '',
destination: '',
flightDistance: '',
arrDelay: '',
depDelay: '',
},
passengerPool: [
{
id: 'p-1',
name: 'Alexander Wright',
pnr: 'PNR-A1',
tier: 'Platinum',
cabinClass: 'First Class',
originalCabin: 'First Class',
actualCabin: 'First Class',
passengerType: 'VIP Adult',
nationality: 'British',
},
{
id: 'p-2',
name: 'Sarah Jenkins',
pnr: 'PNR-A2',
tier: 'Platinum',
cabinClass: 'First Class',
originalCabin: 'First Class',
actualCabin: 'First Class',
passengerType: 'High Value Adult',
nationality: 'British',
},
{
id: 'p-3',
name: 'The Miller Family',
pnr: 'PNR-B3',
tier: 'Gold',
cabinClass: 'Business Class',
originalCabin: 'Business Class',
actualCabin: 'Business Class',
passengerType: 'Family Group',
nationality: 'German',
},
{
id: 'p-4',
name: 'Marcus Chen',
pnr: 'PNR-C4',
tier: 'Silver',
cabinClass: 'Business Class',
originalCabin: 'Business Class',
actualCabin: 'Business Class',
passengerType: 'Adult',
nationality: 'American',
},
],
manifestColumns: [
{ key: 'name', label: 'Passenger' },
{ key: 'tier', label: 'Tier & Type' },
{ key: 'cabin', label: 'Cabin Class' },
{ key: 'pnr', label: 'PNR' },
{ key: 'comp', label: 'Compensation' },
{ key: 'refund', label: 'Refund' },
],
},
Travel: {
id: 'Travel',
label: 'Travel & Accommodation Disruption',
description: 'Simulate hotel overbookings, missed ground transfers, and package itinerary disruptions.',
scenarios: [
{ label: 'Hotel Overbooking / Relocation', value: 'Hotel Overbooking' },
{ label: 'Missed Ground Transit / Transfer', value: 'Missed Ground Transit' },
{ label: 'Package Itinerary Interruption', value: 'Itinerary Interruption' },
{ label: 'VIP Accommodation Downgrade', value: 'Accommodation Downgrade' },
],
scenarioSubTypes: {
'Hotel Overbooking': [
{ label: 'Relocation to Lower Star Hotel', value: 'Relocation to Lower Star' },
{ label: 'Relocation Outside Airport Zone', value: 'Relocation Outside Airport Zone' },
{ label: 'Same Star Rating Relocation', value: 'Same Star Relocation' },
{ label: 'Unscheduled Hotel Night Incurred', value: 'Unscheduled Hotel Night' },
],
'Missed Ground Transit': [
{ label: 'Ground Transfer Delay (> 4 Hours)', value: 'Ground Transfer Delay' },
{ label: 'Chauffeur Transit Breakdown', value: 'Chauffeur Transit Breakdown' },
{ label: 'Shuttle Service Cancellation', value: 'Shuttle Service Cancellation' },
{ label: 'Missed Connecting Rail/Bus Transit', value: 'Missed Rail/Bus Transit' },
],
'Itinerary Interruption': [
{ label: 'Package Tour Cancellation', value: 'Package Tour Cancellation' },
{ label: 'Excursion Schedule Disruption', value: 'Excursion Disruption' },
{ label: 'Prepaid Activity Ticket Loss', value: 'Activity Ticket Loss' },
{ label: 'Cruiseline Departure Missed', value: 'Cruiseline Missed Departure' },
],
'Accommodation Downgrade': [
{ label: 'Room Category Downgrade', value: 'Room Category Downgrade' },
{ label: 'Promised Amenities Non-Availability', value: 'Amenities Non-Availability' },
{ label: 'Shared Facility Relocation', value: 'Shared Facility Downgrade' },
{ label: 'Executive Lounge Access Loss', value: 'Executive Lounge Loss' },
],
},
fields: [
{
id: 'bookingRef',
label: 'Booking Ref',
type: 'text',
placeholder: 'TRV-8829',
defaultValue: '',
gridSpan: 1,
},
{
id: 'travelProvider',
label: 'Provider / Partner',
type: 'text',
placeholder: 'Marriott Bonvoy',
defaultValue: '',
gridSpan: 1,
},
{
id: 'location',
label: 'Location / City',
type: 'text',
placeholder: 'Frankfurt Airport City',
defaultValue: '',
gridSpan: 1,
},
{
id: 'accommodationClass',
label: 'Accommodation Rating',
type: 'select',
options: [
{ label: '5-Star Luxury', value: '5-Star Luxury' },
{ label: '4-Star Executive', value: '4-Star Executive' },
{ label: '3-Star Standard', value: '3-Star Standard' },
{ label: 'Transit Lodge', value: 'Transit Lodge' },
],
defaultValue: '',
gridSpan: 1,
},
{
id: 'expenseIncurred',
label: 'Expense Incurred ($)',
type: 'number',
placeholder: '350',
defaultValue: '',
gridSpan: 1,
},
{
id: 'disruptionDuration',
label: 'Duration (Nights/Hrs)',
type: 'text',
placeholder: '1 Night',
defaultValue: '',
gridSpan: 1,
},
],
defaultFormState: {
scenario: '',
scenarioSubType: '',
bookingRef: '',
travelProvider: '',
location: '',
accommodationClass: '',
expenseIncurred: '',
disruptionDuration: '',
},
passengerPool: [
{
id: 'p-1',
name: 'Alexander Wright',
pnr: 'TRV-PNR1',
tier: 'Platinum',
passengerType: 'VIP Traveler',
nationality: 'British',
bookingRef: 'TRV-8829',
},
{
id: 'p-2',
name: 'Sarah Jenkins',
pnr: 'TRV-PNR2',
tier: 'Platinum',
passengerType: 'Corporate Traveler',
nationality: 'British',
bookingRef: 'TRV-8830',
},
{
id: 'p-3',
name: 'The Miller Family',
pnr: 'TRV-PNR3',
tier: 'Gold',
passengerType: 'Family Group',
nationality: 'German',
bookingRef: 'TRV-8831',
},
{
id: 'p-4',
name: 'Marcus Chen',
pnr: 'TRV-PNR4',
tier: 'Silver',
passengerType: 'Solo Traveler',
nationality: 'American',
bookingRef: 'TRV-8832',
},
],
manifestColumns: [
{ key: 'name', label: 'Traveler' },
{ key: 'tier', label: 'Tier & Type' },
{ key: 'bookingRef', label: 'Booking Ref' },
{ key: 'comp', label: 'Compensation' },
{ key: 'refund', label: 'Refund' },
],
},
Ancillary: {
id: 'Ancillary',
label: 'Ancillary Services & Perks Disruption',
description: 'Simulate ancillary failures, non-delivery, seat defects, lounge denials, and baggage issues.',
scenarios: [
{ label: 'Preferred Seat', value: 'Preferred Seat' },
{ label: 'Wi-Fi', value: 'Wi-Fi' },
{ label: 'Lounge Access', value: 'Lounge Access' },
{ label: 'Priority Boarding', value: 'Priority Boarding' },
{ label: 'Fast Track Security', value: 'Fast Track Security' },
{ label: 'Special Meal', value: 'Special Meal' },
{ label: 'Paid Meal', value: 'Paid Meal' },
{ label: 'Extra Baggage', value: 'Extra Baggage' },
{ label: 'Sports Equipment', value: 'Sports Equipment' },
{ label: 'Musical Instrument', value: 'Musical Instrument' },
{ label: 'Upgrade Purchase', value: 'Upgrade Purchase' },
{ label: 'In-flight Entertainment', value: 'In-flight Entertainment' },
{ label: 'Airport Transfer', value: 'Airport Transfer' },
{ label: 'Chauffeur Service', value: 'Chauffeur Service' },
{ label: 'Power Outlet', value: 'Power Outlet' },
{ label: 'Extra Legroom', value: 'Extra Legroom' },
{ label: 'Carbon Offset', value: 'Carbon Offset' },
],
scenarioSubTypes: {
'Wi-Fi': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Fee Paid Service Non-delivery', value: 'Fee Paid Service Non-delivery' },
{ label: 'System Outage / Inoperative', value: 'System Outage' },
{ label: 'Slow Speed / Unusable', value: 'Slow Speed' },
{ label: 'Partial Flight Unavailable', value: 'Partial Flight Unavailable' },
],
'Preferred Seat': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Seat Hardware Defect', value: 'Seat Hardware Defect' },
{ label: 'Involuntary Seat Reassignment', value: 'Involuntary Seat Reassignment' },
{ label: 'Non-Reclining Exit Row Seat', value: 'Non-Reclining Exit Row Seat' },
{ label: 'Extra Legroom Feature Defect', value: 'Extra Legroom Feature Defect' },
],
'Lounge Access': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Overcapacity Entry Refusal', value: 'Overcapacity Entry Refusal' },
{ label: 'Operating Hours Premature Closure', value: 'Operating Hours Premature Closure' },
{ label: 'Partner Airline Lounge Access Denial', value: 'Partner Lounge Denial' },
{ label: 'Pass Registration System Error', value: 'Pass Registration System Error' },
],
'Priority Boarding': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Gate Priority Not Honored', value: 'Gate Priority Not Honored' },
{ label: 'Boarding Zone Error', value: 'Boarding Zone Error' },
{ label: 'Late Jet Bridge Call', value: 'Late Jet Bridge Call' },
],
'Fast Track Security': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Fast Track Lane Closed', value: 'Fast Track Lane Closed' },
{ label: 'Security Voucher Rejected', value: 'Security Voucher Rejected' },
{ label: 'Terminal Access Error', value: 'Terminal Access Error' },
],
'Special Meal': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Meal Not Loaded', value: 'Meal Not Loaded' },
{ label: 'Incorrect Dietary Meal', value: 'Incorrect Dietary Meal' },
{ label: 'Contaminated / Spoiled', value: 'Contaminated Meal' },
],
'Paid Meal': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Paid Meal Out of Stock', value: 'Paid Meal Out of Stock' },
{ label: 'Incorrect Meal Delivered', value: 'Incorrect Meal Delivered' },
{ label: 'Quality Substandard', value: 'Quality Substandard' },
],
'Extra Baggage': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Baggage Left Behind', value: 'Baggage Left Behind' },
{ label: 'Overcharge Dispute', value: 'Overcharge Dispute' },
{ label: 'Priority Baggage Delayed', value: 'Priority Baggage Delayed' },
],
'Sports Equipment': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Equipment Refused at Check-in', value: 'Equipment Refused at Check-in' },
{ label: 'Equipment Damaged', value: 'Equipment Damaged' },
{ label: 'Delayed Delivery', value: 'Delayed Delivery' },
],
'Musical Instrument': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Cabin Stowage Refused', value: 'Cabin Stowage Refused' },
{ label: 'Involuntary Gate Check', value: 'Involuntary Gate Check' },
{ label: 'Transit Damage', value: 'Transit Damage' },
],
'Upgrade Purchase': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Involuntary Cabin Downgrade', value: 'Involuntary Cabin Downgrade' },
{ label: 'Seat Feature Inoperative', value: 'Seat Feature Inoperative' },
{ label: 'Overbooked Premium Cabin', value: 'Overbooked Premium Cabin' },
],
'In-flight Entertainment': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'In-Flight Screen Hardware Fault', value: 'Screen Hardware Fault' },
{ label: 'Audio / Headset Jack Fault', value: 'Audio Headset Fault' },
{ label: 'Content Library Inaccessible', value: 'Content Library Inaccessible' },
],
'Airport Transfer': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Driver No-Show', value: 'Driver No-Show' },
{ label: 'Transfer Vehicle Delay (> 2 Hours)', value: 'Transfer Vehicle Delay' },
{ label: 'Vehicle Class Downgrade', value: 'Vehicle Class Downgrade' },
],
'Chauffeur Service': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Chauffeur Missed Pickup', value: 'Chauffeur Missed Pickup' },
{ label: 'Vehicle Breakdown', value: 'Vehicle Breakdown' },
{ label: 'Unscheduled Cancellation', value: 'Unscheduled Cancellation' },
],
'Power Outlet': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'In-Seat Power Outage', value: 'Power Outage' },
{ label: 'Low Voltage / Non-Functional', value: 'Low Voltage' },
{ label: 'Physical Port Broken', value: 'Physical Port Broken' },
],
'Extra Legroom': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Involuntary Seat Reassignment', value: 'Involuntary Seat Reassignment' },
{ label: 'Obstructed Legroom', value: 'Obstructed Legroom' },
{ label: 'Aircraft Swap Downgrade', value: 'Aircraft Swap Downgrade' },
],
'Carbon Offset': [
{ label: 'Purchased but Unavailable', value: 'Purchased but Unavailable' },
{ label: 'Offset Certificate Failed', value: 'Offset Certificate Failed' },
{ label: 'Billing Mismatch', value: 'Billing Mismatch' },
],
},
fields: [
{
id: 'serviceCost',
label: 'SERVICE COST',
type: 'number',
placeholder: '25',
defaultValue: '',
gridSpan: 2,
},
{
id: 'delivered',
label: 'DELIVERED',
type: 'switch',
defaultValue: false,
gridSpan: 2,
},
],
defaultFormState: {
scenario: '',
scenarioSubType: '',
serviceCost: '',
delivered: false,
},
passengerPool: [
{
id: 'p-1',
name: 'Alexander Wright',
pnr: 'ANC-PNR1',
tier: 'Platinum',
passengerType: 'VIP Guest',
nationality: 'British',
ancillaryItem: 'Wi-Fi',
},
{
id: 'p-2',
name: 'Sarah Jenkins',
pnr: 'ANC-PNR2',
tier: 'Platinum',
passengerType: 'Frequent Flyer',
nationality: 'British',
ancillaryItem: 'Wi-Fi',
},
{
id: 'p-3',
name: 'The Miller Family',
pnr: 'ANC-PNR3',
tier: 'Gold',
passengerType: 'Family Group',
nationality: 'German',
ancillaryItem: 'Wi-Fi',
},
{
id: 'p-4',
name: 'Marcus Chen',
pnr: 'ANC-PNR4',
tier: 'Silver',
passengerType: 'Solo Traveler',
nationality: 'American',
ancillaryItem: 'Wi-Fi',
},
],
manifestColumns: [
{ key: 'name', label: 'Passenger' },
{ key: 'tier', label: 'Tier & Type' },
{ key: 'ancillaryItem', label: 'Service / Item' },
{ key: 'comp', label: 'Compensation' },
{ key: 'refund', label: 'Refund' },
],
},
};