@bash-app/bash-common 30.108.0 → 30.110.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.
@@ -140,7 +140,7 @@ export const SERVICE_SUBSCRIPTION_TIERS = {
140
140
  Ally: {
141
141
  name: "Ally",
142
142
  description: "Enhanced features for growing entertainment and event service providers",
143
- price: 14,
143
+ price: 14, // NOTE: This is a FALLBACK ONLY - actual price fetched from Stripe via API
144
144
  features: [
145
145
  "Up to 5 service listings",
146
146
  "Unlimited photos & videos",
@@ -164,7 +164,7 @@ export const SERVICE_SUBSCRIPTION_TIERS = {
164
164
  Partner: {
165
165
  name: "Partner",
166
166
  description: "Professional tools for established vendors and service providers",
167
- price: 49,
167
+ price: 49, // NOTE: This is a FALLBACK ONLY - actual price fetched from Stripe via API
168
168
  features: [
169
169
  "Unlimited service listings",
170
170
  "Unlimited photos & videos",
@@ -189,7 +189,7 @@ export const SERVICE_SUBSCRIPTION_TIERS = {
189
189
  Patron: {
190
190
  name: "Patron",
191
191
  description: "Premium enterprise solution for venues and large organizations",
192
- price: 99,
192
+ price: 99, // NOTE: This is a FALLBACK ONLY - actual price fetched from Stripe via API
193
193
  features: [
194
194
  "Everything in Partner +",
195
195
  "Featured first (top placement)",
@@ -11,6 +11,8 @@ import {
11
11
  BlogTag,
12
12
  Checkout,
13
13
  Competition,
14
+ CompetitionParticipant,
15
+ CompetitionVote,
14
16
  Contact,
15
17
  Coordinates,
16
18
  Demerit,
@@ -113,7 +115,9 @@ export const FRONT_END_USER_DATA_TO_SELECT = {
113
115
  givenName: true,
114
116
  familyName: true,
115
117
  image: true,
118
+ imageUpdatedAt: true,
116
119
  uploadedImage: true,
120
+ uploadedImageUpdatedAt: true,
117
121
  isSuperUser: true,
118
122
  socialMediaProfiles: true,
119
123
  city: true,
@@ -162,6 +166,8 @@ export interface PrizeExt extends Prize {
162
166
 
163
167
  export interface CompetitionExt extends Competition {
164
168
  prizes: PrizeExt[];
169
+ participants?: CompetitionParticipant[];
170
+ votes?: CompetitionVote[];
165
171
  }
166
172
 
167
173
  export interface BashEventExt extends BashEvent {
@@ -226,6 +232,13 @@ export const BASH_EVENT_DATA_TO_INCLUDE = {
226
232
  },
227
233
  },
228
234
  },
235
+ participants: {
236
+ include: {
237
+ user: {
238
+ select: FRONT_END_USER_DATA_TO_SELECT,
239
+ },
240
+ },
241
+ },
229
242
  },
230
243
  },
231
244
  } satisfies Prisma.BashEventInclude;
@@ -30,6 +30,24 @@ export function getUserImage(contactOrUser: CombinedUserOrContact | undefined):
30
30
  return noProfilePicture;
31
31
  }
32
32
  const user = contactOrUser as CombinedUser;
33
+
34
+ // Prioritize the most recently updated image for best UX
35
+ // If both images exist, compare timestamps
36
+ if (user.uploadedImage && user.image) {
37
+ const uploadedTime = user.uploadedImageUpdatedAt ? new Date(user.uploadedImageUpdatedAt).getTime() : 0;
38
+ const googleTime = user.imageUpdatedAt ? new Date(user.imageUpdatedAt).getTime() : 0;
39
+
40
+ // Return the most recently updated image
41
+ if (uploadedTime > googleTime) {
42
+ return user.uploadedImage;
43
+ } else if (googleTime > 0) {
44
+ return user.image;
45
+ }
46
+ // If no timestamps, fall back to uploadedImage (existing behavior for backward compatibility)
47
+ return user.uploadedImage;
48
+ }
49
+
50
+ // If only one image exists, return it
33
51
  return user.uploadedImage ?? user.image ?? noProfilePicture;
34
52
  }
35
53