@bash-app/bash-common 30.275.0 → 30.277.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/dist/__tests__/groupTicketUtils.test.d.ts +2 -0
- package/dist/__tests__/groupTicketUtils.test.d.ts.map +1 -0
- package/dist/__tests__/groupTicketUtils.test.js +38 -0
- package/dist/__tests__/groupTicketUtils.test.js.map +1 -0
- package/dist/competitionIdeas.d.ts +19 -0
- package/dist/competitionIdeas.d.ts.map +1 -0
- package/dist/competitionIdeas.js +405 -0
- package/dist/competitionIdeas.js.map +1 -0
- package/dist/competitionValidation.d.ts +10 -0
- package/dist/competitionValidation.d.ts.map +1 -0
- package/dist/competitionValidation.js +29 -0
- package/dist/competitionValidation.js.map +1 -0
- package/dist/definitions.d.ts +6 -0
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +356 -1
- package/dist/extendedSchemas.d.ts.map +1 -1
- package/dist/extendedSchemas.js +15 -0
- package/dist/extendedSchemas.js.map +1 -1
- package/dist/groupTicketUtils.d.ts +19 -0
- package/dist/groupTicketUtils.d.ts.map +1 -0
- package/dist/groupTicketUtils.js +74 -0
- package/dist/groupTicketUtils.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/__tests__/paymentUtils.test.js +80 -8
- package/dist/utils/__tests__/paymentUtils.test.js.map +1 -1
- package/dist/utils/__tests__/recurrenceUtils.test.js +82 -1
- package/dist/utils/__tests__/recurrenceUtils.test.js.map +1 -1
- package/dist/utils/__tests__/ticketListUtils.test.js +10 -0
- package/dist/utils/__tests__/ticketListUtils.test.js.map +1 -1
- package/dist/utils/groupTicketCartUtils.d.ts +12 -0
- package/dist/utils/groupTicketCartUtils.d.ts.map +1 -0
- package/dist/utils/groupTicketCartUtils.js +30 -0
- package/dist/utils/groupTicketCartUtils.js.map +1 -0
- package/dist/utils/paymentUtils.d.ts +56 -0
- package/dist/utils/paymentUtils.d.ts.map +1 -1
- package/dist/utils/paymentUtils.js +114 -18
- package/dist/utils/paymentUtils.js.map +1 -1
- package/dist/utils/recurrenceUtils.d.ts +18 -0
- package/dist/utils/recurrenceUtils.d.ts.map +1 -1
- package/dist/utils/recurrenceUtils.js +70 -0
- package/dist/utils/recurrenceUtils.js.map +1 -1
- package/dist/utils/service/serviceBookingTypes.d.ts +1 -1
- package/dist/utils/service/serviceBookingTypes.d.ts.map +1 -1
- package/dist/utils/ticketListUtils.d.ts.map +1 -1
- package/dist/utils/ticketListUtils.js +15 -3
- package/dist/utils/ticketListUtils.js.map +1 -1
- package/package.json +1 -1
- package/prisma/migrations/competition-prize-catalog-entry-tier.sql +39 -0
- package/prisma/schema.prisma +118 -8
- package/src/__tests__/groupTicketUtils.test.ts +53 -0
- package/src/competitionIdeas.ts +429 -0
- package/src/competitionValidation.ts +42 -0
- package/src/definitions.ts +7 -0
- package/src/extendedSchemas.ts +52 -0
- package/src/groupTicketUtils.ts +101 -0
- package/src/index.ts +4 -0
- package/src/utils/__tests__/paymentUtils.test.ts +123 -8
- package/src/utils/__tests__/recurrenceUtils.test.ts +99 -0
- package/src/utils/__tests__/ticketListUtils.test.ts +12 -0
- package/src/utils/groupTicketCartUtils.ts +36 -0
- package/src/utils/paymentUtils.ts +165 -21
- package/src/utils/recurrenceUtils.ts +104 -0
- package/src/utils/service/serviceBookingTypes.ts +3 -0
- package/src/utils/ticketListUtils.ts +19 -5
|
@@ -67,6 +67,9 @@ export type ServiceBookingRequiredData = MakeNullablePropsOptional<
|
|
|
67
67
|
// so callers building a new booking shape may omit them.
|
|
68
68
|
| "settlementStatus"
|
|
69
69
|
| "settlementAttempts"
|
|
70
|
+
// Reschedule lifecycle — DB defaults `rescheduleStatus` to None; the rest are
|
|
71
|
+
// nullable and set only when a host moves the date.
|
|
72
|
+
| "rescheduleStatus"
|
|
70
73
|
>
|
|
71
74
|
>;
|
|
72
75
|
|
|
@@ -80,7 +80,12 @@ export function ticketListToString(
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
ticketArgs.push(
|
|
83
|
-
`${ticketNumAndDates.numberOfTickets}${URL_PARAMS_TICKETS_DATE_DELIM}${dateTimeStr}
|
|
83
|
+
`${ticketNumAndDates.numberOfTickets}${URL_PARAMS_TICKETS_DATE_DELIM}${dateTimeStr}${
|
|
84
|
+
ticketNumAndDates.unitPriceCents != null &&
|
|
85
|
+
ticketNumAndDates.unitPriceCents > 0
|
|
86
|
+
? `${URL_PARAMS_TICKETS_DATE_DELIM}${ticketNumAndDates.unitPriceCents}`
|
|
87
|
+
: ""
|
|
88
|
+
}`
|
|
84
89
|
);
|
|
85
90
|
}
|
|
86
91
|
}
|
|
@@ -147,10 +152,11 @@ export function ticketListStrToTicketList(
|
|
|
147
152
|
.filter((ticketNumAndDateStr): boolean => !!ticketNumAndDateStr);
|
|
148
153
|
|
|
149
154
|
for (const ticketNumAndDateStr of ticketNumAndDates) {
|
|
150
|
-
// [numberOfTickets];;[date]
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
155
|
+
// [numberOfTickets];;[date];;[unitPriceCents?]
|
|
156
|
+
const segments = ticketNumAndDateStr.split(URL_PARAMS_TICKETS_DATE_DELIM);
|
|
157
|
+
const numberOfTickets = segments[0];
|
|
158
|
+
const ticketDateTimeStr = segments[1];
|
|
159
|
+
const unitPriceCentsRaw = segments[2];
|
|
154
160
|
const ticketDateTime = DateTime.fromISO(ticketDateTimeStr);
|
|
155
161
|
let ticketDateTimeFormattedStr: string | undefined = undefined;
|
|
156
162
|
|
|
@@ -158,9 +164,17 @@ export function ticketListStrToTicketList(
|
|
|
158
164
|
ticketDateTimeFormattedStr = ticketDateTime.toISO() ?? undefined;
|
|
159
165
|
}
|
|
160
166
|
|
|
167
|
+
const unitPriceCents =
|
|
168
|
+
unitPriceCentsRaw != null && unitPriceCentsRaw !== ""
|
|
169
|
+
? parseInt(unitPriceCentsRaw, 10)
|
|
170
|
+
: undefined;
|
|
171
|
+
|
|
161
172
|
ticketNumAndDatesArr.push({
|
|
162
173
|
numberOfTickets: parseInt(numberOfTickets),
|
|
163
174
|
ticketDateTime: ticketDateTimeFormattedStr,
|
|
175
|
+
...(unitPriceCents != null && !Number.isNaN(unitPriceCents)
|
|
176
|
+
? { unitPriceCents }
|
|
177
|
+
: {}),
|
|
164
178
|
});
|
|
165
179
|
}
|
|
166
180
|
ticketList.set(ticketTierId, ticketNumAndDatesArr);
|