@bash-app/bash-common 13.4.0 → 13.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "13.4.0",
3
+ "version": "13.6.0",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -134,10 +134,10 @@ model Reminder {
134
134
  }
135
135
 
136
136
  model BashEventPromoCode {
137
- id String @id @default(cuid())
138
- bashEventId String
139
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
137
+ id String @id @default(cuid())
140
138
  code String
139
+ ticketTierId String
140
+ ticketTier TicketTier @relation(fields: [ticketTierId], references: [id])
141
141
  stripeCouponId String?
142
142
  discountAmountInCents Int?
143
143
  discountAmountPercentage Int?
@@ -145,7 +145,7 @@ model BashEventPromoCode {
145
145
  redeemBy DateTime?
146
146
  usedBy User[]
147
147
 
148
- @@unique([bashEventId, code])
148
+ @@unique([ticketTierId, code])
149
149
  }
150
150
 
151
151
  model BashNotification {
@@ -196,14 +196,14 @@ model Invitation {
196
196
  }
197
197
 
198
198
  model BashEvent {
199
- id String @id @default(cuid())
199
+ id String @id @default(cuid())
200
200
  title String
201
201
  creatorId String
202
- creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
202
+ creator User @relation("CreatedEvent", fields: [creatorId], references: [id], onDelete: Cascade)
203
203
  description String?
204
- eventType String @default("Other")
205
- startDateTime DateTime? @default(now())
206
- endDateTime DateTime? @default(now())
204
+ eventType String @default("Other")
205
+ startDateTime DateTime? @default(now())
206
+ endDateTime DateTime? @default(now())
207
207
  ticketTiers TicketTier[]
208
208
  targetAudience TargetAudience?
209
209
  amountOfGuests AmountOfGuests?
@@ -215,18 +215,18 @@ model BashEvent {
215
215
  notAllowed String?
216
216
  nonProfit Boolean?
217
217
  nonProfitId String?
218
- privacy Privacy @default(Public)
218
+ privacy Privacy @default(Public)
219
219
  tickets Ticket[]
220
220
  reviews Review[]
221
221
  sponsorships SponsoredEvent[]
222
222
  investments Investment[]
223
223
  capacity Int?
224
224
  location String?
225
- status BashStatus @default(Draft)
225
+ status BashStatus @default(Draft)
226
226
  tags String[]
227
227
  coverPhoto String?
228
228
  media Media[]
229
- club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
229
+ club Club? @relation(fields: [clubId], references: [id], onDelete: SetNull)
230
230
  clubId String?
231
231
  links EventLink[]
232
232
  competitions Competition[]
@@ -240,7 +240,6 @@ model BashEvent {
240
240
  eventTasks EventTask[]
241
241
  videoLink String?
242
242
  subtitle String?
243
- promoCodes BashEventPromoCode[]
244
243
  }
245
244
 
246
245
  model Checkout {
@@ -257,18 +256,19 @@ model Checkout {
257
256
  }
258
257
 
259
258
  model TicketTier {
260
- id String @id @default(cuid())
259
+ id String @id @default(cuid())
261
260
  bashEventId String
262
- bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
261
+ bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
263
262
  tickets Ticket[]
264
263
  waitList User[]
265
- price Int @default(0)
266
- title String @default("Free")
264
+ price Int @default(0)
265
+ title String @default("Free")
267
266
  sortOrder Int?
268
267
  description String?
269
- maximumNumberOfTickets Int @default(100)
268
+ maximumNumberOfTickets Int @default(100)
270
269
  isDonationTier Boolean?
271
270
  hidden Boolean?
271
+ promoCodes BashEventPromoCode[]
272
272
 
273
273
  @@unique([bashEventId, title])
274
274
  }
@@ -96,6 +96,9 @@ export type FilterFields = {
96
96
  crowd: string[];
97
97
  vibe: string[];
98
98
  included: string[];
99
+ hostRating: string[];
100
+ specialOffers: string[];
101
+ eventFormat: string[];
99
102
  };
100
103
 
101
104
  export interface DeletedAndHiddenTiers {
@@ -44,11 +44,17 @@ export interface BashEventExt extends BashEvent {
44
44
  ticketTiers: TicketTierExt[];
45
45
  media: Media[];
46
46
  eventTasks: EventTask[];
47
- promoCodes?: BashEventPromoCode[];
48
47
  tickets?: Ticket[]; // Only include tickets that the user has purchased and not all tickets (could be thousands + privacy)
49
48
  // Do not include in fetch. Could be hundreds of these
50
49
  invitations: InvitationExt[];
51
50
  youtubeUrl?: string;
51
+ price?: string;
52
+ ageRequirement?: string;
53
+ crowd?: string;
54
+ included?: string;
55
+ hostRating?: string;
56
+ specialOffers?: string;
57
+ eventFormat?: string;
52
58
  }
53
59
 
54
60
  export const BASH_EVENT_DATA_TO_SELECT = {
@@ -64,7 +70,6 @@ export const BASH_EVENT_DATA_TO_INCLUDE = {
64
70
  ticketTiers: true,
65
71
  eventTasks: true,
66
72
  media: true,
67
- promoCodes: true,
68
73
  }
69
74
 
70
75
  export const BASH_EVENT_DATA_TO_CLONE = [
@@ -74,7 +79,6 @@ export const BASH_EVENT_DATA_TO_CLONE = [
74
79
  'media',
75
80
  'recurrence',
76
81
  'invitations',
77
- 'promoCodes',
78
82
  ] as const;
79
83
 
80
84
  export interface BashNotificationExt extends BashNotification {
@@ -205,6 +209,7 @@ export const ASSOCIATED_BASH_DATA_TO_INCLUDE = {
205
209
  export interface TicketTierExt extends TicketTier {
206
210
  bashEvent: BashEvent;
207
211
  tickets: TicketExt[];
212
+ promoCodes?: BashEventPromoCode[];
208
213
  }
209
214
 
210
215
  export interface TicketExt extends Ticket {