@bash-app/bash-common 29.57.0 → 29.59.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": "29.57.0",
3
+ "version": "29.59.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",
@@ -102,10 +102,10 @@ export const FRONT_END_USER_DATA_TO_SELECT = {
102
102
  reviews: true,
103
103
  userRating: true,
104
104
  contacts: true,
105
- accepted: true, // Newly added field
106
- boughtTicket: true, // Newly added field
107
- noPay: true, // Newly added field
108
- supportedEvent: true, // Newly added field
105
+ accepted: true,
106
+ boughtTicket: true,
107
+ noPay: true,
108
+ supportedEvent: true,
109
109
  } satisfies Prisma.UserSelect;
110
110
 
111
111
  export const PRIVATE_USER_ACCOUNT_TO_SELECT = {
@@ -126,7 +126,7 @@ export interface BashEventExt extends BashEvent {
126
126
  amountOfGuests?: AmountOfGuests;
127
127
  recurrence?: Recurrence;
128
128
  creator?: PublicUser;
129
- ticketTiers: TicketTierExt[];
129
+ ticketTiers?: TicketTierExt[];
130
130
  media: Media[];
131
131
  eventTasks: EventTask[];
132
132
  tickets?: Ticket[]; // Only include tickets that the user has purchased and not all tickets (could be thousands + privacy)
@@ -530,7 +530,7 @@ export interface InvitationExtraData extends Invitation {
530
530
  }
531
531
 
532
532
  export interface AssociatedBashExt extends AssociatedBash {
533
- bashEvent: Partial<BashEventExt>;
533
+ bashEvent: BashEventExt;
534
534
  invitation?: Partial<InvitationExt>;
535
535
  }
536
536
 
@@ -7,7 +7,7 @@ export function findPromoCodeFromBashEvent(bashEvent: BashEventExt | undefined |
7
7
  if (!promoCodeId) {
8
8
  return;
9
9
  }
10
- if (bashEvent?.ticketTiers.length) {
10
+ if (bashEvent?.ticketTiers?.length) {
11
11
  for (const tier of bashEvent?.ticketTiers) {
12
12
  const foundPromoCode = tier.promoCodes.find((promoCode) => promoCode.id === promoCodeId);
13
13
  if (foundPromoCode) {
@@ -23,7 +23,7 @@ export function getPromoCodesFromBashEvent(bashEvent: BashEventExt | undefined |
23
23
  }
24
24
 
25
25
  export function updatePromoCodesOnBashEventTicketTiers(bashEvent: BashEventExt, promoCodes: BashEventPromoCode[]): void {
26
- bashEvent.ticketTiers.forEach((tier) => {
26
+ bashEvent.ticketTiers?.forEach((tier) => {
27
27
  tier.promoCodes = promoCodes.filter((pc) => tier.id === pc.ticketTierId);
28
28
  });
29
29
  }