@schandlergarcia/sf-web-components 2.3.16 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +27 -0
- package/CLAUDE.md +12 -13
- package/README.md +0 -15
- package/dist/styles/global.css +46 -48
- package/package.json +1 -2
- package/scripts/apply-brand.mjs +47 -30
- package/scripts/postinstall.mjs +1 -11
- package/src/styles/global.css +46 -48
- package/brands/engine/PARTNER_HUB_PRD.md +0 -584
- package/brands/engine/agentApiConfig.ts +0 -36
- package/brands/engine/app/api/graphql-operations-types.ts +0 -11260
- package/brands/engine/app/api/graphqlClient.ts +0 -25
- package/brands/engine/app/api/partnerQueries.ts +0 -212
- package/brands/engine/app/appLayout.tsx +0 -5
- package/brands/engine/app/components/AgentPanel.tsx +0 -402
- package/brands/engine/app/components/AgentforceConversationClient.tsx +0 -201
- package/brands/engine/app/components/__inherit_AgentforceConversationClient.tsx +0 -3
- package/brands/engine/app/components/alerts/status-alert.tsx +0 -49
- package/brands/engine/app/components/layouts/card-layout.tsx +0 -29
- package/brands/engine/app/components/workspace/CommandCenter.tsx +0 -16
- package/brands/engine/app/config/agentApi.ts +0 -36
- package/brands/engine/app/features/object-search/__examples__/api/accountSearchService.ts +0 -46
- package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountIndustries.graphql +0 -19
- package/brands/engine/app/features/object-search/__examples__/api/query/distinctAccountTypes.graphql +0 -19
- package/brands/engine/app/features/object-search/__examples__/api/query/getAccountDetail.graphql +0 -121
- package/brands/engine/app/features/object-search/__examples__/api/query/searchAccounts.graphql +0 -51
- package/brands/engine/app/features/object-search/__examples__/pages/AccountObjectDetailPage.tsx +0 -357
- package/brands/engine/app/features/object-search/__examples__/pages/AccountSearch.tsx +0 -312
- package/brands/engine/app/features/object-search/__examples__/pages/Home.tsx +0 -34
- package/brands/engine/app/features/object-search/api/objectSearchService.ts +0 -84
- package/brands/engine/app/features/object-search/components/ActiveFilters.tsx +0 -89
- package/brands/engine/app/features/object-search/components/FilterContext.tsx +0 -83
- package/brands/engine/app/features/object-search/components/ObjectBreadcrumb.tsx +0 -66
- package/brands/engine/app/features/object-search/components/PaginationControls.tsx +0 -109
- package/brands/engine/app/features/object-search/components/SearchBar.tsx +0 -41
- package/brands/engine/app/features/object-search/components/SortControl.tsx +0 -143
- package/brands/engine/app/features/object-search/components/filters/BooleanFilter.tsx +0 -78
- package/brands/engine/app/features/object-search/components/filters/DateFilter.tsx +0 -128
- package/brands/engine/app/features/object-search/components/filters/DateRangeFilter.tsx +0 -70
- package/brands/engine/app/features/object-search/components/filters/FilterFieldWrapper.tsx +0 -33
- package/brands/engine/app/features/object-search/components/filters/MultiSelectFilter.tsx +0 -97
- package/brands/engine/app/features/object-search/components/filters/NumericRangeFilter.tsx +0 -163
- package/brands/engine/app/features/object-search/components/filters/SearchFilter.tsx +0 -50
- package/brands/engine/app/features/object-search/components/filters/SelectFilter.tsx +0 -97
- package/brands/engine/app/features/object-search/components/filters/TextFilter.tsx +0 -91
- package/brands/engine/app/features/object-search/hooks/useAsyncData.ts +0 -54
- package/brands/engine/app/features/object-search/hooks/useCachedAsyncData.ts +0 -184
- package/brands/engine/app/features/object-search/hooks/useDebouncedCallback.ts +0 -34
- package/brands/engine/app/features/object-search/hooks/useObjectSearchParams.ts +0 -252
- package/brands/engine/app/features/object-search/utils/debounce.ts +0 -25
- package/brands/engine/app/features/object-search/utils/fieldUtils.ts +0 -29
- package/brands/engine/app/features/object-search/utils/filterUtils.ts +0 -404
- package/brands/engine/app/features/object-search/utils/sortUtils.ts +0 -38
- package/brands/engine/app/hooks/useEngineLiveData.ts +0 -49
- package/brands/engine/app/hooks/useEvaAgent.ts +0 -288
- package/brands/engine/app/hooks/usePartnerDashboardData.ts +0 -141
- package/brands/engine/app/navigationMenu.tsx +0 -80
- package/brands/engine/app/pages/AccountObjectDetailPage.tsx +0 -361
- package/brands/engine/app/pages/AccountSearch.tsx +0 -305
- package/brands/engine/app/pages/BlankDashboard.tsx +0 -15
- package/brands/engine/app/pages/DataTest.tsx +0 -78
- package/brands/engine/app/pages/Home.tsx +0 -5
- package/brands/engine/app/pages/NotFound.tsx +0 -19
- package/brands/engine/app/pages/PartnerHubDashboard.tsx +0 -2077
- package/brands/engine/app/pages/Search.tsx +0 -13
- package/brands/engine/app/router-utils.tsx +0 -35
- package/brands/engine/app/routes.tsx +0 -39
- package/brands/engine/app/styles/global.css +0 -269
- package/brands/engine/brand.css +0 -40
- package/brands/engine/engine-command-center-prd.md +0 -575
- package/brands/engine/engine-live-data.js +0 -135
- package/brands/engine/engine-sample-data.js +0 -378
- package/brands/engine/engine_logo.png +0 -0
- package/brands/engine/global.css +0 -269
- package/brands/engine/partner-hub-sample-data.js +0 -281
- package/brands/engine/schema.graphql +0 -292
- package/brands/engine/useEngineLiveData.ts +0 -49
- package/brands/engine/useEvaAgent.ts +0 -288
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Engine Travel Command Center — Live Data (simulated)
|
|
3
|
-
*
|
|
4
|
-
* This file provides a distinctly different dataset from engine-sample-data.js
|
|
5
|
-
* to make the Phase 3 "real data" integration visually obvious. When the
|
|
6
|
-
* useEngineLiveData hook resolves, these values replace the sample data in
|
|
7
|
-
* every component — the audience sees new names, new cities, new numbers.
|
|
8
|
-
*
|
|
9
|
-
* SCENARIO: Severe thunderstorm system moving across the Midwest US.
|
|
10
|
-
* Three travelers affected — two inbound to Chicago (ORD), one in Denver (DEN).
|
|
11
|
-
* The demo prompts walk through: awareness → policy → notify → case creation.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// ─── MAP MARKERS ─────────────────────────────────────────────────────────────
|
|
15
|
-
export const MAP_MARKERS = [
|
|
16
|
-
{ id: "BOM", lon: 72.8777, lat: 19.0760, label: "Mumbai", active: true },
|
|
17
|
-
{ id: "GRU", lon: -46.6333, lat: -23.5505, label: "São Paulo", active: true },
|
|
18
|
-
{ id: "NRT", lon: 139.6917, lat: 35.6895, label: "Tokyo", active: true },
|
|
19
|
-
{ id: "ARN", lon: 18.0686, lat: 59.3293, label: "Stockholm", active: true },
|
|
20
|
-
{ id: "PVG", lon: 121.4737, lat: 31.2304, label: "Shanghai", active: true },
|
|
21
|
-
{ id: "DXB", lon: 55.2708, lat: 25.2048, label: "Dubai", active: true },
|
|
22
|
-
{ id: "LOS", lon: 3.3792, lat: 6.5244, label: "Lagos", active: true },
|
|
23
|
-
{ id: "ICN", lon: 126.9780, lat: 37.5665, label: "Seoul", active: true },
|
|
24
|
-
{ id: "LIS", lon: -9.1393, lat: 38.7223, label: "Lisbon", active: true },
|
|
25
|
-
{ id: "DEL", lon: 77.1025, lat: 28.7041, label: "Delhi", active: true },
|
|
26
|
-
{ id: "FRA", lon: 8.6821, lat: 50.1109, label: "Frankfurt", active: true },
|
|
27
|
-
{ id: "MEX", lon: -99.1332, lat: 19.4326, label: "Mexico City", active: true },
|
|
28
|
-
{ id: "LHR", lon: -0.1278, lat: 51.5074, label: "London", active: true },
|
|
29
|
-
{ id: "LAX", lon: -118.2437, lat: 34.0522, label: "Los Angeles", active: true },
|
|
30
|
-
{ id: "ORD", lon: -87.6298, lat: 41.8781, label: "Chicago", active: true },
|
|
31
|
-
{ id: "SFO", lon: -122.4194, lat: 37.7749, label: "San Francisco", active: true },
|
|
32
|
-
{ id: "BER", lon: 13.4050, lat: 52.5200, label: "Berlin", active: true },
|
|
33
|
-
{ id: "SEA", lon: -122.3321, lat: 47.6062, label: "Seattle", active: true },
|
|
34
|
-
{ id: "MIA", lon: -80.1918, lat: 25.7617, label: "Miami", active: true },
|
|
35
|
-
{ id: "SIN", lon: 103.8198, lat: 1.3521, label: "Singapore", active: true },
|
|
36
|
-
{ id: "DEN", lon: -104.9903, lat: 39.7392, label: "Denver", active: true },
|
|
37
|
-
];
|
|
38
|
-
|
|
39
|
-
// ─── MAP ARCS ────────────────────────────────────────────────────────────────
|
|
40
|
-
export const MAP_ARCS = [
|
|
41
|
-
{ id: "arc1", from: [72.8777, 19.0760], to: [-0.1278, 51.5074], progress: 0.65, danger: false },
|
|
42
|
-
{ id: "arc2", from: [-46.6333, -23.5505], to: [-87.6298, 41.8781], progress: 0.40, danger: true },
|
|
43
|
-
{ id: "arc3", from: [139.6917, 35.6895], to: [-118.2437, 34.0522], progress: 0.30, danger: false },
|
|
44
|
-
{ id: "arc4", from: [18.0686, 59.3293], to: [-87.6298, 41.8781], progress: 0.55, danger: true },
|
|
45
|
-
{ id: "arc5", from: [121.4737, 31.2304], to: [-122.4194, 37.7749], progress: 0.70, danger: false },
|
|
46
|
-
{ id: "arc6", from: [55.2708, 25.2048], to: [13.4050, 52.5200], progress: 0.0, danger: false },
|
|
47
|
-
{ id: "arc7", from: [3.3792, 6.5244], to: [-0.1278, 51.5074], progress: 0.85, danger: false },
|
|
48
|
-
{ id: "arc8", from: [126.9780, 37.5665], to: [-122.3321, 47.6062], progress: 0.45, danger: false },
|
|
49
|
-
{ id: "arc9", from: [-9.1393, 38.7223], to: [-80.1918, 25.7617], progress: 0.80, danger: false },
|
|
50
|
-
{ id: "arc10", from: [77.1025, 28.7041], to: [103.8198, 1.3521], progress: 0.90, danger: false },
|
|
51
|
-
{ id: "arc11", from: [8.6821, 50.1109], to: [139.6917, 35.6895], progress: 0.20, danger: false },
|
|
52
|
-
{ id: "arc12", from: [-99.1332, 19.4326], to: [-104.9903, 39.7392], progress: 1.0, danger: false },
|
|
53
|
-
];
|
|
54
|
-
|
|
55
|
-
// ─── MAP OVERLAYS (storm zones) ──────────────────────────────────────────────
|
|
56
|
-
export const MAP_OVERLAYS = [
|
|
57
|
-
{ id: "ov1", center: [-87.6298, 41.8781], radius: 5 },
|
|
58
|
-
{ id: "ov2", center: [-94.5786, 39.0997], radius: 4 },
|
|
59
|
-
{ id: "ov3", center: [-104.9903, 39.7392], radius: 3 },
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
// ─── FLIGHT STATUS LIST (glass strip) ────────────────────────────────────────
|
|
63
|
-
export const FLIGHT_STATUS_LIST = [
|
|
64
|
-
{ id: "f1", flight: "AI 131", route: "BOM → LHR", dep: "11:30 PM", status: "In Air", traveler: "Raj Kapoor", delayMin: 0 },
|
|
65
|
-
{ id: "f2", flight: "LA 8070", route: "GRU → ORD", dep: "6:15 PM", status: "Delayed", traveler: "Sofia Reyes", delayMin: 65 },
|
|
66
|
-
{ id: "f3", flight: "JL 62", route: "NRT → LAX", dep: "5:00 PM", status: "In Air", traveler: "Yuki Tanaka", delayMin: 0 },
|
|
67
|
-
{ id: "f4", flight: "SK 943", route: "ARN → ORD", dep: "1:40 PM", status: "Delayed", traveler: "Anna Johansson", delayMin: 90 },
|
|
68
|
-
{ id: "f5", flight: "MU 589", route: "PVG → SFO", dep: "12:50 PM", status: "In Air", traveler: "Chen Wei", delayMin: 0 },
|
|
69
|
-
{ id: "f6", flight: "EK 55", route: "DXB → BER", dep: "8:30 AM", status: "Scheduled", traveler: "Fatima Al-Rashidi", delayMin: 0 },
|
|
70
|
-
{ id: "f7", flight: "BA 83", route: "LOS → LHR", dep: "10:20 PM", status: "In Air", traveler: "James Okafor", delayMin: 0 },
|
|
71
|
-
{ id: "f8", flight: "KE 19", route: "ICN → SEA", dep: "4:10 PM", status: "In Air", traveler: "Min-jun Park", delayMin: 0 },
|
|
72
|
-
{ id: "f9", flight: "TP 225", route: "LIS → MIA", dep: "9:00 AM", status: "In Air", traveler: "Isabella Costa", delayMin: 0 },
|
|
73
|
-
{ id: "f10", flight: "AI 345", route: "DEL → SIN", dep: "2:15 AM", status: "In Air", traveler: "Amit Sharma", delayMin: 0 },
|
|
74
|
-
{ id: "f11", flight: "LH 716", route: "FRA → NRT", dep: "1:30 PM", status: "Boarding", traveler: "Lena Müller", delayMin: 0 },
|
|
75
|
-
{ id: "f12", flight: "AM 648", route: "MEX → DEN", dep: "7:45 AM", status: "Landed", traveler: "Carlos Mendez", delayMin: 0 },
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
// ─── TRAVELER CARDS ──────────────────────────────────────────────────────────
|
|
79
|
-
export const TRAVELER_CARDS = [
|
|
80
|
-
{ id: "L01", name: "Raj Kapoor", department: "Engineering", origin: "Mumbai", destination: "London", flight: "AI 131", hotel: "The Savoy", return: "Apr 4", policyStatus: "compliant" },
|
|
81
|
-
{ id: "L02", name: "Sofia Reyes", department: "Product", origin: "São Paulo", destination: "Chicago", flight: "LA 8070", hotel: "The Langham Chicago", return: "Apr 2", policyStatus: "compliant" },
|
|
82
|
-
{ id: "L03", name: "Yuki Tanaka", department: "Sales", origin: "Tokyo", destination: "Los Angeles", flight: "JL 62", hotel: "Shutters on Beach", return: "Apr 6", policyStatus: "compliant" },
|
|
83
|
-
{ id: "L04", name: "Anna Johansson", department: "Finance", origin: "Stockholm", destination: "Chicago", flight: "SK 943", hotel: "The Hoxton Chicago", return: "Apr 3", policyStatus: "compliant" },
|
|
84
|
-
{ id: "L05", name: "Chen Wei", department: "Engineering", origin: "Shanghai", destination: "San Francisco", flight: "MU 589", hotel: "Hotel Vitale", return: "Apr 8", policyStatus: "compliant" },
|
|
85
|
-
{ id: "L06", name: "Fatima Al-Rashidi", department: "Legal", origin: "Dubai", destination: "Berlin", flight: "EK 55", hotel: "Hotel de Rome", return: "Apr 5", policyStatus: "compliant" },
|
|
86
|
-
{ id: "L07", name: "James Okafor", department: "Marketing", origin: "Lagos", destination: "London", flight: "BA 83", hotel: "The Ned", return: "Apr 7", policyStatus: "compliant" },
|
|
87
|
-
{ id: "L08", name: "Min-jun Park", department: "Product", origin: "Seoul", destination: "Seattle", flight: "KE 19", hotel: "The Edgewater", return: "Apr 4", policyStatus: "compliant" },
|
|
88
|
-
{ id: "L09", name: "Isabella Costa", department: "Sales", origin: "Lisbon", destination: "Miami", flight: "TP 225", hotel: "Faena Miami Beach", return: "Apr 3", policyStatus: "compliant" },
|
|
89
|
-
{ id: "L10", name: "Amit Sharma", department: "Engineering", origin: "Delhi", destination: "Singapore", flight: "AI 345", hotel: "Marina Bay Sands", return: "Apr 9", policyStatus: "compliant" },
|
|
90
|
-
{ id: "L11", name: "Lena Müller", department: "Finance", origin: "Frankfurt", destination: "Tokyo", flight: "LH 716", hotel: "Aman Tokyo", return: "Apr 10", policyStatus: "exception" },
|
|
91
|
-
{ id: "L12", name: "Carlos Mendez", department: "Sales", origin: "Mexico City", destination: "Denver", flight: "AM 648", hotel: "The Crawford Denver", return: "Apr 1", policyStatus: "compliant" },
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
// ─── DISRUPTION CARDS ────────────────────────────────────────────────────────
|
|
95
|
-
export const DISRUPTION_CARDS = [
|
|
96
|
-
{ id: "d1", flight: "SK 943", route: "ARN → ORD", traveler: "Anna Johansson", severity: "grounded", delayMin: 90, reason: "Severe thunderstorm at O'Hare — ATC ground stop", evaAction: "Rerouting options: DTW connection or hold for next window" },
|
|
97
|
-
{ id: "d2", flight: "LA 8070", route: "GRU → ORD", traveler: "Sofia Reyes", severity: "delayed", delayMin: 65, reason: "Storm system at ORD — holding pattern over Indiana", evaAction: "Monitoring approach window — ETA updated to 9:20 PM CT" },
|
|
98
|
-
{ id: "d3", flight: "AM 648", route: "MEX → DEN", traveler: "Carlos Mendez", severity: "delayed", delayMin: 0, reason: "Landed — storm front moving toward Denver overnight", evaAction: "Return flight at risk — watching AM 649 departure tomorrow" },
|
|
99
|
-
{ id: "d4", flight: "UA 412", route: "ORD → DEN", traveler: "Multiple", severity: "grounded", delayMin: 120, reason: "ATC ground stop at O'Hare — all departures suspended", evaAction: "6 connecting flights affected — rebooking in progress" },
|
|
100
|
-
{ id: "d5", flight: "LH 716", route: "FRA → NRT", traveler: "Lena Müller", severity: "delayed", delayMin: 25, reason: "Late inbound aircraft from Munich", evaAction: "Boarding now — minimal impact, hotel notified of late arrival" },
|
|
101
|
-
];
|
|
102
|
-
|
|
103
|
-
// ─── ESCALATION CARDS ────────────────────────────────────────────────────────
|
|
104
|
-
export const ESCALATION_CARDS = [
|
|
105
|
-
{ id: "e1", title: "Midwest storm alert — 3 travelers affected", subtitle: "Anna Johansson, Sofia Reyes, Carlos Mendez in impact zone", status: "working", timestamp: "4 min ago" },
|
|
106
|
-
{ id: "e2", title: "Rerouting Anna Johansson via Detroit", subtitle: "SK 943 grounded — alternate DL 1482 ARN → DTW → ORD", status: "working", timestamp: "12 min ago" },
|
|
107
|
-
{ id: "e3", title: "Hotel backup hold at Langham Chicago", subtitle: "Late arrival guaranteed for Sofia Reyes — LA 8070 delayed", status: "complete", timestamp: "18 min ago" },
|
|
108
|
-
{ id: "e4", title: "Weather alert sent to Carlos Mendez", subtitle: "Storm moving toward Denver — AM 649 return flight at risk", status: "complete", timestamp: "25 min ago" },
|
|
109
|
-
{ id: "e5", title: "Sent delay notification to Anna Johansson", subtitle: "SK 943 +90 min — updated itinerary with new gate info", status: "complete", timestamp: "30 min ago" },
|
|
110
|
-
{ id: "e6", title: "Hotel upgrade for Lena Müller", subtitle: "Aman Tokyo — loyalty rate applied ($520 → $380/n)", status: "complete", timestamp: "45 min ago" },
|
|
111
|
-
{ id: "e7", title: "Group rate secured — Seoul team offsite", subtitle: "The Edgewater · 8 rooms · $189/n (was $259/n)", status: "complete", timestamp: "1.2 hr ago" },
|
|
112
|
-
{ id: "e8", title: "Duplicate booking cancelled — Isabella Costa", subtitle: "LIS → MIA booked twice · Refund $380 processed", status: "complete", timestamp: "1.8 hr ago" },
|
|
113
|
-
{ id: "e9", title: "Travel policy exception — Lena Müller", subtitle: "Aman Tokyo $520/n exceeds $350 cap — manager approved", status: "complete", timestamp: "2.1 hr ago" },
|
|
114
|
-
{ id: "e10", title: "Insurance pre-filed for Chicago delays", subtitle: "AXA claims for SK 943 and LA 8070 — weather disruption", status: "pending", timestamp: "2 min ago" },
|
|
115
|
-
];
|
|
116
|
-
|
|
117
|
-
// ─── MONTHLY SPEND ───────────────────────────────────────────────────────────
|
|
118
|
-
export const MONTHLY_SPEND = [
|
|
119
|
-
{ month: "Oct", amount: 168000 },
|
|
120
|
-
{ month: "Nov", amount: 152000 },
|
|
121
|
-
{ month: "Dec", amount: 118000 },
|
|
122
|
-
{ month: "Jan", amount: 189000 },
|
|
123
|
-
{ month: "Feb", amount: 172000 },
|
|
124
|
-
{ month: "Mar", amount: 187200 },
|
|
125
|
-
];
|
|
126
|
-
|
|
127
|
-
// ─── COMPUTED METRICS ────────────────────────────────────────────────────────
|
|
128
|
-
export const METRICS = {
|
|
129
|
-
activeTravelers: 12,
|
|
130
|
-
spendMTD: 187200,
|
|
131
|
-
complianceRate: 92,
|
|
132
|
-
evaResolutionRate: 78,
|
|
133
|
-
evaResolved: 9,
|
|
134
|
-
pendingBookings: 3,
|
|
135
|
-
};
|
|
@@ -1,378 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Engine Travel Command Center — Sample Data
|
|
3
|
-
*
|
|
4
|
-
* Field names match the Salesforce org schema (Trip__c, Flight__c, Booking__c,
|
|
5
|
-
* Disruption__c, Rebooking_Action__c, Travel_Policy__c, etc.) so switching
|
|
6
|
-
* from sample → live Data Cloud queries requires only a data-source swap,
|
|
7
|
-
* not a field-name refactor.
|
|
8
|
-
*
|
|
9
|
-
* Each section exports both the raw records AND dashboard-ready derivatives
|
|
10
|
-
* (map markers, arcs, chart data, formatted metrics).
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// ─── AIRPORTS (reference) ───────────────────────────────────────────────────
|
|
14
|
-
export const AIRPORTS = [
|
|
15
|
-
{ IATA_Code__c: "SFO", City__c: "San Francisco", Latitude__c: 37.7749, Longitude__c: -122.4194 },
|
|
16
|
-
{ IATA_Code__c: "JFK", City__c: "New York", Latitude__c: 40.7128, Longitude__c: -74.0060 },
|
|
17
|
-
{ IATA_Code__c: "ORD", City__c: "Chicago", Latitude__c: 41.8781, Longitude__c: -87.6298 },
|
|
18
|
-
{ IATA_Code__c: "LAX", City__c: "Los Angeles", Latitude__c: 34.0522, Longitude__c: -118.2437 },
|
|
19
|
-
{ IATA_Code__c: "MIA", City__c: "Miami", Latitude__c: 25.7617, Longitude__c: -80.1918 },
|
|
20
|
-
{ IATA_Code__c: "SEA", City__c: "Seattle", Latitude__c: 47.6062, Longitude__c: -122.3321 },
|
|
21
|
-
{ IATA_Code__c: "BOS", City__c: "Boston", Latitude__c: 42.3601, Longitude__c: -71.0589 },
|
|
22
|
-
{ IATA_Code__c: "DEN", City__c: "Denver", Latitude__c: 39.7392, Longitude__c: -104.9903 },
|
|
23
|
-
{ IATA_Code__c: "AUS", City__c: "Austin", Latitude__c: 30.2672, Longitude__c: -97.7431 },
|
|
24
|
-
{ IATA_Code__c: "ATL", City__c: "Atlanta", Latitude__c: 33.7490, Longitude__c: -84.3880 },
|
|
25
|
-
{ IATA_Code__c: "LHR", City__c: "London", Latitude__c: 51.5074, Longitude__c: -0.1278 },
|
|
26
|
-
{ IATA_Code__c: "NRT", City__c: "Tokyo", Latitude__c: 35.6895, Longitude__c: 139.6917 },
|
|
27
|
-
{ IATA_Code__c: "BER", City__c: "Berlin", Latitude__c: 52.5200, Longitude__c: 13.4050 },
|
|
28
|
-
{ IATA_Code__c: "SIN", City__c: "Singapore", Latitude__c: 1.3521, Longitude__c: 103.8198 },
|
|
29
|
-
{ IATA_Code__c: "CDG", City__c: "Paris", Latitude__c: 48.8566, Longitude__c: 2.3522 },
|
|
30
|
-
{ IATA_Code__c: "DXB", City__c: "Dubai", Latitude__c: 25.2048, Longitude__c: 55.2708 },
|
|
31
|
-
{ IATA_Code__c: "SYD", City__c: "Sydney", Latitude__c: -33.8688, Longitude__c: 151.2093 },
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const airportByCode = Object.fromEntries(
|
|
35
|
-
AIRPORTS.map((a) => [a.IATA_Code__c, a])
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// ─── CONTACTS / TRAVELERS ───────────────────────────────────────────────────
|
|
39
|
-
export const TRAVELERS = [
|
|
40
|
-
{ Id: "003T1", FirstName: "Sarah", LastName: "Chen", Department: "Engineering", Home_Airport__c: "SFO", Travel_Policy_Tier__c: "Manager", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
41
|
-
{ Id: "003T2", FirstName: "Marcus", LastName: "Johnson", Department: "Sales", Home_Airport__c: "JFK", Travel_Policy_Tier__c: "Standard", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
42
|
-
{ Id: "003T3", FirstName: "Priya", LastName: "Patel", Department: "Product", Home_Airport__c: "ORD", Travel_Policy_Tier__c: "Standard", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
43
|
-
{ Id: "003T4", FirstName: "David", LastName: "Kim", Department: "Finance", Home_Airport__c: "LAX", Travel_Policy_Tier__c: "Executive", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
44
|
-
{ Id: "003T5", FirstName: "Elena", LastName: "Rodriguez", Department: "Marketing", Home_Airport__c: "MIA", Travel_Policy_Tier__c: "Standard", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
45
|
-
{ Id: "003T6", FirstName: "James", LastName: "Wright", Department: "Engineering", Home_Airport__c: "SEA", Travel_Policy_Tier__c: "Standard", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
46
|
-
{ Id: "003T7", FirstName: "Aisha", LastName: "Mohammed", Department: "Legal", Home_Airport__c: "BOS", Travel_Policy_Tier__c: "Manager", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
47
|
-
{ Id: "003T8", FirstName: "Tom", LastName: "O'Brien", Department: "Sales", Home_Airport__c: "DEN", Travel_Policy_Tier__c: "Standard", Is_Active_Traveler__c: true, Role__c: "Traveler" },
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
// ─── TRIPS ──────────────────────────────────────────────────────────────────
|
|
51
|
-
export const TRIPS = [
|
|
52
|
-
{ Id: "a00T1", Trip_Name__c: "Chen – London", Contact__c: "003T1", Origin_City__c: "San Francisco", Origin_Airport__c: "SFO", Destination_City__c: "London", Destination_Airport__c: "LHR", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-28", Status__c: "In Progress", Total_Cost__c: 4200, In_Policy__c: true, Has_Disruption__c: false },
|
|
53
|
-
{ Id: "a00T2", Trip_Name__c: "Johnson – Tokyo", Contact__c: "003T2", Origin_City__c: "New York", Origin_Airport__c: "JFK", Destination_City__c: "Tokyo", Destination_Airport__c: "NRT", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-30", Status__c: "In Progress", Total_Cost__c: 5800, In_Policy__c: true, Has_Disruption__c: false },
|
|
54
|
-
{ Id: "a00T3", Trip_Name__c: "Patel – Berlin", Contact__c: "003T3", Origin_City__c: "Chicago", Origin_Airport__c: "ORD", Destination_City__c: "Berlin", Destination_Airport__c: "BER", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-27", Status__c: "In Progress", Total_Cost__c: 3400, In_Policy__c: false, Has_Disruption__c: true },
|
|
55
|
-
{ Id: "a00T4", Trip_Name__c: "Kim – Singapore", Contact__c: "003T4", Origin_City__c: "Los Angeles", Origin_Airport__c: "LAX", Destination_City__c: "Singapore", Destination_Airport__c: "SIN", Start_Date__c: "2026-03-25", End_Date__c: "2026-04-01", Status__c: "In Progress", Total_Cost__c: 6100, In_Policy__c: true, Has_Disruption__c: false },
|
|
56
|
-
{ Id: "a00T5", Trip_Name__c: "Rodriguez – Paris", Contact__c: "003T5", Origin_City__c: "Miami", Origin_Airport__c: "MIA", Destination_City__c: "Paris", Destination_Airport__c: "CDG", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-26", Status__c: "In Progress", Total_Cost__c: 2900, In_Policy__c: true, Has_Disruption__c: true },
|
|
57
|
-
{ Id: "a00T6", Trip_Name__c: "Wright – Austin", Contact__c: "003T6", Origin_City__c: "Seattle", Origin_Airport__c: "SEA", Destination_City__c: "Austin", Destination_Airport__c: "AUS", Start_Date__c: "2026-03-24", End_Date__c: "2026-03-25", Status__c: "In Progress", Total_Cost__c: 820, In_Policy__c: true, Has_Disruption__c: false },
|
|
58
|
-
{ Id: "a00T7", Trip_Name__c: "Mohammed – Dubai", Contact__c: "003T7", Origin_City__c: "Boston", Origin_Airport__c: "BOS", Destination_City__c: "Dubai", Destination_Airport__c: "DXB", Start_Date__c: "2026-03-25", End_Date__c: "2026-03-31", Status__c: "In Progress", Total_Cost__c: 5200, In_Policy__c: false, Has_Disruption__c: false },
|
|
59
|
-
{ Id: "a00T8", Trip_Name__c: "O'Brien – Sydney", Contact__c: "003T8", Origin_City__c: "Denver", Origin_Airport__c: "DEN", Destination_City__c: "Sydney", Destination_Airport__c: "SYD", Start_Date__c: "2026-03-25", End_Date__c: "2026-04-02", Status__c: "In Progress", Total_Cost__c: 7400, In_Policy__c: true, Has_Disruption__c: false },
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
// ─── FLIGHTS ────────────────────────────────────────────────────────────────
|
|
63
|
-
export const FLIGHTS = [
|
|
64
|
-
{ Id: "a01F1", Flight_Number__c: "BA 286", Airline__c: "British Airways", Departure_Airport__c: "SFO", Departure_City__c: "San Francisco", Departure_Longitude__c: -122.4194, Departure_Latitude__c: 37.7749, Arrival_Airport__c: "LHR", Arrival_City__c: "London", Arrival_Longitude__c: -0.1278, Arrival_Latitude__c: 51.5074, Departure_DateTime__c: "2026-03-25T22:45:00Z", Flight_Status__c: "In Air", Delay_Minutes__c: 0, Cabin_Class__c: "Business", Contact__c: "003T1" },
|
|
65
|
-
{ Id: "a01F2", Flight_Number__c: "NH 109", Airline__c: "All Nippon Airways", Departure_Airport__c: "JFK", Departure_City__c: "New York", Departure_Longitude__c: -74.0060, Departure_Latitude__c: 40.7128, Arrival_Airport__c: "NRT", Arrival_City__c: "Tokyo", Arrival_Longitude__c: 139.6917, Arrival_Latitude__c: 35.6895, Departure_DateTime__c: "2026-03-25T11:30:00Z", Flight_Status__c: "In Air", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T2" },
|
|
66
|
-
{ Id: "a01F3", Flight_Number__c: "LH 431", Airline__c: "Lufthansa", Departure_Airport__c: "ORD", Departure_City__c: "Chicago", Departure_Longitude__c: -87.6298, Departure_Latitude__c: 41.8781, Arrival_Airport__c: "BER", Arrival_City__c: "Berlin", Arrival_Longitude__c: 13.4050, Arrival_Latitude__c: 52.5200, Departure_DateTime__c: "2026-03-25T17:15:00Z", Flight_Status__c: "Delayed", Delay_Minutes__c: 95, Cabin_Class__c: "Economy", Contact__c: "003T3" },
|
|
67
|
-
{ Id: "a01F4", Flight_Number__c: "SQ 37", Airline__c: "Singapore Airlines", Departure_Airport__c: "LAX", Departure_City__c: "Los Angeles", Departure_Longitude__c: -118.2437, Departure_Latitude__c: 34.0522, Arrival_Airport__c: "SIN", Arrival_City__c: "Singapore", Arrival_Longitude__c: 103.8198, Arrival_Latitude__c: 1.3521, Departure_DateTime__c: "2026-03-25T23:00:00Z", Flight_Status__c: "Boarding", Delay_Minutes__c: 0, Cabin_Class__c: "Business", Contact__c: "003T4" },
|
|
68
|
-
{ Id: "a01F5", Flight_Number__c: "AF 99", Airline__c: "Air France", Departure_Airport__c: "MIA", Departure_City__c: "Miami", Departure_Longitude__c: -80.1918, Departure_Latitude__c: 25.7617, Arrival_Airport__c: "CDG", Arrival_City__c: "Paris", Arrival_Longitude__c: 2.3522, Arrival_Latitude__c: 48.8566, Departure_DateTime__c: "2026-03-25T18:20:00Z", Flight_Status__c: "Delayed", Delay_Minutes__c: 45, Cabin_Class__c: "Premium Economy", Contact__c: "003T5" },
|
|
69
|
-
{ Id: "a01F6", Flight_Number__c: "AS 670", Airline__c: "Alaska Airlines", Departure_Airport__c: "SEA", Departure_City__c: "Seattle", Departure_Longitude__c: -122.3321, Departure_Latitude__c: 47.6062, Arrival_Airport__c: "AUS", Arrival_City__c: "Austin", Arrival_Longitude__c: -97.7431, Arrival_Latitude__c: 30.2672, Departure_DateTime__c: "2026-03-25T08:05:00Z", Flight_Status__c: "Landed", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T6" },
|
|
70
|
-
{ Id: "a01F7", Flight_Number__c: "EK 238", Airline__c: "Emirates", Departure_Airport__c: "BOS", Departure_City__c: "Boston", Departure_Longitude__c: -71.0589, Departure_Latitude__c: 42.3601, Arrival_Airport__c: "DXB", Arrival_City__c: "Dubai", Arrival_Longitude__c: 55.2708, Arrival_Latitude__c: 25.2048, Departure_DateTime__c: "2026-03-25T21:30:00Z", Flight_Status__c: "Scheduled", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T7" },
|
|
71
|
-
{ Id: "a01F8", Flight_Number__c: "QF 16", Airline__c: "Qantas", Departure_Airport__c: "DEN", Departure_City__c: "Denver", Departure_Longitude__c: -104.9903, Departure_Latitude__c: 39.7392, Arrival_Airport__c: "SYD", Arrival_City__c: "Sydney", Arrival_Longitude__c: 151.2093, Arrival_Latitude__c: -33.8688, Departure_DateTime__c: "2026-03-25T22:10:00Z", Flight_Status__c: "In Air", Delay_Minutes__c: 0, Cabin_Class__c: "Economy", Contact__c: "003T8" },
|
|
72
|
-
];
|
|
73
|
-
|
|
74
|
-
// ─── HOTEL RESERVATIONS ─────────────────────────────────────────────────────
|
|
75
|
-
export const HOTELS = [
|
|
76
|
-
{ Id: "a02H1", Hotel_Name__c: "The Ned", City__c: "London", Nightly_Rate__c: 320, Check_In_Date__c: "2026-03-24", Check_Out_Date__c: "2026-03-28", Status__c: "Checked In", Contact__c: "003T1" },
|
|
77
|
-
{ Id: "a02H2", Hotel_Name__c: "Park Hyatt", City__c: "Tokyo", Nightly_Rate__c: 450, Check_In_Date__c: "2026-03-25", Check_Out_Date__c: "2026-03-30", Status__c: "Reserved", Contact__c: "003T2" },
|
|
78
|
-
{ Id: "a02H3", Hotel_Name__c: "Hotel Adlon", City__c: "Berlin", Nightly_Rate__c: 410, Check_In_Date__c: "2026-03-24", Check_Out_Date__c: "2026-03-27", Status__c: "Reserved", Contact__c: "003T3" },
|
|
79
|
-
{ Id: "a02H4", Hotel_Name__c: "Marina Bay Sands", City__c: "Singapore", Nightly_Rate__c: 380, Check_In_Date__c: "2026-03-26", Check_Out_Date__c: "2026-04-01", Status__c: "Reserved", Contact__c: "003T4" },
|
|
80
|
-
{ Id: "a02H5", Hotel_Name__c: "Le Marais Hotel", City__c: "Paris", Nightly_Rate__c: 275, Check_In_Date__c: "2026-03-24", Check_Out_Date__c: "2026-03-26", Status__c: "Checked In", Contact__c: "003T5" },
|
|
81
|
-
{ Id: "a02H6", Hotel_Name__c: "Line Hotel", City__c: "Austin", Nightly_Rate__c: 159, Check_In_Date__c: "2026-03-24", Check_Out_Date__c: "2026-03-25", Status__c: "Checked In", Contact__c: "003T6" },
|
|
82
|
-
{ Id: "a02H7", Hotel_Name__c: "Jumeirah Emirates", City__c: "Dubai", Nightly_Rate__c: 340, Check_In_Date__c: "2026-03-26", Check_Out_Date__c: "2026-03-31", Status__c: "Reserved", Contact__c: "003T7" },
|
|
83
|
-
{ Id: "a02H8", Hotel_Name__c: "QT Sydney", City__c: "Sydney", Nightly_Rate__c: 290, Check_In_Date__c: "2026-03-26", Check_Out_Date__c: "2026-04-02", Status__c: "Reserved", Contact__c: "003T8" },
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
// ─── DISRUPTIONS ────────────────────────────────────────────────────────────
|
|
87
|
-
export const DISRUPTIONS = [
|
|
88
|
-
{ Id: "a03D1", Flight_Number__c: "LH 431", Disruption_Type__c: "Flight Delay", Severity__c: "High", Status__c: "In Progress", Impacted_Flight__c: "a01F3", Trip__c: "a00T3", City__c: "Chicago", Affected_Traveler_Count__c: 1, Auto_Rebook_Eligible__c: true, Recommended_Action__c: "Rebook on LH 433 (dep 7:50p)", Description__c: "Mechanical — crew change required" },
|
|
89
|
-
{ Id: "a03D2", Flight_Number__c: "AF 99", Disruption_Type__c: "Weather Event", Severity__c: "Medium", Status__c: "Assessing Impact", Impacted_Flight__c: "a01F5", Trip__c: "a00T5", City__c: "Paris", Affected_Traveler_Count__c: 1, Auto_Rebook_Eligible__c: false, Recommended_Action__c: "Monitoring — no action needed yet", Description__c: "Thunderstorms at CDG" },
|
|
90
|
-
{ Id: "a03D3", Flight_Number__c: "UA 412", Disruption_Type__c: "Airport Closure", Severity__c: "Critical", Status__c: "In Progress", Impacted_Flight__c: null, Trip__c: null, City__c: "Chicago", Affected_Traveler_Count__c: 2, Auto_Rebook_Eligible__c: true, Recommended_Action__c: "Rebooked on AA 1582 (dep 3:15p)", Description__c: "ATC ground stop — O'Hare capacity" },
|
|
91
|
-
{ Id: "a03D4", Flight_Number__c: "DL 209", Disruption_Type__c: "Airline Schedule Change", Severity__c: "Medium", Status__c: "In Progress", Impacted_Flight__c: null, Trip__c: null, City__c: "Los Angeles", Affected_Traveler_Count__c: 1, Auto_Rebook_Eligible__c: false, Recommended_Action__c: "Hotel backup hold at LAX Marriott", Description__c: "Late inbound aircraft" },
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
// ─── BOOKINGS (upcoming) ────────────────────────────────────────────────────
|
|
95
|
-
export const BOOKINGS = [
|
|
96
|
-
{ Id: "a04B1", Contact__c: "003T9", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 824, In_Policy__c: true, _travelerName: "Lisa Park", _destination: "Denver → Chicago", _dates: "Mar 28–30" },
|
|
97
|
-
{ Id: "a04B2", Contact__c: "003T10", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 412, In_Policy__c: true, _travelerName: "Ryan Foster", _destination: "NYC → San Francisco", _dates: "Mar 29" },
|
|
98
|
-
{ Id: "a04B3", Contact__c: "003T11", Booking_Type__c: "Flight", Status__c: "Pending approval", Cost__c: 2340, In_Policy__c: false, _travelerName: "Mei Wong", _destination: "Seattle → London", _dates: "Apr 1–5" },
|
|
99
|
-
{ Id: "a04B4", Contact__c: "003T12", Booking_Type__c: "Hotel", Status__c: "Confirmed", Cost__c: 380, In_Policy__c: true, _travelerName: "Carlos Vega", _destination: "Austin", _dates: "Apr 2–4" },
|
|
100
|
-
{ Id: "a04B5", Contact__c: "003T13", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 1890, In_Policy__c: true, _travelerName: "Nina Kowalski", _destination: "Boston → Berlin", _dates: "Apr 3–7" },
|
|
101
|
-
{ Id: "a04B6", Contact__c: "003T14", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 298, In_Policy__c: true, _travelerName: "Andre Williams", _destination: "LA → Miami", _dates: "Apr 5" },
|
|
102
|
-
{ Id: "a04B7", Contact__c: "003T15", Booking_Type__c: "Flight", Status__c: "Confirmed", Cost__c: 3150, In_Policy__c: false, _travelerName: "Hannah Lee", _destination: "Chicago → Tokyo", _dates: "Apr 7–12" },
|
|
103
|
-
{ Id: "a04B8", Contact__c: "003T16", Booking_Type__c: "Flight", Status__c: "Pending approval", Cost__c: 2100, In_Policy__c: false, _travelerName: "Omar Hassan", _destination: "Denver → Paris", _dates: "Apr 8–11" },
|
|
104
|
-
];
|
|
105
|
-
|
|
106
|
-
// ─── REBOOKING ACTIONS (Eva activity) ───────────────────────────────────────
|
|
107
|
-
export const REBOOKING_ACTIONS = [
|
|
108
|
-
{ Id: "a05R1", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T3", Original_Flight__c: "LH 431", New_Flight__c: "LH 433", Cost_Difference__c: 0, Notes__c: "Rebooked cancelled flight for Priya Patel — LH 431 → LH 433 · Same fare class", Created_DateTime__c: "2026-03-25T14:58:00Z" },
|
|
109
|
-
{ Id: "a05R2", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T11", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: -221, Notes__c: "Found policy-compliant hotel for Mei Wong — Hotel Adlon ($410/n) → Motel One ($189/n)", Created_DateTime__c: "2026-03-25T14:52:00Z" },
|
|
110
|
-
{ Id: "a05R3", Action_Type__c: "Escalation", Status__c: "In Progress", Handled_By__c: "Eva (Agent)", Contact__c: "003T16", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Processing approval for Omar Hassan — Paris trip over budget — escalated to manager", Created_DateTime__c: "2026-03-25T14:48:00Z" },
|
|
111
|
-
{ Id: "a05R4", Action_Type__c: "Auto-Cancel", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T14", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Auto-approved Andre Williams flight — LA → Miami · $298 · Within policy", Created_DateTime__c: "2026-03-25T14:35:00Z" },
|
|
112
|
-
{ Id: "a05R5", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T4", Original_Flight__c: "SQ 37", New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Sent itinerary update to David Kim — Gate change SQ 37 · Terminal 2 → Terminal 3", Created_DateTime__c: "2026-03-25T14:26:00Z" },
|
|
113
|
-
{ Id: "a05R6", Action_Type__c: "Manual Rebook", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T6", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: -60, Notes__c: "Negotiated group rate for Austin offsite — Line Hotel · 12 rooms · $159/n (was $219/n)", Created_DateTime__c: "2026-03-25T13:00:00Z" },
|
|
114
|
-
{ Id: "a05R7", Action_Type__c: "Auto-Cancel", Status__c: "Completed", Handled_By__c: "Eva (Agent)", Contact__c: "003T10", Original_Flight__c: null, New_Flight__c: null, Cost_Difference__c: -412, Notes__c: "Flagged duplicate booking for Ryan Foster — NYC → SFO booked twice · Cancelled duplicate", Created_DateTime__c: "2026-03-25T12:30:00Z" },
|
|
115
|
-
{ Id: "a05R8", Action_Type__c: "Waitlist", Status__c: "In Progress", Handled_By__c: "Eva (Agent)", Contact__c: "003T5", Original_Flight__c: "AF 99", New_Flight__c: null, Cost_Difference__c: 0, Notes__c: "Monitoring weather delay for Elena Rodriguez — AF 99 · CDG arrival delayed 45 min · No action yet", Created_DateTime__c: "2026-03-25T12:00:00Z" },
|
|
116
|
-
];
|
|
117
|
-
|
|
118
|
-
// ─── TRAVEL POLICIES ────────────────────────────────────────────────────────
|
|
119
|
-
export const TRAVEL_POLICIES = [
|
|
120
|
-
{ Id: "a06P1", Name: "Flight booking policy", Description__c: "Economy required for domestic under 4 hrs", Active__c: true, Policy_Tier__c: "Standard", Max_Flight_Cost__c: 800, Advance_Booking_Days__c: 7, _health: "operational", _lastEvaluated: "2026-03-24T10:00:00Z" },
|
|
121
|
-
{ Id: "a06P2", Name: "Hotel nightly rate cap", Description__c: "$275/night domestic, $350/night international", Active__c: true, Policy_Tier__c: "Standard", Max_Hotel_Rate__c: 275, Advance_Booking_Days__c: null, _health: "degraded", _lastEvaluated: "2026-03-24T09:00:00Z" },
|
|
122
|
-
{ Id: "a06P3", Name: "Advance booking window", Description__c: "14-day minimum for international travel", Active__c: true, Policy_Tier__c: "Standard", Max_Flight_Cost__c: null, Advance_Booking_Days__c: 14, _health: "operational", _lastEvaluated: "2026-03-24T08:00:00Z" },
|
|
123
|
-
{ Id: "a06P4", Name: "Preferred vendor usage", Description__c: "United, Delta, Marriott, Hilton preferred", Active__c: true, Policy_Tier__c: "Standard", Preferred_Airlines__c: "United, Delta", Preferred_Hotel_Chains__c: "Marriott, Hilton", _health: "operational", _lastEvaluated: "2026-03-23T16:00:00Z" },
|
|
124
|
-
{ Id: "a06P5", Name: "Expense receipt compliance", Description__c: "All receipts within 5 business days", Active__c: true, Policy_Tier__c: "Standard", Max_Flight_Cost__c: null, Advance_Booking_Days__c: null, _health: "degraded", _lastEvaluated: "2026-03-23T14:00:00Z" },
|
|
125
|
-
];
|
|
126
|
-
|
|
127
|
-
// ─── ACCOUNT STATS ──────────────────────────────────────────────────────────
|
|
128
|
-
export const ACCOUNT = {
|
|
129
|
-
Id: "001A1",
|
|
130
|
-
Name: "Acme Corp",
|
|
131
|
-
Account_Tier__c: "Enterprise",
|
|
132
|
-
Active_Travelers__c: 8,
|
|
133
|
-
Annual_Travel_Spend__c: 1540000,
|
|
134
|
-
Total_Trips_YTD__c: 142,
|
|
135
|
-
CSAT_Score__c: 4.7,
|
|
136
|
-
Travel_Policy_Enabled__c: true,
|
|
137
|
-
Flex_Pro_Subscriber__c: true,
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
// ─── SPEND HISTORY (aggregated) ─────────────────────────────────────────────
|
|
141
|
-
export const MONTHLY_SPEND = [
|
|
142
|
-
{ month: "Oct", amount: 142000 },
|
|
143
|
-
{ month: "Nov", amount: 128000 },
|
|
144
|
-
{ month: "Dec", amount: 98000 },
|
|
145
|
-
{ month: "Jan", amount: 156000 },
|
|
146
|
-
{ month: "Feb", amount: 134000 },
|
|
147
|
-
{ month: "Mar", amount: 128400 },
|
|
148
|
-
];
|
|
149
|
-
|
|
150
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
151
|
-
// DASHBOARD-READY DERIVATIVES
|
|
152
|
-
// These transform the Salesforce-shaped records into the props that
|
|
153
|
-
// GeoMap, ChartCard, TableCard, etc. consume directly.
|
|
154
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
155
|
-
|
|
156
|
-
// ─── MAP: markers ───────────────────────────────────────────────────────────
|
|
157
|
-
const usedCodes = new Set();
|
|
158
|
-
FLIGHTS.forEach((f) => {
|
|
159
|
-
usedCodes.add(f.Departure_Airport__c);
|
|
160
|
-
usedCodes.add(f.Arrival_Airport__c);
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
export const MAP_MARKERS = AIRPORTS.filter((a) =>
|
|
164
|
-
usedCodes.has(a.IATA_Code__c)
|
|
165
|
-
).map((a) => ({
|
|
166
|
-
id: a.IATA_Code__c,
|
|
167
|
-
lon: a.Longitude__c,
|
|
168
|
-
lat: a.Latitude__c,
|
|
169
|
-
label: a.City__c,
|
|
170
|
-
active: true,
|
|
171
|
-
}));
|
|
172
|
-
|
|
173
|
-
// ─── MAP: arcs ──────────────────────────────────────────────────────────────
|
|
174
|
-
const FLIGHT_PROGRESS = {
|
|
175
|
-
"In Air": 0.55,
|
|
176
|
-
Boarding: 0.05,
|
|
177
|
-
Delayed: 0.0,
|
|
178
|
-
Scheduled: 0.0,
|
|
179
|
-
Landed: 1.0,
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const disruptedFlightIds = new Set(
|
|
183
|
-
DISRUPTIONS.map((d) => d.Impacted_Flight__c).filter(Boolean)
|
|
184
|
-
);
|
|
185
|
-
|
|
186
|
-
export const MAP_ARCS = FLIGHTS.map((f) => ({
|
|
187
|
-
id: f.Id,
|
|
188
|
-
from: [f.Departure_Longitude__c, f.Departure_Latitude__c],
|
|
189
|
-
to: [f.Arrival_Longitude__c, f.Arrival_Latitude__c],
|
|
190
|
-
progress: FLIGHT_PROGRESS[f.Flight_Status__c] ?? 0,
|
|
191
|
-
danger: disruptedFlightIds.has(f.Id) || f.Delay_Minutes__c >= 60,
|
|
192
|
-
}));
|
|
193
|
-
|
|
194
|
-
// ─── MAP: overlays (weather / disruption zones) ─────────────────────────────
|
|
195
|
-
const cityToAirportCode = Object.fromEntries(
|
|
196
|
-
AIRPORTS.map((a) => [a.City__c, a.IATA_Code__c])
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
export const MAP_OVERLAYS = DISRUPTIONS.filter(
|
|
200
|
-
(d) => d.Disruption_Type__c === "Weather Event"
|
|
201
|
-
).map((d) => {
|
|
202
|
-
const code = cityToAirportCode[d.City__c] ?? "CDG";
|
|
203
|
-
const airport = airportByCode[code];
|
|
204
|
-
return {
|
|
205
|
-
id: d.Id,
|
|
206
|
-
center: [airport?.Longitude__c ?? 2.35, airport?.Latitude__c ?? 48.86],
|
|
207
|
-
radius: 4,
|
|
208
|
-
};
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
// ─── FLIGHT STATUS (for glass strip) ────────────────────────────────────────
|
|
212
|
-
const travelerByContactId = Object.fromEntries(
|
|
213
|
-
TRAVELERS.map((t) => [t.Id, t])
|
|
214
|
-
);
|
|
215
|
-
|
|
216
|
-
export const FLIGHT_STATUS_LIST = FLIGHTS.map((f) => {
|
|
217
|
-
const t = travelerByContactId[f.Contact__c];
|
|
218
|
-
return {
|
|
219
|
-
id: f.Id,
|
|
220
|
-
flight: f.Flight_Number__c,
|
|
221
|
-
route: `${f.Departure_Airport__c} → ${f.Arrival_Airport__c}`,
|
|
222
|
-
dep: new Date(f.Departure_DateTime__c).toLocaleTimeString("en-US", {
|
|
223
|
-
hour: "numeric",
|
|
224
|
-
minute: "2-digit",
|
|
225
|
-
}),
|
|
226
|
-
status: f.Flight_Status__c,
|
|
227
|
-
traveler: t ? `${t.FirstName} ${t.LastName}` : "",
|
|
228
|
-
delayMin: f.Delay_Minutes__c,
|
|
229
|
-
};
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
// ─── TRAVELER CARDS ─────────────────────────────────────────────────────────
|
|
233
|
-
const hotelByContact = Object.fromEntries(
|
|
234
|
-
HOTELS.map((h) => [h.Contact__c, h])
|
|
235
|
-
);
|
|
236
|
-
|
|
237
|
-
const tripByContact = Object.fromEntries(
|
|
238
|
-
TRIPS.map((t) => [t.Contact__c, t])
|
|
239
|
-
);
|
|
240
|
-
|
|
241
|
-
const flightByContact = Object.fromEntries(
|
|
242
|
-
FLIGHTS.map((f) => [f.Contact__c, f])
|
|
243
|
-
);
|
|
244
|
-
|
|
245
|
-
export const TRAVELER_CARDS = TRAVELERS.map((t) => {
|
|
246
|
-
const trip = tripByContact[t.Id];
|
|
247
|
-
const flight = flightByContact[t.Id];
|
|
248
|
-
const hotel = hotelByContact[t.Id];
|
|
249
|
-
return {
|
|
250
|
-
id: t.Id,
|
|
251
|
-
name: `${t.FirstName} ${t.LastName}`,
|
|
252
|
-
department: t.Department,
|
|
253
|
-
origin: trip?.Origin_City__c ?? "",
|
|
254
|
-
destination: trip?.Destination_City__c ?? "",
|
|
255
|
-
flight: flight?.Flight_Number__c ?? "",
|
|
256
|
-
hotel: hotel?.Hotel_Name__c ?? "",
|
|
257
|
-
return: trip?.End_Date__c
|
|
258
|
-
? new Date(trip.End_Date__c).toLocaleDateString("en-US", {
|
|
259
|
-
month: "short",
|
|
260
|
-
day: "numeric",
|
|
261
|
-
})
|
|
262
|
-
: "",
|
|
263
|
-
policyStatus: trip?.In_Policy__c ? "compliant" : "exception",
|
|
264
|
-
};
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
// ─── DISRUPTION CARDS ───────────────────────────────────────────────────────
|
|
268
|
-
export const DISRUPTION_CARDS = DISRUPTIONS.map((d) => {
|
|
269
|
-
const flight = FLIGHTS.find((f) => f.Id === d.Impacted_Flight__c);
|
|
270
|
-
const traveler = flight
|
|
271
|
-
? travelerByContactId[flight.Contact__c]
|
|
272
|
-
: null;
|
|
273
|
-
return {
|
|
274
|
-
id: d.Id,
|
|
275
|
-
flight: d.Flight_Number__c,
|
|
276
|
-
route: flight
|
|
277
|
-
? `${flight.Departure_Airport__c} → ${flight.Arrival_Airport__c}`
|
|
278
|
-
: d.City__c,
|
|
279
|
-
traveler: traveler
|
|
280
|
-
? `${traveler.FirstName} ${traveler.LastName}`
|
|
281
|
-
: "Multiple travelers",
|
|
282
|
-
severity:
|
|
283
|
-
d.Severity__c === "Critical" || d.Severity__c === "High"
|
|
284
|
-
? "grounded"
|
|
285
|
-
: "delayed",
|
|
286
|
-
delayMin:
|
|
287
|
-
flight?.Delay_Minutes__c ??
|
|
288
|
-
(d.Severity__c === "Critical" ? 120 : 70),
|
|
289
|
-
reason: d.Description__c,
|
|
290
|
-
evaAction: d.Recommended_Action__c,
|
|
291
|
-
};
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
// ─── EVA ACTIVITY FEED ──────────────────────────────────────────────────────
|
|
295
|
-
const NOW = new Date("2026-03-25T15:00:00Z").getTime();
|
|
296
|
-
|
|
297
|
-
function relativeTime(iso) {
|
|
298
|
-
const diff = NOW - new Date(iso).getTime();
|
|
299
|
-
const min = Math.round(diff / 60000);
|
|
300
|
-
if (min < 60) return `${min} min ago`;
|
|
301
|
-
const hr = (min / 60).toFixed(1);
|
|
302
|
-
return `${hr} hr ago`;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
export const EVA_ACTIONS = REBOOKING_ACTIONS.map((r) => {
|
|
306
|
-
const parts = r.Notes__c.split(" — ");
|
|
307
|
-
return {
|
|
308
|
-
id: r.Id,
|
|
309
|
-
title: parts[0] ?? r.Notes__c,
|
|
310
|
-
subtitle: parts[1] ?? "",
|
|
311
|
-
status:
|
|
312
|
-
r.Status__c === "Completed"
|
|
313
|
-
? "complete"
|
|
314
|
-
: r.Action_Type__c === "Escalation"
|
|
315
|
-
? "pending"
|
|
316
|
-
: "working",
|
|
317
|
-
timestamp: relativeTime(r.Created_DateTime__c),
|
|
318
|
-
};
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
export const ESCALATION_CARDS = EVA_ACTIONS;
|
|
322
|
-
|
|
323
|
-
// ─── BOOKING TABLE ──────────────────────────────────────────────────────────
|
|
324
|
-
export const BOOKING_ROWS = BOOKINGS.map((b) => ({
|
|
325
|
-
id: b.Id,
|
|
326
|
-
traveler: b._travelerName,
|
|
327
|
-
type: b.Booking_Type__c,
|
|
328
|
-
destination: b._destination,
|
|
329
|
-
dates: b._dates,
|
|
330
|
-
cost: `$${b.Cost__c.toLocaleString()}`,
|
|
331
|
-
status: b.Status__c,
|
|
332
|
-
policy: b.In_Policy__c
|
|
333
|
-
? "In policy"
|
|
334
|
-
: b.Cost__c > 2000
|
|
335
|
-
? "Over budget"
|
|
336
|
-
: "Exception granted",
|
|
337
|
-
}));
|
|
338
|
-
|
|
339
|
-
// ─── POLICY STATUS ITEMS ────────────────────────────────────────────────────
|
|
340
|
-
export const POLICY_ITEMS = TRAVEL_POLICIES.map((p) => ({
|
|
341
|
-
id: p.Id,
|
|
342
|
-
title: p.Name,
|
|
343
|
-
description: p.Description__c,
|
|
344
|
-
status: p._health,
|
|
345
|
-
timestamp: p._lastEvaluated,
|
|
346
|
-
}));
|
|
347
|
-
|
|
348
|
-
// ─── CHART DATA ─────────────────────────────────────────────────────────────
|
|
349
|
-
export const DESTINATION_CHART_DATA = Object.entries(
|
|
350
|
-
TRIPS.reduce((acc, t) => {
|
|
351
|
-
acc[t.Destination_City__c] = (acc[t.Destination_City__c] || 0) + 1;
|
|
352
|
-
return acc;
|
|
353
|
-
}, {})
|
|
354
|
-
).map(([city, count]) => ({ x: city, travelers: count }));
|
|
355
|
-
|
|
356
|
-
export const SPEND_CHART_DATA = MONTHLY_SPEND.map((m) => ({
|
|
357
|
-
x: m.month,
|
|
358
|
-
y: m.amount,
|
|
359
|
-
}));
|
|
360
|
-
|
|
361
|
-
// ─── COMPUTED METRICS ───────────────────────────────────────────────────────
|
|
362
|
-
export const METRICS = {
|
|
363
|
-
activeTravelers: TRAVELERS.length,
|
|
364
|
-
spendMTD: MONTHLY_SPEND.find((m) => m.month === "Mar")?.amount ?? 0,
|
|
365
|
-
complianceRate: Math.round(
|
|
366
|
-
(TRIPS.filter((t) => t.In_Policy__c).length / TRIPS.length) * 100
|
|
367
|
-
),
|
|
368
|
-
evaResolutionRate: Math.round(
|
|
369
|
-
(REBOOKING_ACTIONS.filter((r) => r.Status__c === "Completed").length /
|
|
370
|
-
REBOOKING_ACTIONS.length) *
|
|
371
|
-
100
|
|
372
|
-
),
|
|
373
|
-
evaResolved: REBOOKING_ACTIONS.filter((r) => r.Status__c === "Completed")
|
|
374
|
-
.length,
|
|
375
|
-
pendingBookings: BOOKINGS.filter(
|
|
376
|
-
(b) => b.Status__c === "Pending approval"
|
|
377
|
-
).length,
|
|
378
|
-
};
|
|
Binary file
|