@bash-app/bash-common 30.448.0 → 30.450.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.
Files changed (61) hide show
  1. package/dist/__tests__/eventTimezoneIana.test.js +35 -5
  2. package/dist/__tests__/eventTimezoneIana.test.js.map +1 -1
  3. package/dist/__tests__/partnerBookingAgreement.test.d.ts +2 -0
  4. package/dist/__tests__/partnerBookingAgreement.test.d.ts.map +1 -0
  5. package/dist/__tests__/partnerBookingAgreement.test.js +62 -0
  6. package/dist/__tests__/partnerBookingAgreement.test.js.map +1 -0
  7. package/dist/__tests__/vendorBookingAgreement.test.d.ts +2 -0
  8. package/dist/__tests__/vendorBookingAgreement.test.d.ts.map +1 -0
  9. package/dist/__tests__/vendorBookingAgreement.test.js +32 -0
  10. package/dist/__tests__/vendorBookingAgreement.test.js.map +1 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +3 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/partnerBookingAgreement.d.ts +55 -0
  16. package/dist/partnerBookingAgreement.d.ts.map +1 -0
  17. package/dist/partnerBookingAgreement.js +251 -0
  18. package/dist/partnerBookingAgreement.js.map +1 -0
  19. package/dist/utils/__tests__/eventTimezoneIana.test.js +5 -7
  20. package/dist/utils/__tests__/eventTimezoneIana.test.js.map +1 -1
  21. package/dist/utils/__tests__/recurrenceUtils.test.js +51 -0
  22. package/dist/utils/__tests__/recurrenceUtils.test.js.map +1 -1
  23. package/dist/utils/__tests__/slugUtils.test.js +17 -0
  24. package/dist/utils/__tests__/slugUtils.test.js.map +1 -1
  25. package/dist/utils/eventTimezoneIana.d.ts +20 -5
  26. package/dist/utils/eventTimezoneIana.d.ts.map +1 -1
  27. package/dist/utils/eventTimezoneIana.js +80 -6
  28. package/dist/utils/eventTimezoneIana.js.map +1 -1
  29. package/dist/utils/recurrenceUtils.d.ts +2 -2
  30. package/dist/utils/recurrenceUtils.d.ts.map +1 -1
  31. package/dist/utils/recurrenceUtils.js +50 -32
  32. package/dist/utils/recurrenceUtils.js.map +1 -1
  33. package/dist/utils/service/__tests__/serviceUtils.test.js +5 -1
  34. package/dist/utils/service/__tests__/serviceUtils.test.js.map +1 -1
  35. package/dist/utils/service/serviceUtils.d.ts +2 -0
  36. package/dist/utils/service/serviceUtils.d.ts.map +1 -1
  37. package/dist/utils/service/serviceUtils.js +7 -0
  38. package/dist/utils/service/serviceUtils.js.map +1 -1
  39. package/dist/utils/slugUtils.d.ts.map +1 -1
  40. package/dist/utils/slugUtils.js +12 -3
  41. package/dist/utils/slugUtils.js.map +1 -1
  42. package/dist/vendorBookingAgreement.d.ts +25 -0
  43. package/dist/vendorBookingAgreement.d.ts.map +1 -0
  44. package/dist/vendorBookingAgreement.js +114 -0
  45. package/dist/vendorBookingAgreement.js.map +1 -0
  46. package/package.json +1 -1
  47. package/prisma/schema.prisma +26 -2
  48. package/src/__tests__/eventTimezoneIana.test.ts +47 -4
  49. package/src/__tests__/partnerBookingAgreement.test.ts +84 -0
  50. package/src/__tests__/vendorBookingAgreement.test.ts +53 -0
  51. package/src/index.ts +5 -0
  52. package/src/partnerBookingAgreement.ts +429 -0
  53. package/src/utils/__tests__/eventTimezoneIana.test.ts +5 -7
  54. package/src/utils/__tests__/recurrenceUtils.test.ts +54 -0
  55. package/src/utils/__tests__/slugUtils.test.ts +19 -0
  56. package/src/utils/eventTimezoneIana.ts +99 -7
  57. package/src/utils/recurrenceUtils.ts +55 -34
  58. package/src/utils/service/__tests__/serviceUtils.test.ts +10 -0
  59. package/src/utils/service/serviceUtils.ts +12 -0
  60. package/src/utils/slugUtils.ts +11 -2
  61. package/src/vendorBookingAgreement.ts +158 -0
@@ -109,6 +109,14 @@ export function parseBashUrlParams(param) {
109
109
  if (dashIndex === -1) {
110
110
  return param.length > 0 ? { id: param, slug: null } : null;
111
111
  }
112
+ const dashCount = (param.match(/-/g) ?? []).length;
113
+ if (dashCount === 1) {
114
+ const head = param.slice(0, dashIndex);
115
+ const tail = param.slice(dashIndex + 1);
116
+ if (!head)
117
+ return null;
118
+ return { id: head, slug: tail || null };
119
+ }
112
120
  const head = param.slice(0, dashIndex);
113
121
  if (!head)
114
122
  return null;
@@ -118,10 +126,11 @@ export function parseBashUrlParams(param) {
118
126
  return { id: head, slug: tail || null };
119
127
  }
120
128
  // Short legacy ids (no hyphens in head): `abc123-summer-bash`
121
- if (!head.includes("-") &&
122
- head.length >= 4 &&
129
+ if (!param.startsWith("qa-") &&
130
+ !head.includes("-") &&
131
+ head.length >= 2 &&
123
132
  head.length <= 12 &&
124
- /^[a-z0-9]+$/i.test(head)) {
133
+ /^[a-z0-9_]+$/i.test(head)) {
125
134
  return { id: head, slug: tail || null };
126
135
  }
127
136
  return { id: param, slug: null };
@@ -1 +1 @@
1
- {"version":3,"file":"slugUtils.js","sourceRoot":"","sources":["../../src/utils/slugUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,SAAS,CAAC;AACzC,OAAO,EACL,eAAe,EACf,gCAAgC,EAChC,oCAAoC,EACpC,uBAAuB,EACvB,6BAA6B,EAC7B,mCAAmC,GACpC,MAAM,mBAAmB,CAAC;AAU3B,SAAS,WAAW,CAAC,KAAc;IACjC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,yFAAyF;AACzF,SAAS,cAAc;IACrB,IAAI,WAAW,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/B,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,IACE,OAAO,aAAa,KAAK,QAAQ;QACjC,aAAa,KAAK,IAAI;QACtB,SAAS,IAAI,aAAa;QAC1B,WAAW,CAAC,aAAa,CAAC,OAAO,CAAC,EAClC,CAAC;QACD,OAAO,aAAa,CAAC,OAAO,CAAC;IAC/B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;AACxE,CAAC;AAED,MAAM,OAAO,GAAG,cAAc,EAA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**
2
+ * Standard vendor booking agreement for Bash marketplace introductions.
3
+ * Force majeure is one section within this document — not a separate contract.
4
+ * Not legal advice; vendors may customize via listing preferences.
5
+ */
6
+ export declare const STANDARD_VENDOR_BOOKING_AGREEMENT = "STANDARD VENDOR BOOKING AGREEMENT (Bash Marketplace)\n\n1. Scope. This agreement applies when a host books the vendor for an event through Bash. It governs the relationship between the vendor and the host for that booking. Bash facilitates the introduction and booking tools; the performance obligation is between host and vendor unless Bash is explicitly a party in writing.\n\n2. Booking confirmation. The confirmed booking details (date, time, location, fees, deliverables, and special requirements) are those shown in the booking confirmation and the vendor's listing at the time of booking. Changes must be agreed by both parties in writing (including in-app messages or email).\n\n3. Fees and payment. The vendor charges the fees stated in the listing or booking confirmation. Payment timing follows the booking checkout terms and any host cancellation policy published for the event. The vendor is responsible for its own taxes on amounts received unless otherwise required by law.\n\n4. Vendor obligations. The vendor will perform professionally, comply with applicable laws and permits, maintain any insurance represented on its profile, and meet the space, utility, and setup requirements stated on its listing.\n\n5. Host obligations. The host will provide the agreed venue access, load-in window, and utilities represented in the booking, and will communicate material event changes promptly.\n\n6. Cancellations and schedule changes. If the host cancels for reasons other than vendor breach, the vendor receives any cancellation fee or minimum guarantee stated in the booking or listing. If the vendor cannot perform, the vendor must notify the host as soon as practicable and cooperate on rescheduling or refund handling per the booking payment terms. Material changes to date, time, location, or scope may be declined by either party if the change makes performance unreasonable, when notice is given as stated in the booking confirmation.\n\n7. Force majeure. Neither party is liable for failure or delay caused by a Force Majeure Event \u2014 circumstances beyond reasonable control, including severe weather, natural disaster, epidemic, governmental order, utility failure, terrorism, civil unrest, or venue closure not caused by the vendor. The affected party must notify the other promptly and use reasonable efforts to mitigate. Deposits and prepaid amounts are handled under Section 6 and the host's published cancellation policy. Neither party owes indirect, consequential, or punitive damages for force majeure.\n\n8. Limitation of liability. Except for fraud or willful misconduct, each party's total liability arising from the booking is limited to the fees paid or payable for that booking. This limitation does not apply where prohibited by law.\n\n9. Independent contractor. The vendor is an independent contractor, not an employee or agent of the host or Bash.\n\n10. Entire agreement. This standard agreement applies to the booking unless the host and vendor supersede it with a signed written contract. Custom text saved on the vendor's Bash listing replaces this standard text for hosts reviewing that listing.\n\nBy accepting, the vendor agrees that this agreement (or its customized version on the listing) governs marketplace bookings through Bash.";
7
+ export type VendorBookingAgreementDiffLineKind = "unchanged" | "removed" | "added" | "changed";
8
+ export type VendorBookingAgreementDiffLine = {
9
+ kind: VendorBookingAgreementDiffLineKind;
10
+ standardLine?: string;
11
+ customLine?: string;
12
+ };
13
+ export declare function normalizeVendorBookingAgreementText(text: string): string;
14
+ export declare function getVendorBookingAgreementDisplayText(storedText: string | null | undefined): string;
15
+ export declare function isVendorBookingAgreementCustomized(storedText: string | null | undefined, storedFlag?: boolean | null): boolean;
16
+ export declare function resolveVendorBookingAgreementForSave(editedText: string): {
17
+ vendorBookingAgreementText: string | null;
18
+ vendorBookingAgreementCustomized: boolean;
19
+ };
20
+ /** Line-oriented diff for highlighting vendor edits against the standard agreement. */
21
+ export declare function diffVendorBookingAgreement(standardText: string, customText: string): VendorBookingAgreementDiffLine[];
22
+ export declare function vendorBookingAgreementDiffHasChanges(lines: VendorBookingAgreementDiffLine[]): boolean;
23
+ /** @deprecated Use STANDARD_VENDOR_BOOKING_AGREEMENT */
24
+ export declare const STANDARD_VENDOR_FORCE_MAJEURE_TERMS = "STANDARD VENDOR BOOKING AGREEMENT (Bash Marketplace)\n\n1. Scope. This agreement applies when a host books the vendor for an event through Bash. It governs the relationship between the vendor and the host for that booking. Bash facilitates the introduction and booking tools; the performance obligation is between host and vendor unless Bash is explicitly a party in writing.\n\n2. Booking confirmation. The confirmed booking details (date, time, location, fees, deliverables, and special requirements) are those shown in the booking confirmation and the vendor's listing at the time of booking. Changes must be agreed by both parties in writing (including in-app messages or email).\n\n3. Fees and payment. The vendor charges the fees stated in the listing or booking confirmation. Payment timing follows the booking checkout terms and any host cancellation policy published for the event. The vendor is responsible for its own taxes on amounts received unless otherwise required by law.\n\n4. Vendor obligations. The vendor will perform professionally, comply with applicable laws and permits, maintain any insurance represented on its profile, and meet the space, utility, and setup requirements stated on its listing.\n\n5. Host obligations. The host will provide the agreed venue access, load-in window, and utilities represented in the booking, and will communicate material event changes promptly.\n\n6. Cancellations and schedule changes. If the host cancels for reasons other than vendor breach, the vendor receives any cancellation fee or minimum guarantee stated in the booking or listing. If the vendor cannot perform, the vendor must notify the host as soon as practicable and cooperate on rescheduling or refund handling per the booking payment terms. Material changes to date, time, location, or scope may be declined by either party if the change makes performance unreasonable, when notice is given as stated in the booking confirmation.\n\n7. Force majeure. Neither party is liable for failure or delay caused by a Force Majeure Event \u2014 circumstances beyond reasonable control, including severe weather, natural disaster, epidemic, governmental order, utility failure, terrorism, civil unrest, or venue closure not caused by the vendor. The affected party must notify the other promptly and use reasonable efforts to mitigate. Deposits and prepaid amounts are handled under Section 6 and the host's published cancellation policy. Neither party owes indirect, consequential, or punitive damages for force majeure.\n\n8. Limitation of liability. Except for fraud or willful misconduct, each party's total liability arising from the booking is limited to the fees paid or payable for that booking. This limitation does not apply where prohibited by law.\n\n9. Independent contractor. The vendor is an independent contractor, not an employee or agent of the host or Bash.\n\n10. Entire agreement. This standard agreement applies to the booking unless the host and vendor supersede it with a signed written contract. Custom text saved on the vendor's Bash listing replaces this standard text for hosts reviewing that listing.\n\nBy accepting, the vendor agrees that this agreement (or its customized version on the listing) governs marketplace bookings through Bash.";
25
+ //# sourceMappingURL=vendorBookingAgreement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendorBookingAgreement.d.ts","sourceRoot":"","sources":["../src/vendorBookingAgreement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,iCAAiC,ytGAsB4F,CAAC;AAE3I,MAAM,MAAM,kCAAkC,GAC1C,WAAW,GACX,SAAS,GACT,OAAO,GACP,SAAS,CAAC;AAEd,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,kCAAkC,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,wBAAgB,mCAAmC,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,wBAAgB,oCAAoC,CAClD,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,MAAM,CAMR;AAED,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACrC,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,GAC1B,OAAO,CAWT;AAED,wBAAgB,oCAAoC,CAAC,UAAU,EAAE,MAAM,GAAG;IACxE,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,gCAAgC,EAAE,OAAO,CAAC;CAC3C,CAeA;AAED,uFAAuF;AACvF,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,GACjB,8BAA8B,EAAE,CAoDlC;AAED,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAET;AAED,wDAAwD;AACxD,eAAO,MAAM,mCAAmC,ytGACb,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Standard vendor booking agreement for Bash marketplace introductions.
3
+ * Force majeure is one section within this document — not a separate contract.
4
+ * Not legal advice; vendors may customize via listing preferences.
5
+ */
6
+ export const STANDARD_VENDOR_BOOKING_AGREEMENT = `STANDARD VENDOR BOOKING AGREEMENT (Bash Marketplace)
7
+
8
+ 1. Scope. This agreement applies when a host books the vendor for an event through Bash. It governs the relationship between the vendor and the host for that booking. Bash facilitates the introduction and booking tools; the performance obligation is between host and vendor unless Bash is explicitly a party in writing.
9
+
10
+ 2. Booking confirmation. The confirmed booking details (date, time, location, fees, deliverables, and special requirements) are those shown in the booking confirmation and the vendor's listing at the time of booking. Changes must be agreed by both parties in writing (including in-app messages or email).
11
+
12
+ 3. Fees and payment. The vendor charges the fees stated in the listing or booking confirmation. Payment timing follows the booking checkout terms and any host cancellation policy published for the event. The vendor is responsible for its own taxes on amounts received unless otherwise required by law.
13
+
14
+ 4. Vendor obligations. The vendor will perform professionally, comply with applicable laws and permits, maintain any insurance represented on its profile, and meet the space, utility, and setup requirements stated on its listing.
15
+
16
+ 5. Host obligations. The host will provide the agreed venue access, load-in window, and utilities represented in the booking, and will communicate material event changes promptly.
17
+
18
+ 6. Cancellations and schedule changes. If the host cancels for reasons other than vendor breach, the vendor receives any cancellation fee or minimum guarantee stated in the booking or listing. If the vendor cannot perform, the vendor must notify the host as soon as practicable and cooperate on rescheduling or refund handling per the booking payment terms. Material changes to date, time, location, or scope may be declined by either party if the change makes performance unreasonable, when notice is given as stated in the booking confirmation.
19
+
20
+ 7. Force majeure. Neither party is liable for failure or delay caused by a Force Majeure Event — circumstances beyond reasonable control, including severe weather, natural disaster, epidemic, governmental order, utility failure, terrorism, civil unrest, or venue closure not caused by the vendor. The affected party must notify the other promptly and use reasonable efforts to mitigate. Deposits and prepaid amounts are handled under Section 6 and the host's published cancellation policy. Neither party owes indirect, consequential, or punitive damages for force majeure.
21
+
22
+ 8. Limitation of liability. Except for fraud or willful misconduct, each party's total liability arising from the booking is limited to the fees paid or payable for that booking. This limitation does not apply where prohibited by law.
23
+
24
+ 9. Independent contractor. The vendor is an independent contractor, not an employee or agent of the host or Bash.
25
+
26
+ 10. Entire agreement. This standard agreement applies to the booking unless the host and vendor supersede it with a signed written contract. Custom text saved on the vendor's Bash listing replaces this standard text for hosts reviewing that listing.
27
+
28
+ By accepting, the vendor agrees that this agreement (or its customized version on the listing) governs marketplace bookings through Bash.`;
29
+ export function normalizeVendorBookingAgreementText(text) {
30
+ return text.replace(/\r\n/g, "\n").trim();
31
+ }
32
+ export function getVendorBookingAgreementDisplayText(storedText) {
33
+ const trimmed = storedText?.trim();
34
+ if (trimmed) {
35
+ return trimmed;
36
+ }
37
+ return STANDARD_VENDOR_BOOKING_AGREEMENT;
38
+ }
39
+ export function isVendorBookingAgreementCustomized(storedText, storedFlag) {
40
+ if (storedFlag === true) {
41
+ return true;
42
+ }
43
+ if (!storedText?.trim()) {
44
+ return false;
45
+ }
46
+ return (normalizeVendorBookingAgreementText(storedText) !==
47
+ normalizeVendorBookingAgreementText(STANDARD_VENDOR_BOOKING_AGREEMENT));
48
+ }
49
+ export function resolveVendorBookingAgreementForSave(editedText) {
50
+ const normalized = normalizeVendorBookingAgreementText(editedText);
51
+ const standard = normalizeVendorBookingAgreementText(STANDARD_VENDOR_BOOKING_AGREEMENT);
52
+ if (normalized === standard) {
53
+ return {
54
+ vendorBookingAgreementText: null,
55
+ vendorBookingAgreementCustomized: false,
56
+ };
57
+ }
58
+ return {
59
+ vendorBookingAgreementText: normalized,
60
+ vendorBookingAgreementCustomized: true,
61
+ };
62
+ }
63
+ /** Line-oriented diff for highlighting vendor edits against the standard agreement. */
64
+ export function diffVendorBookingAgreement(standardText, customText) {
65
+ const standardLines = normalizeVendorBookingAgreementText(standardText).split("\n");
66
+ const customLines = normalizeVendorBookingAgreementText(customText).split("\n");
67
+ const result = [];
68
+ let i = 0;
69
+ let j = 0;
70
+ while (i < standardLines.length || j < customLines.length) {
71
+ const standardLine = standardLines[i];
72
+ const customLine = customLines[j];
73
+ if (i >= standardLines.length) {
74
+ result.push({ kind: "added", customLine });
75
+ j += 1;
76
+ continue;
77
+ }
78
+ if (j >= customLines.length) {
79
+ result.push({ kind: "removed", standardLine });
80
+ i += 1;
81
+ continue;
82
+ }
83
+ if (standardLine === customLine) {
84
+ result.push({ kind: "unchanged", standardLine, customLine });
85
+ i += 1;
86
+ j += 1;
87
+ continue;
88
+ }
89
+ const standardRemainder = standardLines.slice(i + 1);
90
+ const customRemainder = customLines.slice(j + 1);
91
+ const customAppearsLater = standardRemainder.includes(customLine);
92
+ const standardAppearsLater = customRemainder.includes(standardLine);
93
+ if (customAppearsLater && !standardAppearsLater) {
94
+ result.push({ kind: "removed", standardLine });
95
+ i += 1;
96
+ continue;
97
+ }
98
+ if (standardAppearsLater && !customAppearsLater) {
99
+ result.push({ kind: "added", customLine });
100
+ j += 1;
101
+ continue;
102
+ }
103
+ result.push({ kind: "changed", standardLine, customLine });
104
+ i += 1;
105
+ j += 1;
106
+ }
107
+ return result;
108
+ }
109
+ export function vendorBookingAgreementDiffHasChanges(lines) {
110
+ return lines.some((line) => line.kind !== "unchanged");
111
+ }
112
+ /** @deprecated Use STANDARD_VENDOR_BOOKING_AGREEMENT */
113
+ export const STANDARD_VENDOR_FORCE_MAJEURE_TERMS = STANDARD_VENDOR_BOOKING_AGREEMENT;
114
+ //# sourceMappingURL=vendorBookingAgreement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendorBookingAgreement.js","sourceRoot":"","sources":["../src/vendorBookingAgreement.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;;;;0IAsByF,CAAC;AAc3I,MAAM,UAAU,mCAAmC,CAAC,IAAY;IAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,UAAqC;IAErC,MAAM,OAAO,GAAG,UAAU,EAAE,IAAI,EAAE,CAAC;IACnC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO,iCAAiC,CAAC;AAC3C,CAAC;AAED,MAAM,UAAU,kCAAkC,CAChD,UAAqC,EACrC,UAA2B;IAE3B,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,CACL,mCAAmC,CAAC,UAAU,CAAC;QAC/C,mCAAmC,CAAC,iCAAiC,CAAC,CACvE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EvC,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC;AACzD,CAAC;AAED,wDAAwD;AACxD,MAAM,CAAC,MAAM,mCAAmC,GAC9C,iCAAiC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.448.0",
3
+ "version": "30.450.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -6416,6 +6416,11 @@ model EventService {
6416
6416
  inKindEstimatedValueCents Int?
6417
6417
  dealRequiresMinimumCash Boolean @default(false)
6418
6418
  dealMinimumCashCents Int?
6419
+
6420
+ acceptsPartnerBookingTerms Boolean @default(true)
6421
+ partnerBookingAgreementText String? @db.Text
6422
+ partnerBookingAgreementCustomized Boolean @default(false)
6423
+
6419
6424
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
6420
6425
  serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
6421
6426
  service Service?
@@ -6482,6 +6487,11 @@ model EntertainmentService {
6482
6487
  inKindEstimatedValueCents Int?
6483
6488
  dealRequiresMinimumCash Boolean @default(false)
6484
6489
  dealMinimumCashCents Int?
6490
+
6491
+ acceptsPartnerBookingTerms Boolean @default(true)
6492
+ partnerBookingAgreementText String? @db.Text
6493
+ partnerBookingAgreementCustomized Boolean @default(false)
6494
+
6485
6495
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
6486
6496
  serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
6487
6497
  service Service?
@@ -6587,8 +6597,10 @@ model VendorPreferences {
6587
6597
  vendorId String @unique
6588
6598
  indoorOutdoorPreference String @default("either")
6589
6599
  preferredVendingDuration String @default("flexible")
6590
- allowSocialMediaSharing Boolean @default(true)
6591
- acceptsForceMajeure Boolean @default(true)
6600
+ /// Vendor accepts the marketplace booking agreement (force majeure is section 7).
6601
+ acceptsVendorBookingTerms Boolean @default(true)
6602
+ vendorBookingAgreementText String? @db.Text
6603
+ vendorBookingAgreementCustomized Boolean @default(false)
6592
6604
  socialMediaNotes String?
6593
6605
  /// Phase 1 host bid/RFP matching opt-in (see docs/product/VENDOR_HIRE_BID_SIGNUP_SPEC.md).
6594
6606
  openToHostBids Boolean @default(false)
@@ -6695,6 +6707,10 @@ model Exhibitor {
6695
6707
  dealRequiresMinimumCash Boolean @default(false)
6696
6708
  dealMinimumCashCents Int?
6697
6709
 
6710
+ acceptsPartnerBookingTerms Boolean @default(true)
6711
+ partnerBookingAgreementText String? @db.Text
6712
+ partnerBookingAgreementCustomized Boolean @default(false)
6713
+
6698
6714
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id], onDelete: Cascade)
6699
6715
  serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
6700
6716
  service Service?
@@ -6739,6 +6755,10 @@ model Sponsor {
6739
6755
  dealRequiresMinimumCash Boolean @default(false)
6740
6756
  dealMinimumCashCents Int?
6741
6757
 
6758
+ acceptsPartnerBookingTerms Boolean @default(true)
6759
+ partnerBookingAgreementText String? @db.Text
6760
+ partnerBookingAgreementCustomized Boolean @default(false)
6761
+
6742
6762
  service Service?
6743
6763
  crowdSize AmountOfGuests? @relation(fields: [crowdSizeId], references: [id])
6744
6764
  serviceRange ServiceRange? @relation(fields: [serviceRangeId], references: [id])
@@ -6835,6 +6855,10 @@ model Venue {
6835
6855
  dealRequiresMinimumCash Boolean @default(false)
6836
6856
  dealMinimumCashCents Int?
6837
6857
 
6858
+ acceptsPartnerBookingTerms Boolean @default(true)
6859
+ partnerBookingAgreementText String? @db.Text
6860
+ partnerBookingAgreementCustomized Boolean @default(false)
6861
+
6838
6862
  fbCarryoverCredits VenueFBCarryoverCredit[]
6839
6863
  fbMinimumOverrides VenueFBMinimumOverride[]
6840
6864
  }
@@ -1,4 +1,8 @@
1
+ import { DateTime } from "luxon";
2
+
1
3
  import {
4
+ defaultEventTimezoneIana,
5
+ formatEventTimezoneAbbrev,
2
6
  getIanaTimezoneFromCoordinates,
3
7
  getIanaTimezoneFromUsStateCode,
4
8
  inferEventTimezoneIana,
@@ -330,15 +334,54 @@ describe("eventTimezoneIana", () => {
330
334
  });
331
335
  });
332
336
 
337
+ describe("defaultEventTimezoneIana", () => {
338
+ it("uses location inference when a place is set", () => {
339
+ expect(
340
+ defaultEventTimezoneIana({
341
+ state: "NY",
342
+ country: "USA",
343
+ hostTimeZone: "America/Denver",
344
+ })
345
+ ).toBe("America/New_York");
346
+ });
347
+
348
+ it("uses host profile when no place is set", () => {
349
+ expect(
350
+ defaultEventTimezoneIana({
351
+ hostTimeZone: "America/Chicago",
352
+ })
353
+ ).toBe("America/Chicago");
354
+ });
355
+ });
356
+
357
+ describe("formatEventTimezoneAbbrev", () => {
358
+ it("returns a short label for US eastern in winter", () => {
359
+ const winter = DateTime.fromISO("2026-01-15T19:00:00", {
360
+ zone: "America/New_York",
361
+ });
362
+ expect(formatEventTimezoneAbbrev("America/New_York", winter)).toMatch(
363
+ /EST|ET/
364
+ );
365
+ });
366
+ });
367
+
333
368
  describe("resolveEventTimezoneIanaForDisplay", () => {
334
- it("prefers inferred timezone over stored", () => {
335
- // NYC coords with wrong stored timezone
369
+ it("prefers stored timezone over geographic inference", () => {
336
370
  const result = resolveEventTimezoneIanaForDisplay({
337
371
  latitude: 40.7128,
338
372
  longitude: -74.006,
339
- timezone: "America/Los_Angeles", // wrong
373
+ timezone: "America/Los_Angeles",
374
+ });
375
+ expect(result).toBe("America/Los_Angeles");
376
+ });
377
+
378
+ it("uses host profile zone when stored timezone is missing", () => {
379
+ const result = resolveEventTimezoneIanaForDisplay({
380
+ state: "UT",
381
+ country: "USA",
382
+ hostTimeZone: "America/Chicago",
340
383
  });
341
- expect(result).toBe("America/New_York");
384
+ expect(result).toBe("America/Chicago");
342
385
  });
343
386
 
344
387
  it("uses stored timezone when inference returns UTC", () => {
@@ -0,0 +1,84 @@
1
+ import {
2
+ getStandardPartnerBookingAgreement,
3
+ readPartnerBookingAgreementFromService,
4
+ resolvePartnerBookingAgreementForSave,
5
+ serviceBookingCheckoutTermsComplete,
6
+ } from "../partnerBookingAgreement.js";
7
+ import { STANDARD_EXHIBITOR_BOOKING_AGREEMENT } from "../partnerBookingAgreement.js";
8
+
9
+ describe("partnerBookingAgreement", () => {
10
+ it("resolves exhibitor save to null when text matches standard", () => {
11
+ expect(
12
+ resolvePartnerBookingAgreementForSave(
13
+ STANDARD_EXHIBITOR_BOOKING_AGREEMENT,
14
+ "exhibitor"
15
+ )
16
+ ).toEqual({
17
+ partnerBookingAgreementText: null,
18
+ partnerBookingAgreementCustomized: false,
19
+ });
20
+ });
21
+
22
+ it("reads vendor agreement from service.vendor.preferences", () => {
23
+ const snapshot = readPartnerBookingAgreementFromService({
24
+ vendor: {
25
+ preferences: {
26
+ acceptsVendorBookingTerms: true,
27
+ vendorBookingAgreementText: null,
28
+ vendorBookingAgreementCustomized: false,
29
+ },
30
+ },
31
+ } as never);
32
+ expect(snapshot?.role).toBe("vendor");
33
+ expect(snapshot?.displayText).toContain("STANDARD VENDOR BOOKING AGREEMENT");
34
+ });
35
+
36
+ it("reads exhibitor agreement from flat exhibitor fields", () => {
37
+ const snapshot = readPartnerBookingAgreementFromService({
38
+ exhibitor: {
39
+ acceptsPartnerBookingTerms: true,
40
+ partnerBookingAgreementText: null,
41
+ partnerBookingAgreementCustomized: false,
42
+ },
43
+ } as never);
44
+ expect(snapshot?.role).toBe("exhibitor");
45
+ expect(snapshot?.displayText).toBe(STANDARD_EXHIBITOR_BOOKING_AGREEMENT);
46
+ });
47
+
48
+ it("serviceBookingCheckoutTermsComplete requires partner ack when partner listing", () => {
49
+ const service = {
50
+ vendor: {
51
+ preferences: { acceptsVendorBookingTerms: true },
52
+ },
53
+ } as never;
54
+ expect(
55
+ serviceBookingCheckoutTermsComplete(true, false, service)
56
+ ).toBe(false);
57
+ expect(serviceBookingCheckoutTermsComplete(true, true, service)).toBe(true);
58
+ expect(
59
+ serviceBookingCheckoutTermsComplete(false, true, service)
60
+ ).toBe(false);
61
+ });
62
+
63
+ it("serviceBookingCheckoutTermsComplete passes without partner subtype", () => {
64
+ expect(
65
+ serviceBookingCheckoutTermsComplete(true, false, {} as never)
66
+ ).toBe(true);
67
+ });
68
+
69
+ it("reads venue agreement from flat venue fields", () => {
70
+ const snapshot = readPartnerBookingAgreementFromService({
71
+ venue: {
72
+ acceptsPartnerBookingTerms: true,
73
+ partnerBookingAgreementText: null,
74
+ partnerBookingAgreementCustomized: false,
75
+ },
76
+ } as never);
77
+ expect(snapshot?.role).toBe("venue");
78
+ expect(snapshot?.displayText).toContain("STANDARD VENUE BOOKING AGREEMENT");
79
+ });
80
+
81
+ it("getStandardPartnerBookingAgreement returns role-specific titles", () => {
82
+ expect(getStandardPartnerBookingAgreement("sponsor")).toContain("SPONSOR");
83
+ });
84
+ });
@@ -0,0 +1,53 @@
1
+ import {
2
+ STANDARD_VENDOR_BOOKING_AGREEMENT,
3
+ diffVendorBookingAgreement,
4
+ getVendorBookingAgreementDisplayText,
5
+ isVendorBookingAgreementCustomized,
6
+ resolveVendorBookingAgreementForSave,
7
+ vendorBookingAgreementDiffHasChanges,
8
+ } from "../vendorBookingAgreement.js";
9
+
10
+ describe("vendorBookingAgreement", () => {
11
+ it("includes force majeure as a section within the standard agreement", () => {
12
+ expect(STANDARD_VENDOR_BOOKING_AGREEMENT).toMatch(/7\. Force majeure\./i);
13
+ expect(STANDARD_VENDOR_BOOKING_AGREEMENT).toMatch(/1\. Scope\./);
14
+ });
15
+
16
+ it("uses standard text when nothing is stored", () => {
17
+ expect(getVendorBookingAgreementDisplayText(null)).toBe(
18
+ STANDARD_VENDOR_BOOKING_AGREEMENT
19
+ );
20
+ });
21
+
22
+ it("clears storage when text matches the standard", () => {
23
+ expect(
24
+ resolveVendorBookingAgreementForSave(STANDARD_VENDOR_BOOKING_AGREEMENT)
25
+ ).toEqual({
26
+ vendorBookingAgreementText: null,
27
+ vendorBookingAgreementCustomized: false,
28
+ });
29
+ });
30
+
31
+ it("persists customized text and flag when edited", () => {
32
+ const custom = `${STANDARD_VENDOR_BOOKING_AGREEMENT}\n\n11. Additional. 48-hour notice required.`;
33
+ expect(resolveVendorBookingAgreementForSave(custom)).toEqual({
34
+ vendorBookingAgreementText: custom,
35
+ vendorBookingAgreementCustomized: true,
36
+ });
37
+ expect(isVendorBookingAgreementCustomized(custom, false)).toBe(true);
38
+ });
39
+
40
+ it("highlights added and changed lines in a diff", () => {
41
+ const custom = STANDARD_VENDOR_BOOKING_AGREEMENT.replace(
42
+ "1. Scope.",
43
+ "1. Scope (amended)."
44
+ ).concat("\n\n11. Extra clause.");
45
+ const lines = diffVendorBookingAgreement(
46
+ STANDARD_VENDOR_BOOKING_AGREEMENT,
47
+ custom
48
+ );
49
+ expect(vendorBookingAgreementDiffHasChanges(lines)).toBe(true);
50
+ expect(lines.some((line) => line.kind === "added")).toBe(true);
51
+ expect(lines.some((line) => line.kind === "changed")).toBe(true);
52
+ });
53
+ });
package/src/index.ts CHANGED
@@ -5,6 +5,8 @@ export * from "./giveaway.js";
5
5
  export * from "./requestAuthUser.js";
6
6
  export * from "./sms/smsTemplates.js";
7
7
  export * from "./legalTemplates.js";
8
+ export * from "./vendorBookingAgreement.js";
9
+ export * from "./partnerBookingAgreement.js";
8
10
  export * from "./utmAttribution.js";
9
11
  export * from "./venueLoyaltyRedemption.js";
10
12
  export * from "./stripeListingSubscriptionMessages.js";
@@ -387,6 +389,9 @@ export {
387
389
  getIanaTimezoneFromCoordinates,
388
390
  getIanaTimezoneFromLocationStringHints,
389
391
  inferEventTimezoneIana,
392
+ defaultEventTimezoneIana,
393
+ formatEventTimezoneAbbrev,
394
+ EVENT_TIMEZONE_PICKER_ZONES,
390
395
  resolveEventTimezoneIanaForDisplay,
391
396
  } from "./utils/eventTimezoneIana.js";
392
397
  export type {