@bash-app/bash-common 29.19.18 → 29.19.20

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.19.18",
3
+ "version": "29.19.20",
4
4
  "description": "Common data and scripts to use on the frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -43,4 +43,4 @@
43
43
  "tslib": "^2.6.2",
44
44
  "typescript": "^5.2.2"
45
45
  }
46
- }
46
+ }
@@ -227,8 +227,8 @@ model BashEvent {
227
227
  dateTimePublished DateTime?
228
228
  comments BashComment[]
229
229
  includedItems String[]
230
- associatedBashesReferencingMe AssociatedBash[] //maybe rename later to AssociatedWithABash
231
- associatedServicesReferencingMe Service[] //maybe rename later to AssociatedWithAService
230
+ associatedBashesReferencingMe AssociatedBash[] // maybe rename later to AssociatedWithABash
231
+ associatedServicesReferencingMe Service[] // maybe rename later to AssociatedWithAService
232
232
  bashNotificationsReferencingMe BashNotification[]
233
233
  checkouts Checkout[]
234
234
  eventTasks EventTask[]
@@ -371,8 +371,8 @@ model Rate {
371
371
  maximumHourCount Int @default(24)
372
372
  isDonationTier Boolean?
373
373
  hidden Boolean?
374
- // promoCodes BashEventPromoCode[]
375
374
 
375
+ // promoCodes BashEventPromoCode[]
376
376
  @@unique([bashEventId, title])
377
377
  }
378
378
 
@@ -917,7 +917,7 @@ model Contact {
917
917
  @@index([contactEmail])
918
918
  }
919
919
 
920
- //anyone that is invited to the bash, is an organizer of a bash, and or the creator/owner of the bash...for having others (including services) edit or post about a bash in the bashfeed
920
+ // anyone that is invited to the bash, is an organizer of a bash, and or the creator/owner of the bash...for having others (including services) edit or post about a bash in the bashfeed
921
921
  model AssociatedBash {
922
922
  id String @id @default(cuid())
923
923
  bashEventId String
@@ -934,7 +934,7 @@ model AssociatedBash {
934
934
  @@unique([ownerEmail, bashEventId])
935
935
  }
936
936
 
937
- //anyone that is invited to be an organizer of a service profile or is the creator/owner...for having others edit or post about a service in the bashfeed (but the service must be associated with a bash to post)
937
+ // anyone that is invited to be an organizer of a service profile or is the creator/owner...for having others edit or post about a service in the bashfeed (but the service must be associated with a bash to post)
938
938
  model AssociatedService {
939
939
  id String @id @default(cuid())
940
940
  serviceId String
@@ -950,7 +950,7 @@ model AssociatedService {
950
950
  @@unique([ownerEmail, serviceId])
951
951
  }
952
952
 
953
- //Common data for all services; 1-1 relation between each individual service model such as Venue
953
+ // Common data for all services; 1-1 relation between each individual service model such as Venue
954
954
  model Service {
955
955
  id String @id @default(cuid())
956
956
 
@@ -958,11 +958,11 @@ model Service {
958
958
  serviceStatus ServiceStatus @default(Draft)
959
959
  serviceCondition ServiceCondition @default(Pending)
960
960
 
961
- //current owner
961
+ // current owner
962
962
  ownerId String?
963
963
  owner User? @relation("OwnedService", fields: [ownerId], references: [id])
964
964
 
965
- //original creator
965
+ // original creator
966
966
  creatorId String?
967
967
  creator User? @relation("CreatedService", fields: [creatorId], references: [id])
968
968
 
@@ -975,7 +975,7 @@ model Service {
975
975
  serviceName String?
976
976
  tagline String?
977
977
 
978
- //this is not the business info but that which is associated with the service
978
+ // this is not the business info but that which is associated with the service
979
979
  place String?
980
980
  googlePlaceId String?
981
981
  street String?
@@ -985,7 +985,7 @@ model Service {
985
985
  country String?
986
986
  description String?
987
987
  // email String?
988
- // phone String?
988
+ // phone String?
989
989
 
990
990
  pocName String?
991
991
  pocPhoneNumber String?
@@ -1018,6 +1018,8 @@ model Service {
1018
1018
  media Media[]
1019
1019
  serviceLinks ServiceLink[]
1020
1020
 
1021
+ volunteerServiceId String?
1022
+ volunteerService VolunteerService? @relation(fields: [volunteerServiceId], references: [id])
1021
1023
  eventService EventService?
1022
1024
  entertainmentService EntertainmentService?
1023
1025
  vendor Vendor?
@@ -1028,7 +1030,7 @@ model Service {
1028
1030
 
1029
1031
  // googleReviews GoogleReview[]
1030
1032
 
1031
- bashEvent BashEvent[] //because a service needs to be associated with a bash to post to the bashfeed
1033
+ bashEvent BashEvent[] // because a service needs to be associated with a bash to post to the bashfeed
1032
1034
  }
1033
1035
 
1034
1036
  model StripeAccount {
@@ -1064,6 +1066,7 @@ model VolunteerService {
1064
1066
  description String?
1065
1067
  status VolunteerServiceStatus?
1066
1068
  media Media[]
1069
+ Service Service[]
1067
1070
  }
1068
1071
 
1069
1072
  model EventService {
@@ -1163,15 +1166,20 @@ model Venue {
1163
1166
  vibe String?
1164
1167
  dress String?
1165
1168
 
1166
- pricingPlan PricingPlan? @default(Percentage)
1167
- percentageRate Float? @default(0.15)
1169
+ pricingPlan VenuePricingPlan? @default(Percentage)
1168
1170
  subscriptionStatus SubscriptionStatus?
1169
1171
  subscriptionStartDate DateTime?
1170
1172
 
1171
1173
  bashEvents BashEvent[]
1172
1174
  }
1173
1175
 
1174
- enum PricingPlan {
1176
+ // model VenuePricing {
1177
+ // id String @id @default(cuid())
1178
+ // venuePricingPlan VenuePricingPlan
1179
+ // percentageRate Float? @default(0.15)
1180
+ // }
1181
+
1182
+ enum VenuePricingPlan {
1175
1183
  Percentage
1176
1184
  Subscription
1177
1185
  }
@@ -1273,9 +1281,9 @@ model ServiceRange {
1273
1281
  Sponsor Sponsor[]
1274
1282
  }
1275
1283
 
1276
- //different days of the week have different rates
1277
- //can block of certain dates of the year and days of the week as being closed
1278
- //can have special rates on different days of the year (single or range)
1284
+ // different days of the week have different rates
1285
+ // can block of certain dates of the year and days of the week as being closed
1286
+ // can have special rates on different days of the year (single or range)
1279
1287
  model Availability {
1280
1288
  id String @id @default(cuid())
1281
1289
  dayOfWeek Int
@@ -93,25 +93,15 @@ export const SERVICE_LINK_DATA_TO_INCLUDE = {
93
93
  link: true,
94
94
  } satisfies Prisma.ServiceLinkInclude;
95
95
 
96
- // export const SERVICE_DATA_TO_INCLUDE = {
97
- // stripeAccount: true,
98
- // availableDateTimes: true,
99
- // targetAudience: true,
100
- // media: true,
101
- // serviceLinks: {
102
- // include: SERVICE_LINK_DATA_TO_INCLUDE
103
- // },
104
- // // googleReviews: true,
105
- // } satisfies Prisma.ServiceInclude;
106
96
 
107
97
  // export type ServiceSpecificName = keyof Pick<
108
98
  // ServiceExt,
109
- // "eventService" |
110
- // "entertainmentService" |
111
- // "vendor" |
112
- // "exhibitor" |
113
- // "sponsor" |
114
- // "venue" |
99
+ // "eventService" |
100
+ // "entertainmentService" |
101
+ // "vendor" |
102
+ // "exhibitor" |
103
+ // "sponsor" |
104
+ // "venue" |
115
105
  // "organization"
116
106
  // >;
117
107
 
@@ -585,4 +575,4 @@ export interface IAddress {
585
575
  state: string;
586
576
  zipCode: string;
587
577
  country: string;
588
- }
578
+ }
@@ -105,6 +105,9 @@ export const SERVICE_DATA_TO_INCLUDE = {
105
105
  creator: {
106
106
  select: FRONT_END_USER_DATA_TO_SELECT
107
107
  },
108
+ owner: {
109
+ select: FRONT_END_USER_DATA_TO_SELECT
110
+ },
108
111
  targetAudience: true,
109
112
  // amountOfGuests: true,
110
113
  // recurrence: true,
@@ -222,15 +225,15 @@ export const EVENT_TASK_DATA_TO_INCLUDE = {
222
225
 
223
226
  //---------------Services------------------
224
227
  export interface ServiceExt extends Service {
225
- owner: PublicUser;
228
+ owner?: PublicUser | null;
226
229
 
227
- stripeAccount?: StripeAccount;
230
+ stripeAccount?: StripeAccount | null;
228
231
 
229
232
  availableDateTimes?: Availability[];
230
233
 
231
234
  bookings?: Booking[];
232
235
  rates?: Rate[];
233
- targetAudience?: TargetAudience;
236
+ targetAudience?: TargetAudience | null;
234
237
  media?: Media[];
235
238
  serviceLinks?: ServiceLinkExt[];
236
239
 
@@ -0,0 +1,24 @@
1
+ import { VenuePricingPlan as VenuePricingPlanOption } from "@prisma/client";
2
+
3
+ export type VenuePricingPlan = {
4
+ percentageFee: number;
5
+ monthlyFee: number;
6
+ flatFee: number;
7
+ };
8
+
9
+ export type VenuePricingPlanDataType = {
10
+ [key in VenuePricingPlanOption]: VenuePricingPlan;
11
+ };
12
+
13
+ export const VenuePricingPlanData: VenuePricingPlanDataType = {
14
+ [VenuePricingPlanOption.Percentage]: {
15
+ percentageFee: 0.15,
16
+ monthlyFee: 0.0,
17
+ flatFee: 0.0
18
+ },
19
+ [VenuePricingPlanOption.Subscription]: {
20
+ percentageFee: 0.0,
21
+ monthlyFee: 100.0,
22
+ flatFee: 0.0
23
+ }
24
+ };