@schandlergarcia/sf-web-components 2.1.0 → 2.2.1

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.
@@ -0,0 +1,191 @@
1
+ /**
2
+ * Engine Partner Hub — Sample Data
3
+ *
4
+ * Field names match the Salesforce org schema (Property__c, Contract__c,
5
+ * Invoice__c, Attrition_Penalty__c, etc.) so switching from sample → live
6
+ * Data Cloud queries requires only a data-source swap, not a field-name refactor.
7
+ *
8
+ * Each section exports both the raw records AND dashboard-ready derivatives
9
+ * (KPI metrics, chart data, formatted card items).
10
+ */
11
+
12
+ // ─── PARTNERS (Account with RecordType = Hotel_Partner) ────────────────────
13
+ export const PARTNERS = [
14
+ { Id: "001P1", Name: "Marriott International", Partner_Tier__c: "Gold", Commission_Rate__c: 18, Partner_Status__c: "Active", Total_Properties__c: 5, Total_Reservations__c: 12, Total_Revenue__c: 284000, Contract_Start_Date__c: "2025-01-01", Contract_End_Date__c: "2026-12-31" },
15
+ { Id: "001P2", Name: "Hilton Hotels Corporation", Partner_Tier__c: "Gold", Commission_Rate__c: 17, Partner_Status__c: "Active", Total_Properties__c: 4, Total_Reservations__c: 10, Total_Revenue__c: 238000, Contract_Start_Date__c: "2025-03-01", Contract_End_Date__c: "2027-02-28" },
16
+ { Id: "001P3", Name: "Hyatt Hotels Corporation", Partner_Tier__c: "Silver", Commission_Rate__c: 15, Partner_Status__c: "Active", Total_Properties__c: 3, Total_Reservations__c: 8, Total_Revenue__c: 156000, Contract_Start_Date__c: "2025-06-01", Contract_End_Date__c: "2026-05-31" },
17
+ { Id: "001P4", Name: "InterContinental Hotels Group", Partner_Tier__c: "Gold", Commission_Rate__c: 16, Partner_Status__c: "Active", Total_Properties__c: 4, Total_Reservations__c: 7, Total_Revenue__c: 198000, Contract_Start_Date__c: "2025-04-01", Contract_End_Date__c: "2027-03-31" },
18
+ { Id: "001P5", Name: "Wyndham Hotels & Resorts", Partner_Tier__c: "Silver", Commission_Rate__c: 14, Partner_Status__c: "Active", Total_Properties__c: 3, Total_Reservations__c: 5, Total_Revenue__c: 112000, Contract_Start_Date__c: "2025-07-01", Contract_End_Date__c: "2026-06-30" },
19
+ { Id: "001P6", Name: "Best Western Hotels", Partner_Tier__c: "Bronze", Commission_Rate__c: 12, Partner_Status__c: "Active", Total_Properties__c: 2, Total_Reservations__c: 3, Total_Revenue__c: 64000, Contract_Start_Date__c: "2025-09-01", Contract_End_Date__c: "2026-08-31" },
20
+ { Id: "001P7", Name: "Four Seasons Hotels", Partner_Tier__c: "Gold", Commission_Rate__c: 20, Partner_Status__c: "Active", Total_Properties__c: 3, Total_Reservations__c: 4, Total_Revenue__c: 312000, Contract_Start_Date__c: "2025-02-01", Contract_End_Date__c: "2027-01-31" },
21
+ { Id: "001P8", Name: "Radisson Hotel Group", Partner_Tier__c: "Silver", Commission_Rate__c: 13, Partner_Status__c: "Active", Total_Properties__c: 3, Total_Reservations__c: 4, Total_Revenue__c: 89000, Contract_Start_Date__c: "2025-05-01", Contract_End_Date__c: "2026-04-30" },
22
+ { Id: "001P9", Name: "Accor Hotels", Partner_Tier__c: "Silver", Commission_Rate__c: 14, Partner_Status__c: "Pending", Total_Properties__c: 2, Total_Reservations__c: 0, Total_Revenue__c: 0, Contract_Start_Date__c: "2026-04-01", Contract_End_Date__c: "2027-03-31" },
23
+ { Id: "001P10", Name: "Choice Hotels International", Partner_Tier__c: "Bronze", Commission_Rate__c: 11, Partner_Status__c: "Active", Total_Properties__c: 2, Total_Reservations__c: 2, Total_Revenue__c: 42000, Contract_Start_Date__c: "2025-10-01", Contract_End_Date__c: "2026-09-30" },
24
+ { Id: "001P11", Name: "Omni Hotels & Resorts", Partner_Tier__c: "Silver", Commission_Rate__c: 15, Partner_Status__c: "Active", Total_Properties__c: 2, Total_Reservations__c: 3, Total_Revenue__c: 97000, Contract_Start_Date__c: "2025-08-01", Contract_End_Date__c: "2026-07-31" },
25
+ { Id: "001P12", Name: "Loews Hotels & Co", Partner_Tier__c: "Bronze", Commission_Rate__c: 12, Partner_Status__c: "Inactive", Total_Properties__c: 1, Total_Reservations__c: 1, Total_Revenue__c: 28000, Contract_Start_Date__c: "2024-06-01", Contract_End_Date__c: "2025-05-31" },
26
+ ];
27
+
28
+ // ─── CONTRACTS ──────────────────────────────────────────────────────────────
29
+ export const CONTRACTS = [
30
+ { Id: "a10C1", Name: "CNTR-00001", Account__c: "001P1", Partner_Name: "Marriott International", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 80, Resale_Credit_Policy__c: "Full Credit", Resale_Credit_Percentage__c: 100, Commission_Rate__c: 18, Start_Date__c: "2025-01-01", End_Date__c: "2026-12-31" },
31
+ { Id: "a10C2", Name: "CNTR-00002", Account__c: "001P2", Partner_Name: "Hilton Hotels Corporation", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 80, Resale_Credit_Policy__c: "Partial Credit", Resale_Credit_Percentage__c: 50, Commission_Rate__c: 17, Start_Date__c: "2025-03-01", End_Date__c: "2027-02-28" },
32
+ { Id: "a10C3", Name: "CNTR-00003", Account__c: "001P3", Partner_Name: "Hyatt Hotels Corporation", Status__c: "Active", Attrition_Calculation_Method__c: "Cumulative", Attrition_Threshold_Percentage__c: 75, Resale_Credit_Policy__c: "Partial Credit", Resale_Credit_Percentage__c: 50, Commission_Rate__c: 15, Start_Date__c: "2025-06-01", End_Date__c: "2026-05-31" },
33
+ { Id: "a10C4", Name: "CNTR-00004", Account__c: "001P4", Partner_Name: "InterContinental Hotels Group", Status__c: "Active", Attrition_Calculation_Method__c: "Revenue Based", Attrition_Threshold_Percentage__c: 70, Resale_Credit_Policy__c: "No Credit", Resale_Credit_Percentage__c: 0, Commission_Rate__c: 16, Start_Date__c: "2025-04-01", End_Date__c: "2027-03-31" },
34
+ { Id: "a10C5", Name: "CNTR-00005", Account__c: "001P5", Partner_Name: "Wyndham Hotels & Resorts", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 85, Resale_Credit_Policy__c: "Full Credit", Resale_Credit_Percentage__c: 100, Commission_Rate__c: 14, Start_Date__c: "2025-07-01", End_Date__c: "2026-06-30" },
35
+ { Id: "a10C6", Name: "CNTR-00006", Account__c: "001P6", Partner_Name: "Best Western Hotels", Status__c: "Active", Attrition_Calculation_Method__c: "Cumulative", Attrition_Threshold_Percentage__c: 70, Resale_Credit_Policy__c: "No Credit", Resale_Credit_Percentage__c: 0, Commission_Rate__c: 12, Start_Date__c: "2025-09-01", End_Date__c: "2026-08-31" },
36
+ { Id: "a10C7", Name: "CNTR-00007", Account__c: "001P7", Partner_Name: "Four Seasons Hotels", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 90, Resale_Credit_Policy__c: "Full Credit", Resale_Credit_Percentage__c: 100, Commission_Rate__c: 20, Start_Date__c: "2025-02-01", End_Date__c: "2027-01-31" },
37
+ { Id: "a10C8", Name: "CNTR-00008", Account__c: "001P8", Partner_Name: "Radisson Hotel Group", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 80, Resale_Credit_Policy__c: "Partial Credit", Resale_Credit_Percentage__c: 50, Commission_Rate__c: 13, Start_Date__c: "2025-05-01", End_Date__c: "2026-04-30" },
38
+ { Id: "a10C9", Name: "CNTR-00009", Account__c: "001P9", Partner_Name: "Accor Hotels", Status__c: "Active", Attrition_Calculation_Method__c: "Revenue Based", Attrition_Threshold_Percentage__c: 75, Resale_Credit_Policy__c: "Partial Credit", Resale_Credit_Percentage__c: 50, Commission_Rate__c: 14, Start_Date__c: "2026-04-01", End_Date__c: "2027-03-31" },
39
+ { Id: "a10C10", Name: "CNTR-00010", Account__c: "001P10", Partner_Name: "Choice Hotels International", Status__c: "Active", Attrition_Calculation_Method__c: "Cumulative", Attrition_Threshold_Percentage__c: 70, Resale_Credit_Policy__c: "No Credit", Resale_Credit_Percentage__c: 0, Commission_Rate__c: 11, Start_Date__c: "2025-10-01", End_Date__c: "2026-09-30" },
40
+ { Id: "a10C11", Name: "CNTR-00011", Account__c: "001P11", Partner_Name: "Omni Hotels & Resorts", Status__c: "Active", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 80, Resale_Credit_Policy__c: "Full Credit", Resale_Credit_Percentage__c: 100, Commission_Rate__c: 15, Start_Date__c: "2025-08-01", End_Date__c: "2026-07-31" },
41
+ { Id: "a10C12", Name: "CNTR-00012", Account__c: "001P12", Partner_Name: "Loews Hotels & Co", Status__c: "Expired", Attrition_Calculation_Method__c: "Per Night", Attrition_Threshold_Percentage__c: 80, Resale_Credit_Policy__c: "No Credit", Resale_Credit_Percentage__c: 0, Commission_Rate__c: 12, Start_Date__c: "2024-06-01", End_Date__c: "2025-05-31" },
42
+ ];
43
+
44
+ // ─── INVOICES ───────────────────────────────────────────────────────────────
45
+ export const INVOICES = [
46
+ { Id: "a20I1", Name: "INV-00001", Account__c: "001P1", Partner_Name: "Marriott International", Status__c: "Paid", Invoice_Date__c: "2026-01-15", Due_Date__c: "2026-02-15", Period_Start__c: "2025-12-01", Period_End__c: "2025-12-31", Total_Amount__c: 24500, Commission_Amount__c: 4410 },
47
+ { Id: "a20I2", Name: "INV-00002", Account__c: "001P2", Partner_Name: "Hilton Hotels Corporation", Status__c: "Paid", Invoice_Date__c: "2026-01-15", Due_Date__c: "2026-02-15", Period_Start__c: "2025-12-01", Period_End__c: "2025-12-31", Total_Amount__c: 19800, Commission_Amount__c: 3366 },
48
+ { Id: "a20I3", Name: "INV-00003", Account__c: "001P3", Partner_Name: "Hyatt Hotels Corporation", Status__c: "Paid", Invoice_Date__c: "2026-01-15", Due_Date__c: "2026-02-15", Period_Start__c: "2025-12-01", Period_End__c: "2025-12-31", Total_Amount__c: 13200, Commission_Amount__c: 1980 },
49
+ { Id: "a20I4", Name: "INV-00004", Account__c: "001P1", Partner_Name: "Marriott International", Status__c: "Paid", Invoice_Date__c: "2026-02-15", Due_Date__c: "2026-03-15", Period_Start__c: "2026-01-01", Period_End__c: "2026-01-31", Total_Amount__c: 27200, Commission_Amount__c: 4896 },
50
+ { Id: "a20I5", Name: "INV-00005", Account__c: "001P2", Partner_Name: "Hilton Hotels Corporation", Status__c: "Paid", Invoice_Date__c: "2026-02-15", Due_Date__c: "2026-03-15", Period_Start__c: "2026-01-01", Period_End__c: "2026-01-31", Total_Amount__c: 21400, Commission_Amount__c: 3638 },
51
+ { Id: "a20I6", Name: "INV-00006", Account__c: "001P4", Partner_Name: "InterContinental Hotels Group", Status__c: "Paid", Invoice_Date__c: "2026-02-15", Due_Date__c: "2026-03-15", Period_Start__c: "2026-01-01", Period_End__c: "2026-01-31", Total_Amount__c: 18600, Commission_Amount__c: 2976 },
52
+ { Id: "a20I7", Name: "INV-00007", Account__c: "001P1", Partner_Name: "Marriott International", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 26800, Commission_Amount__c: 4824 },
53
+ { Id: "a20I8", Name: "INV-00008", Account__c: "001P2", Partner_Name: "Hilton Hotels Corporation", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 22100, Commission_Amount__c: 3757 },
54
+ { Id: "a20I9", Name: "INV-00009", Account__c: "001P3", Partner_Name: "Hyatt Hotels Corporation", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 14800, Commission_Amount__c: 2220 },
55
+ { Id: "a20I10", Name: "INV-00010", Account__c: "001P4", Partner_Name: "InterContinental Hotels Group", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 17200, Commission_Amount__c: 2752 },
56
+ { Id: "a20I11", Name: "INV-00011", Account__c: "001P5", Partner_Name: "Wyndham Hotels & Resorts", Status__c: "Overdue", Invoice_Date__c: "2026-02-15", Due_Date__c: "2026-03-15", Period_Start__c: "2026-01-01", Period_End__c: "2026-01-31", Total_Amount__c: 9400, Commission_Amount__c: 1316 },
57
+ { Id: "a20I12", Name: "INV-00012", Account__c: "001P6", Partner_Name: "Best Western Hotels", Status__c: "Overdue", Invoice_Date__c: "2026-02-15", Due_Date__c: "2026-03-15", Period_Start__c: "2026-01-01", Period_End__c: "2026-01-31", Total_Amount__c: 5200, Commission_Amount__c: 624 },
58
+ { Id: "a20I13", Name: "INV-00013", Account__c: "001P7", Partner_Name: "Four Seasons Hotels", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 31200, Commission_Amount__c: 6240 },
59
+ { Id: "a20I14", Name: "INV-00014", Account__c: "001P8", Partner_Name: "Radisson Hotel Group", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 8900, Commission_Amount__c: 1157 },
60
+ { Id: "a20I15", Name: "INV-00015", Account__c: "001P5", Partner_Name: "Wyndham Hotels & Resorts", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 10800, Commission_Amount__c: 1512 },
61
+ { Id: "a20I16", Name: "INV-00016", Account__c: "001P10", Partner_Name: "Choice Hotels International", Status__c: "Sent", Invoice_Date__c: "2026-03-15", Due_Date__c: "2026-04-15", Period_Start__c: "2026-02-01", Period_End__c: "2026-02-28", Total_Amount__c: 4200, Commission_Amount__c: 462 },
62
+ { Id: "a20I17", Name: "INV-00017", Account__c: "001P11", Partner_Name: "Omni Hotels & Resorts", Status__c: "Draft", Invoice_Date__c: "2026-04-01", Due_Date__c: "2026-05-01", Period_Start__c: "2026-03-01", Period_End__c: "2026-03-31", Total_Amount__c: 11400, Commission_Amount__c: 1710 },
63
+ ];
64
+
65
+ // ─── ATTRITION PENALTIES ────────────────────────────────────────────────────
66
+ export const ATTRITION_PENALTIES = [
67
+ { Id: "a30A1", Name: "ATR-00001", Partner_Name: "Hilton Hotels Corporation", Property_Name: "Hilton Austin Convention Center Hotel", Contract__c: "a10C2", Customer_Name: "TechCorp Inc.", Status__c: "Approved", Original_Room_Block__c: 50, Actual_Rooms_Used__c: 35, Unused_Rooms__c: 15, Room_Rate__c: 200, Number_of_Nights__c: 3, Rooms_Resold__c: 8, Penalty_Amount_Calculated__c: 9000, Resale_Credit_Applied__c: 0, Final_Penalty_Amount__c: 9000, Calculation_Method: "Per Night", Resale_Policy: "Partial Credit (50%)", Is_Hero: true },
68
+ { Id: "a30A2", Name: "ATR-00002", Partner_Name: "Hyatt Hotels Corporation", Property_Name: "Hyatt Regency Chicago", Contract__c: "a10C3", Customer_Name: "GlobalTech Ltd.", Status__c: "Reviewed", Original_Room_Block__c: 30, Actual_Rooms_Used__c: 22, Unused_Rooms__c: 8, Room_Rate__c: 250, Number_of_Nights__c: 2, Rooms_Resold__c: 5, Penalty_Amount_Calculated__c: 4000, Resale_Credit_Applied__c: 1250, Final_Penalty_Amount__c: 2750, Calculation_Method: "Cumulative", Resale_Policy: "Partial Credit (50%)" },
69
+ { Id: "a30A3", Name: "ATR-00003", Partner_Name: "Marriott International", Property_Name: "Marriott Marquis NYC", Contract__c: "a10C1", Customer_Name: "Acme Corp.", Status__c: "Approved", Original_Room_Block__c: 40, Actual_Rooms_Used__c: 30, Unused_Rooms__c: 10, Room_Rate__c: 300, Number_of_Nights__c: 2, Rooms_Resold__c: 4, Penalty_Amount_Calculated__c: 6000, Resale_Credit_Applied__c: 2400, Final_Penalty_Amount__c: 3600, Calculation_Method: "Per Night", Resale_Policy: "Full Credit" },
70
+ { Id: "a30A4", Name: "ATR-00004", Partner_Name: "InterContinental Hotels Group", Property_Name: "InterContinental San Francisco", Contract__c: "a10C4", Customer_Name: "StartupX Inc.", Status__c: "Calculated", Original_Room_Block__c: 25, Actual_Rooms_Used__c: 18, Unused_Rooms__c: 7, Room_Rate__c: 275, Number_of_Nights__c: 1, Rooms_Resold__c: 3, Penalty_Amount_Calculated__c: 1925, Resale_Credit_Applied__c: 0, Final_Penalty_Amount__c: 1925, Calculation_Method: "Revenue Based", Resale_Policy: "No Credit" },
71
+ { Id: "a30A5", Name: "ATR-00005", Partner_Name: "Wyndham Hotels & Resorts", Property_Name: "Wyndham Grand Orlando", Contract__c: "a10C5", Customer_Name: "MediaCo LLC", Status__c: "Disputed", Original_Room_Block__c: 20, Actual_Rooms_Used__c: 14, Unused_Rooms__c: 6, Room_Rate__c: 150, Number_of_Nights__c: 2, Rooms_Resold__c: 4, Penalty_Amount_Calculated__c: 1800, Resale_Credit_Applied__c: 1200, Final_Penalty_Amount__c: 600, Calculation_Method: "Per Night", Resale_Policy: "Full Credit" },
72
+ { Id: "a30A6", Name: "ATR-00006", Partner_Name: "Radisson Hotel Group", Property_Name: "Radisson Blu Aqua Chicago", Contract__c: "a10C8", Customer_Name: "FinanceFirst Corp.", Status__c: "Approved", Original_Room_Block__c: 35, Actual_Rooms_Used__c: 25, Unused_Rooms__c: 10, Room_Rate__c: 175, Number_of_Nights__c: 2, Rooms_Resold__c: 3, Penalty_Amount_Calculated__c: 3500, Resale_Credit_Applied__c: 525, Final_Penalty_Amount__c: 2975, Calculation_Method: "Per Night", Resale_Policy: "Partial Credit (50%)" },
73
+ ];
74
+
75
+ // ─── DISPUTES (Case with RecordType = Partner_Dispute) ──────────────────────
76
+ export const DISPUTES = [
77
+ { Id: "500D1", CaseNumber: "00001045", Subject: "ATR-00001 — Resale credit not applied", Partner_Name: "Hilton Hotels Corporation", Dispute_Type__c: "Resale Credit", Disputed_Amount__c: 2400, Status: "Open", Priority: "High", Agent_Handled__c: true, CreatedDate: "2026-04-02", Escalation_Reason__c: "$2,400 Partial Credit for 8 resold rooms was never applied to ATR-00001" },
78
+ { Id: "500D2", CaseNumber: "00001038", Subject: "ATR-00005 — Penalty exceeds contract terms", Partner_Name: "Wyndham Hotels & Resorts", Dispute_Type__c: "Attrition Calculation", Disputed_Amount__c: 1200, Status: "Open", Priority: "Medium", Agent_Handled__c: false, CreatedDate: "2026-03-28", Escalation_Reason__c: "Partner claims full resale credit was not applied correctly" },
79
+ { Id: "500D3", CaseNumber: "00001032", Subject: "INV-00011 — Commission rate discrepancy", Partner_Name: "Wyndham Hotels & Resorts", Dispute_Type__c: "Commission Rate", Disputed_Amount__c: 470, Status: "Open", Priority: "Low", Agent_Handled__c: false, CreatedDate: "2026-03-22", Escalation_Reason__c: "Invoice shows 12% rate but contract specifies 14%" },
80
+ { Id: "500D4", CaseNumber: "00001025", Subject: "INV-00006 — Duplicate line items", Partner_Name: "InterContinental Hotels Group", Dispute_Type__c: "Invoice Amount", Disputed_Amount__c: 2976, Status: "Resolved", Priority: "High", Agent_Handled__c: true, CreatedDate: "2026-03-15", Escalation_Reason__c: "Duplicate commission line items on January invoice" },
81
+ { Id: "500D5", CaseNumber: "00001018", Subject: "ATR-00002 — Threshold not met", Partner_Name: "Hyatt Hotels Corporation", Dispute_Type__c: "Attrition Calculation", Disputed_Amount__c: 2750, Status: "Resolved", Priority: "Medium", Agent_Handled__c: true, CreatedDate: "2026-03-10", Escalation_Reason__c: "Usage was 73% (below 75% threshold) — cumulative method applies" },
82
+ { Id: "500D6", CaseNumber: "00001010", Subject: "General — Contract renewal terms", Partner_Name: "Omni Hotels & Resorts", Dispute_Type__c: "Other", Disputed_Amount__c: 0, Status: "Open", Priority: "Low", Agent_Handled__c: false, CreatedDate: "2026-03-05", Escalation_Reason__c: "Partner requesting revised commission rate for renewal" },
83
+ { Id: "500D7", CaseNumber: "00001005", Subject: "ATR-00004 — Revenue-based method questioned", Partner_Name: "InterContinental Hotels Group", Dispute_Type__c: "Attrition Calculation", Disputed_Amount__c: 1925, Status: "Escalated", Priority: "High", Agent_Handled__c: true, CreatedDate: "2026-02-28", Escalation_Reason__c: "Partner disagrees with revenue-based calculation — wants per-night method" },
84
+ ];
85
+
86
+ // ─── RECENT ACTIVITY (for ActivityCard / FeedPanel) ─────────────────────────
87
+ export const RECENT_ACTIVITY = [
88
+ { id: "act-1", title: "Penalty Dispute Created", description: "Agent flagged $2,400 missing resale credit on ATR-00001", status: "alert", timestamp: "2 hours ago", partner: "Hilton Hotels Corporation" },
89
+ { id: "act-2", title: "Invoice Sent", description: "INV-00013 sent to Four Seasons Hotels ($31,200)", status: "info", timestamp: "4 hours ago", partner: "Four Seasons Hotels" },
90
+ { id: "act-3", title: "Contract Renewed", description: "CNTR-00007 renewed through Jan 2027", status: "success", timestamp: "1 day ago", partner: "Four Seasons Hotels" },
91
+ { id: "act-4", title: "Dispute Resolved", description: "Case #00001025 — duplicate line items corrected on INV-00006", status: "success", timestamp: "1 day ago", partner: "InterContinental Hotels Group" },
92
+ { id: "act-5", title: "Overdue Invoice Alert", description: "INV-00011 past due — $9,400 outstanding since Mar 15", status: "warning", timestamp: "2 days ago", partner: "Wyndham Hotels & Resorts" },
93
+ { id: "act-6", title: "New Partner Onboarding", description: "Accor Hotels contract signed — pending property setup", status: "info", timestamp: "3 days ago", partner: "Accor Hotels" },
94
+ { id: "act-7", title: "Attrition Penalty Calculated", description: "ATR-00004 calculated at $1,925 (revenue-based method)", status: "info", timestamp: "4 days ago", partner: "InterContinental Hotels Group" },
95
+ { id: "act-8", title: "Dispute Escalated", description: "Case #00001005 escalated — IHG disputes revenue-based calculation", status: "alert", timestamp: "5 days ago", partner: "InterContinental Hotels Group" },
96
+ ];
97
+
98
+ // ─── DASHBOARD-READY DERIVATIVES ────────────────────────────────────────────
99
+
100
+ // KPI metrics
101
+ const activePartners = PARTNERS.filter(p => p.Partner_Status__c === "Active").length;
102
+ const totalRevenue = PARTNERS.reduce((sum, p) => sum + p.Total_Revenue__c, 0);
103
+ const openDisputes = DISPUTES.filter(d => d.Status === "Open" || d.Status === "Escalated").length;
104
+ const overdueInvoices = INVOICES.filter(i => i.Status__c === "Overdue").length;
105
+ const totalPenalties = ATTRITION_PENALTIES.reduce((sum, p) => sum + p.Final_Penalty_Amount__c, 0);
106
+ const avgCommission = (PARTNERS.filter(p => p.Partner_Status__c === "Active").reduce((sum, p) => sum + p.Commission_Rate__c, 0) / activePartners).toFixed(1);
107
+
108
+ export const METRICS = {
109
+ activePartners,
110
+ totalRevenue,
111
+ openDisputes,
112
+ overdueInvoices,
113
+ totalPenalties,
114
+ avgCommission,
115
+ totalProperties: PARTNERS.reduce((sum, p) => sum + p.Total_Properties__c, 0),
116
+ totalReservations: PARTNERS.reduce((sum, p) => sum + p.Total_Reservations__c, 0),
117
+ };
118
+
119
+ // Partner tier breakdown (for ChartCard — pie or bar)
120
+ export const PARTNER_TIER_CHART = [
121
+ { label: "Gold", value: PARTNERS.filter(p => p.Partner_Tier__c === "Gold").length, color: "#FFC107" },
122
+ { label: "Silver", value: PARTNERS.filter(p => p.Partner_Tier__c === "Silver").length, color: "#90A4AE" },
123
+ { label: "Bronze", value: PARTNERS.filter(p => p.Partner_Tier__c === "Bronze").length, color: "#CD7F32" },
124
+ ];
125
+
126
+ // Revenue by partner (for ChartCard — horizontal bar)
127
+ export const REVENUE_BY_PARTNER = PARTNERS
128
+ .filter(p => p.Total_Revenue__c > 0)
129
+ .sort((a, b) => b.Total_Revenue__c - a.Total_Revenue__c)
130
+ .map(p => ({ label: p.Name, value: p.Total_Revenue__c }));
131
+
132
+ // Monthly invoice trend (for ChartCard — line/area)
133
+ export const INVOICE_TREND = [
134
+ { month: "Dec 2025", total: 57500, commission: 9756 },
135
+ { month: "Jan 2026", total: 76600, commission: 12826 },
136
+ { month: "Feb 2026", total: 143400, commission: 22422 },
137
+ { month: "Mar 2026", total: 11400, commission: 1710 },
138
+ ];
139
+
140
+ // Attrition penalties for TableCard
141
+ export const PENALTY_TABLE_ITEMS = ATTRITION_PENALTIES.map(p => ({
142
+ id: p.Id,
143
+ name: p.Name,
144
+ partner: p.Partner_Name,
145
+ property: p.Property_Name,
146
+ customer: p.Customer_Name,
147
+ status: p.Status__c,
148
+ penalty: p.Final_Penalty_Amount__c,
149
+ credit: p.Resale_Credit_Applied__c,
150
+ method: p.Calculation_Method,
151
+ isHero: p.Is_Hero,
152
+ }));
153
+
154
+ // Dispute cards for ListCard
155
+ export const DISPUTE_CARDS = DISPUTES.filter(d => d.Status !== "Resolved").map(d => ({
156
+ id: d.Id,
157
+ title: d.Subject,
158
+ description: `${d.Partner_Name} · ${d.Dispute_Type__c}`,
159
+ status: d.Priority === "High" ? "critical" : d.Priority === "Medium" ? "warning" : "info",
160
+ badge: d.Status,
161
+ amount: d.Disputed_Amount__c,
162
+ agentHandled: d.Agent_Handled__c,
163
+ }));
164
+
165
+ // Invoice cards for ListCard
166
+ export const INVOICE_CARDS = INVOICES.filter(i => i.Status__c !== "Paid").map(i => ({
167
+ id: i.Id,
168
+ title: `${i.Name} — ${i.Partner_Name}`,
169
+ description: `${i.Period_Start__c} to ${i.Period_End__c}`,
170
+ status: i.Status__c === "Overdue" ? "critical" : i.Status__c === "Draft" ? "info" : "default",
171
+ badge: i.Status__c,
172
+ amount: i.Total_Amount__c,
173
+ due: i.Due_Date__c,
174
+ }));
175
+
176
+ // Contract expiration (upcoming 6 months)
177
+ export const EXPIRING_CONTRACTS = CONTRACTS
178
+ .filter(c => {
179
+ const end = new Date(c.End_Date__c);
180
+ const now = new Date("2026-04-01");
181
+ const sixMonths = new Date("2026-10-01");
182
+ return c.Status__c === "Active" && end >= now && end <= sixMonths;
183
+ })
184
+ .sort((a, b) => new Date(a.End_Date__c) - new Date(b.End_Date__c))
185
+ .map(c => ({
186
+ id: c.Id,
187
+ title: `${c.Name} — ${c.Partner_Name}`,
188
+ description: `Expires ${c.End_Date__c} · ${c.Attrition_Calculation_Method__c} · ${c.Resale_Credit_Policy__c}`,
189
+ status: "warning",
190
+ badge: c.End_Date__c,
191
+ }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schandlergarcia/sf-web-components",
3
- "version": "2.1.0",
3
+ "version": "2.2.1",
4
4
  "description": "Reusable Salesforce web components library with Tailwind CSS v4 and shadcn/ui",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -102,6 +102,7 @@ if (fs.existsSync(brandCSS)) {
102
102
  const dataFiles = [
103
103
  { src: 'engine-sample-data.js', dst: 'src/data/engine-sample-data.js' },
104
104
  { src: 'engine-live-data.js', dst: 'src/data/engine-live-data.js' },
105
+ { src: 'partner-hub-sample-data.js', dst: 'src/data/partner-hub-sample-data.js' },
105
106
  ];
106
107
  for (const { src, dst } of dataFiles) {
107
108
  const srcPath = path.join(brandDir, src);
@@ -145,11 +146,11 @@ for (const { src, dst } of configs) {
145
146
  }
146
147
  }
147
148
 
148
- // 5. PRD → project root
149
- const prd = path.join(brandDir, 'engine-command-center-prd.md');
150
- if (fs.existsSync(prd)) {
151
- fs.copyFileSync(prd, path.join(cwd, 'engine-command-center-prd.md'));
152
- console.log(' ✓ Installed engine-command-center-prd.md');
149
+ // 5. PRDs → project root
150
+ const prds = fs.readdirSync(brandDir).filter(f => f.endsWith('_PRD.md') || f.endsWith('-prd.md'));
151
+ for (const prdFile of prds) {
152
+ fs.copyFileSync(path.join(brandDir, prdFile), path.join(cwd, prdFile));
153
+ console.log(` ✓ Installed ${prdFile}`);
153
154
  installed++;
154
155
  }
155
156
 
@@ -335,6 +335,12 @@ if (fs.existsSync(packageJsonPath)) {
335
335
  scriptsAdded.push('validate:dashboard');
336
336
  }
337
337
 
338
+ // Add manual setup script (re-runs postinstall if it was missed)
339
+ if (!packageJson.scripts['sfwc:setup']) {
340
+ packageJson.scripts['sfwc:setup'] = 'node node_modules/@schandlergarcia/sf-web-components/scripts/postinstall.mjs';
341
+ scriptsAdded.push('sfwc:setup');
342
+ }
343
+
338
344
  // Add brand scripts
339
345
  if (!packageJson.scripts['brand:engine']) {
340
346
  packageJson.scripts['brand:engine'] = 'node node_modules/@schandlergarcia/sf-web-components/scripts/apply-brand.mjs engine';
@@ -368,7 +374,20 @@ const packageA4dRules = path.join(packageRoot, '.a4drules');
368
374
  if (fs.existsSync(packageA4dRules)) {
369
375
  console.log('\n📋 Copying AI assistant rules to project root...\n');
370
376
 
371
- const projectRootPath = path.resolve(cwd, '../../../../../');
377
+ // Walk up from cwd to find the project root (directory with package.json)
378
+ // For SFDX projects, the webapp may be nested (force-app/main/default/uiBundles/app/)
379
+ // and the SFDX root is higher up. We look for sfdx-project.json first, then fall back to cwd.
380
+ let projectRootPath = cwd;
381
+ let checkDir = cwd;
382
+ for (let i = 0; i < 10; i++) {
383
+ const parent = path.dirname(checkDir);
384
+ if (parent === checkDir) break;
385
+ if (fs.existsSync(path.join(parent, 'sfdx-project.json'))) {
386
+ projectRootPath = parent;
387
+ break;
388
+ }
389
+ checkDir = parent;
390
+ }
372
391
  const targetA4dRules = path.join(projectRootPath, '.a4drules');
373
392
 
374
393
  if (!fs.existsSync(targetA4dRules)) {
@@ -456,6 +475,7 @@ console.log(` - Installed ${templatesInstalled} page templates`);
456
475
  console.log(` - Installed ${scriptsInstalled} utility scripts`);
457
476
  console.log(` - Installed CommandCenter.tsx for dashboard management`);
458
477
  console.log(` - Added "npm run reset:command-center" script`);
478
+ console.log(` - Added "npm run sfwc:setup" script (re-run this setup anytime)`);
459
479
  console.log(` - Installed AI assistant rules (.a4drules)`);
460
480
  if (migratedFiles > 0) {
461
481
  console.log(` - Migrated ${migratedFiles} dashboard files to correct location`);