@bash-app/bash-common 30.275.0 → 30.276.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 +4 -0
- package/dist/definitions.d.ts.map +1 -1
- package/dist/definitions.js.map +1 -1
- package/dist/extendedSchemas.d.ts +351 -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 +18 -0
- package/dist/utils/__tests__/paymentUtils.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 +10 -0
- package/dist/utils/paymentUtils.d.ts.map +1 -1
- package/dist/utils/paymentUtils.js +37 -1
- package/dist/utils/paymentUtils.js.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 +90 -7
- package/src/__tests__/groupTicketUtils.test.ts +53 -0
- package/src/competitionIdeas.ts +429 -0
- package/src/competitionValidation.ts +42 -0
- package/src/definitions.ts +5 -0
- package/src/extendedSchemas.ts +47 -0
- package/src/groupTicketUtils.ts +101 -0
- package/src/index.ts +4 -0
- package/src/utils/__tests__/paymentUtils.test.ts +19 -0
- package/src/utils/__tests__/ticketListUtils.test.ts +12 -0
- package/src/utils/groupTicketCartUtils.ts +36 -0
- package/src/utils/paymentUtils.ts +42 -1
- package/src/utils/ticketListUtils.ts +19 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupTicketUtils.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/groupTicketUtils.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { formatGroupPackagePerPersonUsd, groupPackageShareCents, isGroupTicketTier, packagesSoldFromTicketCount, validateGroupTicketTierInput, } from "../groupTicketUtils.js";
|
|
2
|
+
describe("isGroupTicketTier", () => {
|
|
3
|
+
it("returns true when flag and seat count are valid", () => {
|
|
4
|
+
expect(isGroupTicketTier({ isGroupTicket: true, groupTicketSeatCount: 6 })).toBe(true);
|
|
5
|
+
});
|
|
6
|
+
it("returns false when seat count is below minimum", () => {
|
|
7
|
+
expect(isGroupTicketTier({ isGroupTicket: true, groupTicketSeatCount: 1 })).toBe(false);
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
describe("packagesSoldFromTicketCount", () => {
|
|
11
|
+
it("converts seat rows to package count", () => {
|
|
12
|
+
expect(packagesSoldFromTicketCount(12, 6)).toBe(2);
|
|
13
|
+
expect(packagesSoldFromTicketCount(7, 6)).toBe(2);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
describe("groupPackageShareCents", () => {
|
|
17
|
+
it("splits package price evenly in cents", () => {
|
|
18
|
+
expect(groupPackageShareCents(60000, 6)).toBe(10000);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
describe("formatGroupPackagePerPersonUsd", () => {
|
|
22
|
+
it("formats per-person USD", () => {
|
|
23
|
+
expect(formatGroupPackagePerPersonUsd(60000, 6)).toMatch(/\$100/);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
describe("validateGroupTicketTierInput", () => {
|
|
27
|
+
it("rejects donation group packages", () => {
|
|
28
|
+
const result = validateGroupTicketTierInput({
|
|
29
|
+
isGroupTicket: true,
|
|
30
|
+
groupTicketSeatCount: 6,
|
|
31
|
+
isDonationTier: true,
|
|
32
|
+
isWaitlistTier: false,
|
|
33
|
+
pricingType: "USD",
|
|
34
|
+
});
|
|
35
|
+
expect(result.ok).toBe(false);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=groupTicketUtils.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"groupTicketUtils.test.js","sourceRoot":"","sources":["../../src/__tests__/groupTicketUtils.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,sBAAsB,EACtB,iBAAiB,EACjB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CACJ,iBAAiB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,oBAAoB,EAAE,CAAC,EAAE,CAAC,CACpE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD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EAAE,KAAK;YACrB,WAAW,EAAE,KAAK;SACnB,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CompetitionType, JudgingType } from "@prisma/client";
|
|
2
|
+
export interface CompetitionIdea {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
competitionType: CompetitionType;
|
|
7
|
+
subtype: string;
|
|
8
|
+
judgingType: JudgingType;
|
|
9
|
+
tags?: string[];
|
|
10
|
+
suggestsParticipationTier?: boolean;
|
|
11
|
+
rulesSnippet?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const COMPETITION_IDEAS: CompetitionIdea[];
|
|
14
|
+
export declare function competitionIdeasSorted(): CompetitionIdea[];
|
|
15
|
+
export declare function competitionIdeasByLetter(): Map<string, CompetitionIdea[]>;
|
|
16
|
+
/** Unique subtype labels per competition type (for host subtype dropdown). */
|
|
17
|
+
export declare function competitionSubtypesByType(): Record<CompetitionType, string[]>;
|
|
18
|
+
export declare function filterCompetitionIdeas(query: string): CompetitionIdea[];
|
|
19
|
+
//# sourceMappingURL=competitionIdeas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competitionIdeas.d.ts","sourceRoot":"","sources":["../src/competitionIdeas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,iBAAiB,EAAE,eAAe,EA4W9C,CAAC;AAEF,wBAAgB,sBAAsB,IAAI,eAAe,EAAE,CAI1D;AAED,wBAAgB,wBAAwB,IAAI,GAAG,CAAC,MAAM,EAAE,eAAe,EAAE,CAAC,CAWzE;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,IAAI,MAAM,CACjD,eAAe,EACf,MAAM,EAAE,CACT,CAaA;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAUvE"}
|
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { CompetitionType, JudgingType } from "@prisma/client";
|
|
2
|
+
export const COMPETITION_IDEAS = [
|
|
3
|
+
{
|
|
4
|
+
id: "art-contest",
|
|
5
|
+
title: "Art contest",
|
|
6
|
+
description: "Live or submitted artwork judged on creativity and skill.",
|
|
7
|
+
competitionType: CompetitionType.SKILL,
|
|
8
|
+
subtype: "Art contests (speed painting, live art)",
|
|
9
|
+
judgingType: JudgingType.JUDGES,
|
|
10
|
+
tags: ["Skill", "Creative"],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
id: "audience-favorite-dish",
|
|
14
|
+
title: "Audience favorite dish",
|
|
15
|
+
description: "Potluck or tasting event — guests vote for their favorite plate.",
|
|
16
|
+
competitionType: CompetitionType.AUDIENCE_VOTING,
|
|
17
|
+
subtype: "Best dish (potlucks)",
|
|
18
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
19
|
+
tags: ["Food", "Vote"],
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "barista-latte-art",
|
|
23
|
+
title: "Barista latte art contest",
|
|
24
|
+
description: "Baristas pour their best latte art for judges or crowd applause.",
|
|
25
|
+
competitionType: CompetitionType.FOOD_DRINK,
|
|
26
|
+
subtype: "Barista/latte art contest",
|
|
27
|
+
judgingType: JudgingType.JUDGES,
|
|
28
|
+
tags: ["Food", "Skill"],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "best-booth-decor",
|
|
32
|
+
title: "Best booth decor",
|
|
33
|
+
description: "Vendors compete for the best-looking booth at the fair.",
|
|
34
|
+
competitionType: CompetitionType.VENDOR_BOOTH,
|
|
35
|
+
subtype: "Best booth decor",
|
|
36
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
37
|
+
tags: ["Vendor", "Vote"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: "best-costume",
|
|
41
|
+
title: "Best costume contest",
|
|
42
|
+
description: "Show off creative costumes — judges or audience pick winners.",
|
|
43
|
+
competitionType: CompetitionType.SKILL,
|
|
44
|
+
subtype: "Costume contests",
|
|
45
|
+
judgingType: JudgingType.JUDGES,
|
|
46
|
+
tags: ["Seasonal", "Fun"],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "best-dressed",
|
|
50
|
+
title: "Best dressed",
|
|
51
|
+
description: "Formal or themed event — who nailed the look?",
|
|
52
|
+
competitionType: CompetitionType.AUDIENCE_VOTING,
|
|
53
|
+
subtype: "Best dressed",
|
|
54
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
55
|
+
tags: ["Vote", "Social"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "bingo-night",
|
|
59
|
+
title: "Bingo night",
|
|
60
|
+
description: "Classic bingo rounds — host calls numbers and tracks winners.",
|
|
61
|
+
competitionType: CompetitionType.INTERACTIVE,
|
|
62
|
+
subtype: "Bingo",
|
|
63
|
+
judgingType: JudgingType.HOST_CHOOSES,
|
|
64
|
+
tags: ["Interactive", "All ages"],
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "case-study-competition",
|
|
68
|
+
title: "Case study competition",
|
|
69
|
+
description: "Teams present solutions; panel scores on rubric.",
|
|
70
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
71
|
+
subtype: "Case study competitions",
|
|
72
|
+
judgingType: JudgingType.JUDGES,
|
|
73
|
+
tags: ["Professional", "Teams"],
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "check-in-contest",
|
|
77
|
+
title: "Check-in contest",
|
|
78
|
+
description: "First attendees to check in win a sponsor gift (host confirms).",
|
|
79
|
+
competitionType: CompetitionType.SOCIAL_MEDIA,
|
|
80
|
+
subtype: "Check-in contests (first X people get a prize)",
|
|
81
|
+
judgingType: JudgingType.FIRST_COME,
|
|
82
|
+
tags: ["Door", "Sponsor"],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: "chili-cook-off",
|
|
86
|
+
title: "Chili cook-off",
|
|
87
|
+
description: "Cooks bring their best chili; judges score taste and presentation.",
|
|
88
|
+
competitionType: CompetitionType.FOOD_DRINK,
|
|
89
|
+
subtype: "Chili cook-off / BBQ contest",
|
|
90
|
+
judgingType: JudgingType.JUDGES,
|
|
91
|
+
tags: ["Food", "Fundraiser"],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "coloring-contest",
|
|
95
|
+
title: "Coloring contest",
|
|
96
|
+
description: "Kids submit coloring pages; host picks winners by age group.",
|
|
97
|
+
competitionType: CompetitionType.KIDS_FAMILY,
|
|
98
|
+
subtype: "Coloring contests",
|
|
99
|
+
judgingType: JudgingType.HOST_CHOOSES,
|
|
100
|
+
tags: ["Kids", "Family"],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "cornhole-tournament",
|
|
104
|
+
title: "Cornhole tournament",
|
|
105
|
+
description: "Single-elimination bracket on the lawn.",
|
|
106
|
+
competitionType: CompetitionType.PHYSICAL,
|
|
107
|
+
subtype: "Cornhole tournaments",
|
|
108
|
+
judgingType: JudgingType.BRACKET_TOURNAMENT,
|
|
109
|
+
tags: ["Outdoor", "Bracket"],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "cupcake-decorating",
|
|
113
|
+
title: "Cupcake decorating contest",
|
|
114
|
+
description: "Decorate cupcakes on the spot; judges pick the most creative.",
|
|
115
|
+
competitionType: CompetitionType.FOOD_DRINK,
|
|
116
|
+
subtype: "Cupcake decorating",
|
|
117
|
+
judgingType: JudgingType.JUDGES,
|
|
118
|
+
tags: ["Food", "Kids"],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: "dance-off",
|
|
122
|
+
title: "Dance-off",
|
|
123
|
+
description: "Dancers battle in rounds; audience or judges advance winners.",
|
|
124
|
+
competitionType: CompetitionType.SKILL,
|
|
125
|
+
subtype: "Dance-offs",
|
|
126
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
127
|
+
tags: ["Skill", "Performance"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "design-sprint",
|
|
131
|
+
title: "Design sprint showcase",
|
|
132
|
+
description: "Teams demo prototypes; judges score on impact and polish.",
|
|
133
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
134
|
+
subtype: "Design sprints",
|
|
135
|
+
judgingType: JudgingType.JUDGES,
|
|
136
|
+
tags: ["Professional", "Teams"],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
id: "eating-contest",
|
|
140
|
+
title: "Eating contest",
|
|
141
|
+
description: "Timed eating challenge — fastest or most completed wins.",
|
|
142
|
+
competitionType: CompetitionType.FOOD_DRINK,
|
|
143
|
+
subtype: "Eating competitions (hot wings, donuts, pie, etc.)",
|
|
144
|
+
judgingType: JudgingType.METRICS,
|
|
145
|
+
tags: ["Food", "Fun"],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
id: "fan-favorite-vendor",
|
|
149
|
+
title: "Fan favorite vendor",
|
|
150
|
+
description: "Attendees vote for their favorite vendor booth.",
|
|
151
|
+
competitionType: CompetitionType.VENDOR_BOOTH,
|
|
152
|
+
subtype: "Fan favorite vendor",
|
|
153
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
154
|
+
tags: ["Vendor", "Vote"],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: "gingerbread-houses",
|
|
158
|
+
title: "Gingerbread house competition",
|
|
159
|
+
description: "Teams build gingerbread houses; judges score creativity.",
|
|
160
|
+
competitionType: CompetitionType.SEASONAL_HOLIDAY,
|
|
161
|
+
subtype: "Gingerbread house competition",
|
|
162
|
+
judgingType: JudgingType.JUDGES,
|
|
163
|
+
tags: ["Seasonal", "Family"],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: "hackathon",
|
|
167
|
+
title: "Hackathon showcase",
|
|
168
|
+
description: "Teams demo builds; judges score on technical merit and UX.",
|
|
169
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
170
|
+
subtype: "Hackathons",
|
|
171
|
+
judgingType: JudgingType.JUDGES,
|
|
172
|
+
tags: ["Professional", "Tech"],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "hashtag-photo-contest",
|
|
176
|
+
title: "Hashtag photo contest",
|
|
177
|
+
description: "Best photo posted with the event hashtag — host or crowd picks.",
|
|
178
|
+
competitionType: CompetitionType.SOCIAL_MEDIA,
|
|
179
|
+
subtype: "Best photo posted with event hashtag",
|
|
180
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
181
|
+
tags: ["Social", "Marketing"],
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
id: "lego-build-off",
|
|
185
|
+
title: "LEGO build-off",
|
|
186
|
+
description: "Build teams compete on a theme within a time limit.",
|
|
187
|
+
competitionType: CompetitionType.KIDS_FAMILY,
|
|
188
|
+
subtype: "LEGO build-offs",
|
|
189
|
+
judgingType: JudgingType.JUDGES,
|
|
190
|
+
tags: ["Kids", "Creative"],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "lip-sync-battle",
|
|
194
|
+
title: "Lip sync battle",
|
|
195
|
+
description: "Performers lip sync to tracks; audience votes for the best show.",
|
|
196
|
+
competitionType: CompetitionType.INTERACTIVE,
|
|
197
|
+
subtype: "Lip sync battles",
|
|
198
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
199
|
+
tags: ["Performance", "Fun"],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
id: "minute-to-win-it",
|
|
203
|
+
title: "Minute to Win It games",
|
|
204
|
+
description: "Quick challenge stations — host tracks fastest times.",
|
|
205
|
+
competitionType: CompetitionType.INTERACTIVE,
|
|
206
|
+
subtype: "Minute-to-Win-It style games",
|
|
207
|
+
judgingType: JudgingType.METRICS,
|
|
208
|
+
tags: ["Interactive", "All ages"],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
id: "mixology-challenge",
|
|
212
|
+
title: "Mixology challenge",
|
|
213
|
+
description: "Bartenders craft signature drinks; judges score taste and presentation.",
|
|
214
|
+
competitionType: CompetitionType.FOOD_DRINK,
|
|
215
|
+
subtype: "Mixology or mocktail challenge",
|
|
216
|
+
judgingType: JudgingType.JUDGES,
|
|
217
|
+
tags: ["Food", "21+"],
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
id: "most-interactive-booth",
|
|
221
|
+
title: "Most interactive booth",
|
|
222
|
+
description: "Which vendor booth engaged attendees the most?",
|
|
223
|
+
competitionType: CompetitionType.VENDOR_BOOTH,
|
|
224
|
+
subtype: "Most interactive booth",
|
|
225
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
226
|
+
tags: ["Vendor", "Vote"],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "obstacle-course",
|
|
230
|
+
title: "Obstacle course race",
|
|
231
|
+
description: "Timed runs through obstacles — fastest time wins.",
|
|
232
|
+
competitionType: CompetitionType.PHYSICAL,
|
|
233
|
+
subtype: "Obstacle courses",
|
|
234
|
+
judgingType: JudgingType.METRICS,
|
|
235
|
+
tags: ["Outdoor", "Athletic"],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: "photography-contest",
|
|
239
|
+
title: "Photography contest",
|
|
240
|
+
description: "Submit or display photos; judges score composition and story.",
|
|
241
|
+
competitionType: CompetitionType.SKILL,
|
|
242
|
+
subtype: "Photography contests",
|
|
243
|
+
judgingType: JudgingType.JUDGES,
|
|
244
|
+
tags: ["Creative", "Skill"],
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "pitch-competition",
|
|
248
|
+
title: "Pitch competition",
|
|
249
|
+
description: "Founders pitch ideas; panel scores and picks a winner.",
|
|
250
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
251
|
+
subtype: "Pitch competitions",
|
|
252
|
+
judgingType: JudgingType.JUDGES,
|
|
253
|
+
tags: ["Professional", "Startup"],
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "pumpkin-carving",
|
|
257
|
+
title: "Pumpkin carving contest",
|
|
258
|
+
description: "Carve on site; host or judges pick the best jack-o'-lantern.",
|
|
259
|
+
competitionType: CompetitionType.KIDS_FAMILY,
|
|
260
|
+
subtype: "Pumpkin carving",
|
|
261
|
+
judgingType: JudgingType.HOST_CHOOSES,
|
|
262
|
+
tags: ["Seasonal", "Family"],
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "relay-race",
|
|
266
|
+
title: "Relay race",
|
|
267
|
+
description: "Team relay on the field — first team across wins.",
|
|
268
|
+
competitionType: CompetitionType.PHYSICAL,
|
|
269
|
+
subtype: "Relay races",
|
|
270
|
+
judgingType: JudgingType.METRICS,
|
|
271
|
+
tags: ["Outdoor", "Teams"],
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "scavenger-hunt",
|
|
275
|
+
title: "Scavenger hunt",
|
|
276
|
+
description: "Teams find clues around the venue — first to finish wins.",
|
|
277
|
+
competitionType: CompetitionType.PHYSICAL,
|
|
278
|
+
subtype: "Scavenger hunts",
|
|
279
|
+
judgingType: JudgingType.METRICS,
|
|
280
|
+
tags: ["Outdoor", "Teams"],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: "science-fair",
|
|
284
|
+
title: "Science fair expo",
|
|
285
|
+
description: "Projects on display; judges score on hypothesis and presentation.",
|
|
286
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
287
|
+
subtype: "Science fairs/expos",
|
|
288
|
+
judgingType: JudgingType.JUDGES,
|
|
289
|
+
tags: ["Education", "Kids"],
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: "singing-battle",
|
|
293
|
+
title: "Singing or karaoke battle",
|
|
294
|
+
description: "Performers sing live; audience or judges pick favorites.",
|
|
295
|
+
competitionType: CompetitionType.SKILL,
|
|
296
|
+
subtype: "Singing or karaoke battles",
|
|
297
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
298
|
+
tags: ["Performance", "Skill"],
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "startup-demo-day",
|
|
302
|
+
title: "Startup demo day voting",
|
|
303
|
+
description: "Founders demo on stage; audience votes for fan favorite.",
|
|
304
|
+
competitionType: CompetitionType.BUSINESS_PROFESSIONAL,
|
|
305
|
+
subtype: "Startup demo day voting",
|
|
306
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
307
|
+
tags: ["Professional", "Vote"],
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "talent-show",
|
|
311
|
+
title: "Talent show",
|
|
312
|
+
description: "Open mic performances; judges or audience advance acts.",
|
|
313
|
+
competitionType: CompetitionType.SKILL,
|
|
314
|
+
subtype: "Talent shows",
|
|
315
|
+
judgingType: JudgingType.JUDGES,
|
|
316
|
+
tags: ["Performance", "All ages"],
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: "treasure-hunt",
|
|
320
|
+
title: "Treasure hunt",
|
|
321
|
+
description: "Follow clues to a hidden prize — host verifies first find.",
|
|
322
|
+
competitionType: CompetitionType.RANDOMIZED,
|
|
323
|
+
subtype: "Treasure hunts",
|
|
324
|
+
judgingType: JudgingType.METRICS,
|
|
325
|
+
tags: ["Interactive", "Outdoor"],
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
id: "trivia-night",
|
|
329
|
+
title: "Trivia night",
|
|
330
|
+
description: "Teams answer rounds of questions; highest score wins.",
|
|
331
|
+
competitionType: CompetitionType.SKILL,
|
|
332
|
+
subtype: "Trivia competitions",
|
|
333
|
+
judgingType: JudgingType.METRICS,
|
|
334
|
+
tags: ["Indoor", "Teams"],
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: "tug-of-war",
|
|
338
|
+
title: "Tug of war",
|
|
339
|
+
description: "Team bracket on the rope — last team standing wins.",
|
|
340
|
+
competitionType: CompetitionType.PHYSICAL,
|
|
341
|
+
subtype: "Tug of war",
|
|
342
|
+
judgingType: JudgingType.BRACKET_TOURNAMENT,
|
|
343
|
+
tags: ["Outdoor", "Teams"],
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
id: "ugly-sweater",
|
|
347
|
+
title: "Ugly sweater contest",
|
|
348
|
+
description: "Holiday sweaters judged for creativity and commitment.",
|
|
349
|
+
competitionType: CompetitionType.SEASONAL_HOLIDAY,
|
|
350
|
+
subtype: "Ugly sweater contest",
|
|
351
|
+
judgingType: JudgingType.AUDIENCE_VOTE,
|
|
352
|
+
tags: ["Seasonal", "Fun"],
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
id: "white-elephant",
|
|
356
|
+
title: "White elephant gift exchange",
|
|
357
|
+
description: "Participants bring wrapped gifts; steal-and-swap game run by the host.",
|
|
358
|
+
competitionType: CompetitionType.INTERACTIVE,
|
|
359
|
+
subtype: "White elephant / gift exchange",
|
|
360
|
+
judgingType: JudgingType.HOST_CHOOSES,
|
|
361
|
+
tags: ["Fundraiser", "Interactive"],
|
|
362
|
+
suggestsParticipationTier: true,
|
|
363
|
+
rulesSnippet: "- Bring one wrapped gift\n- Must be present to play\n- Host runs steal/swap rounds\n- Prizes listed are sponsor donations, not cash values",
|
|
364
|
+
},
|
|
365
|
+
];
|
|
366
|
+
export function competitionIdeasSorted() {
|
|
367
|
+
return [...COMPETITION_IDEAS].sort((a, b) => a.title.localeCompare(b.title, undefined, { sensitivity: "base" }));
|
|
368
|
+
}
|
|
369
|
+
export function competitionIdeasByLetter() {
|
|
370
|
+
const sorted = competitionIdeasSorted();
|
|
371
|
+
const map = new Map();
|
|
372
|
+
for (const idea of sorted) {
|
|
373
|
+
const first = idea.title.trim().charAt(0).toUpperCase();
|
|
374
|
+
const letter = /[A-Z]/.test(first) ? first : "#";
|
|
375
|
+
const list = map.get(letter) ?? [];
|
|
376
|
+
list.push(idea);
|
|
377
|
+
map.set(letter, list);
|
|
378
|
+
}
|
|
379
|
+
return map;
|
|
380
|
+
}
|
|
381
|
+
/** Unique subtype labels per competition type (for host subtype dropdown). */
|
|
382
|
+
export function competitionSubtypesByType() {
|
|
383
|
+
const out = {};
|
|
384
|
+
for (const idea of COMPETITION_IDEAS) {
|
|
385
|
+
const existing = out[idea.competitionType] ?? [];
|
|
386
|
+
if (!existing.includes(idea.subtype)) {
|
|
387
|
+
existing.push(idea.subtype);
|
|
388
|
+
}
|
|
389
|
+
out[idea.competitionType] = existing;
|
|
390
|
+
}
|
|
391
|
+
for (const key of Object.keys(out)) {
|
|
392
|
+
out[key].sort((a, b) => a.localeCompare(b));
|
|
393
|
+
}
|
|
394
|
+
return out;
|
|
395
|
+
}
|
|
396
|
+
export function filterCompetitionIdeas(query) {
|
|
397
|
+
const q = query.trim().toLowerCase();
|
|
398
|
+
if (!q)
|
|
399
|
+
return competitionIdeasSorted();
|
|
400
|
+
return competitionIdeasSorted().filter((idea) => idea.title.toLowerCase().includes(q) ||
|
|
401
|
+
idea.description.toLowerCase().includes(q) ||
|
|
402
|
+
idea.subtype.toLowerCase().includes(q) ||
|
|
403
|
+
(idea.tags?.some((t) => t.toLowerCase().includes(q)) ?? false));
|
|
404
|
+
}
|
|
405
|
+
//# sourceMappingURL=competitionIdeas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competitionIdeas.js","sourceRoot":"","sources":["../src/competitionIdeas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAc9D,MAAM,CAAC,MAAM,iBAAiB,GAAsB;IAClD;QACE,EAAE,EAAE,aAAa;QACjB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,2DAA2D;QACxE,eAAe,EAAE,eAAe,CAAC,KAAK;QACtC,OAAO,EAAE,yCAAyC;QAClD,WAAW,EAAE,WAAW,CAAC,MAAM;QAC/B,IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,CAAC;KAC5B;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,kEAAkE;QAC/E,eAAe,EAAE,eAAe,CAAC,eAAe;QAChD,OAAO,EAAE,sBAAsB;QAC/B,WAAW,EAAE,WAAW,CAAC,aAAa;QACtC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KACvB;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,kEAAkE;QAC/E,eAAe,EAAE,eAAe,CAAC,UAAU;QAC3C,OAAO,EAAE,2BAA2B;QACpC,WAAW,EAAE,WAAW,CAAC,MAAM;QAC/B,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;KACxB;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,yDAAyD;QACtE,eAAe,EAAE,eAAe,CAAC,YAAY;QAC7C,OAAO,EAAE,kBAAkB;QAC3B,WAAW,EAAE,WAAW,CAAC,aAAa;QACtC,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC;KACzB;IACD;QACE,EAAE,EAAE,cAAc;Q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QAC9B,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,QAAQ,CAAC;IACvC,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,CAAsB,EAAE,CAAC;QACxD,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,KAAa;IAClD,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,CAAC;QAAE,OAAO,sBAAsB,EAAE,CAAC;IACxC,OAAO,sBAAsB,EAAE,CAAC,MAAM,CACpC,CAAC,IAAI,EAAE,EAAE,CACP,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC1C,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QACtC,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CACjE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { JudgingType } from "@prisma/client";
|
|
2
|
+
/** Judging modes disallowed for new competitions (lottery / auction-adjacent). */
|
|
3
|
+
export declare const DISALLOWED_JUDGING_TYPES_FOR_NEW: ReadonlySet<JudgingType>;
|
|
4
|
+
export declare const DISALLOWED_JUDGING_TYPE_MESSAGE = "Random draw and highest-bid judging are not supported on Bash. Use host choice, skill judging, audience vote, metrics, first come, or tournament bracket.";
|
|
5
|
+
export declare function isDisallowedJudgingTypeForNew(judgingType: JudgingType | null | undefined): boolean;
|
|
6
|
+
export declare function assertAllowedJudgingTypeForNew(judgingType: JudgingType | null | undefined): void;
|
|
7
|
+
/** Default judging type for new competitions. */
|
|
8
|
+
export declare const DEFAULT_COMPETITION_JUDGING_TYPE: JudgingType;
|
|
9
|
+
export declare function normalizeJudgingTypeForSave(judgingType: JudgingType | null | undefined, isExistingLegacy: boolean): JudgingType;
|
|
10
|
+
//# sourceMappingURL=competitionValidation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competitionValidation.d.ts","sourceRoot":"","sources":["../src/competitionValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,kFAAkF;AAClF,eAAO,MAAM,gCAAgC,EAAE,WAAW,CAAC,WAAW,CAGpE,CAAC;AAEH,eAAO,MAAM,+BAA+B,8JACiH,CAAC;AAE9J,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAC1C,OAAO,CAGT;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAC1C,IAAI,CAIN;AAED,iDAAiD;AACjD,eAAO,MAAM,gCAAgC,EAAE,WACrB,CAAC;AAE3B,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EAC3C,gBAAgB,EAAE,OAAO,GACxB,WAAW,CAQb"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JudgingType } from "@prisma/client";
|
|
2
|
+
/** Judging modes disallowed for new competitions (lottery / auction-adjacent). */
|
|
3
|
+
export const DISALLOWED_JUDGING_TYPES_FOR_NEW = new Set([
|
|
4
|
+
JudgingType.RANDOM_DRAW,
|
|
5
|
+
JudgingType.HIGHEST_BID,
|
|
6
|
+
]);
|
|
7
|
+
export const DISALLOWED_JUDGING_TYPE_MESSAGE = "Random draw and highest-bid judging are not supported on Bash. Use host choice, skill judging, audience vote, metrics, first come, or tournament bracket.";
|
|
8
|
+
export function isDisallowedJudgingTypeForNew(judgingType) {
|
|
9
|
+
if (!judgingType)
|
|
10
|
+
return false;
|
|
11
|
+
return DISALLOWED_JUDGING_TYPES_FOR_NEW.has(judgingType);
|
|
12
|
+
}
|
|
13
|
+
export function assertAllowedJudgingTypeForNew(judgingType) {
|
|
14
|
+
if (isDisallowedJudgingTypeForNew(judgingType)) {
|
|
15
|
+
throw new Error(DISALLOWED_JUDGING_TYPE_MESSAGE);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/** Default judging type for new competitions. */
|
|
19
|
+
export const DEFAULT_COMPETITION_JUDGING_TYPE = JudgingType.HOST_CHOOSES;
|
|
20
|
+
export function normalizeJudgingTypeForSave(judgingType, isExistingLegacy) {
|
|
21
|
+
if (!judgingType) {
|
|
22
|
+
return isExistingLegacy ? JudgingType.RANDOM_DRAW : DEFAULT_COMPETITION_JUDGING_TYPE;
|
|
23
|
+
}
|
|
24
|
+
if (!isExistingLegacy && isDisallowedJudgingTypeForNew(judgingType)) {
|
|
25
|
+
throw new Error(DISALLOWED_JUDGING_TYPE_MESSAGE);
|
|
26
|
+
}
|
|
27
|
+
return judgingType;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=competitionValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"competitionValidation.js","sourceRoot":"","sources":["../src/competitionValidation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,kFAAkF;AAClF,MAAM,CAAC,MAAM,gCAAgC,GAA6B,IAAI,GAAG,CAAC;IAChF,WAAW,CAAC,WAAW;IACvB,WAAW,CAAC,WAAW;CACxB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAC1C,2JAA2J,CAAC;AAE9J,MAAM,UAAU,6BAA6B,CAC3C,WAA2C;IAE3C,IAAI,CAAC,WAAW;QAAE,OAAO,KAAK,CAAC;IAC/B,OAAO,gCAAgC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,8BAA8B,CAC5C,WAA2C;IAE3C,IAAI,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,iDAAiD;AACjD,MAAM,CAAC,MAAM,gCAAgC,GAC3C,WAAW,CAAC,YAAY,CAAC;AAE3B,MAAM,UAAU,2BAA2B,CACzC,WAA2C,EAC3C,gBAAyB;IAEzB,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,gBAAgB,CAAC,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC,gCAAgC,CAAC;IACvF,CAAC;IACD,IAAI,CAAC,gBAAgB,IAAI,6BAA6B,CAAC,WAAW,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/dist/definitions.d.ts
CHANGED
|
@@ -457,6 +457,8 @@ export interface LinkedInAuthData {
|
|
|
457
457
|
export interface NumberOfTicketsForDate {
|
|
458
458
|
numberOfTickets: number;
|
|
459
459
|
ticketDateTime: DateTimeArgType;
|
|
460
|
+
/** Pay-what-you-can tier: buyer-chosen unit price in cents (min = tier.price). */
|
|
461
|
+
unitPriceCents?: number;
|
|
460
462
|
}
|
|
461
463
|
export interface TicketTierAvailability {
|
|
462
464
|
available: boolean;
|
|
@@ -608,6 +610,8 @@ export interface StripeCreateBashEventTicketsCheckoutSessionArgs extends UtmFiel
|
|
|
608
610
|
attributionRef?: string;
|
|
609
611
|
/** Required when the event has `waiverRequired` — buyer attested to host waiver/terms */
|
|
610
612
|
waiverAccepted?: boolean;
|
|
613
|
+
/** EventGroup id when purchasing a group package for the crew */
|
|
614
|
+
groupId?: string;
|
|
611
615
|
}
|
|
612
616
|
export interface StripeCreateBashEventDonationCheckoutSessionArgs extends UtmFields {
|
|
613
617
|
bashEventId: string;
|