@bash-app/bash-common 29.36.0 → 29.37.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.36.0",
3
+ "version": "29.37.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",
@@ -342,14 +342,6 @@ enum UserSubscriptionType {
342
342
  VIP
343
343
  }
344
344
 
345
- model ServiceSubscription {
346
- id String @id @default(cuid())
347
- ownerId String
348
- owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
349
- slots Int @default(0)
350
- stripeSubscriptionId String?
351
- }
352
-
353
345
  enum BookingStatus {
354
346
  Cancelled
355
347
  Completed
@@ -942,6 +934,20 @@ enum ServiceCancelationPolicy {
942
934
  Standard30Day
943
935
  }
944
936
 
937
+ model ServiceSubscription {
938
+ id String @id @default(cuid())
939
+ ownerId String
940
+ owner User @relation(fields: [ownerId], references: [id], onDelete: Cascade)
941
+ slots Int @default(0)
942
+ stripeSubscriptionId String?
943
+ }
944
+
945
+ model ServiceListingSubscription {
946
+ id String @id @default(cuid())
947
+ stripeSubscriptionId String?
948
+ service Service?
949
+ }
950
+
945
951
  // Common data for all services; 1-1 relation between each individual service model such as Venue
946
952
  model Service {
947
953
  id String @id @default(cuid())
@@ -1002,6 +1008,9 @@ model Service {
1002
1008
  stripeAccountId String?
1003
1009
  stripeAccount StripeAccount? @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict)
1004
1010
 
1011
+ serviceListingSubscriptionId String? @unique
1012
+ serviceListingSubscription ServiceListingSubscription? @relation(fields: [serviceListingSubscriptionId], references: [id])
1013
+
1005
1014
  targetAudienceId String? @unique
1006
1015
  targetAudience TargetAudience? @relation(fields: [targetAudienceId], references: [id], onDelete: Cascade)
1007
1016
 
@@ -112,6 +112,7 @@ export type ServicePromoCode = {
112
112
  days?: number;
113
113
  },
114
114
  type: ServicePromoCodeType;
115
+ automaticallyApplied: boolean;
115
116
  };
116
117
 
117
118
  export type ServicePromoCodeMap = {
@@ -31,13 +31,16 @@ export const VenuePricingPlanData: VenuePricingPlanMap = {
31
31
  } as const;
32
32
 
33
33
  export const VenuePromoCodes: ServicePromoCodeMap = {
34
- "Vnue3345": {
34
+ "Venue0001": {
35
35
  isTrial: true,
36
36
  duration: {
37
37
  days: 90
38
38
  },
39
- type: "PerUser"
39
+ type: "PerUser",
40
+ automaticallyApplied: true
40
41
  }
41
- };
42
+ } as const;
43
+
44
+ Object.entries(VenuePromoCodes).forEach(promoCode => promoCode[1].code = promoCode[0]);
42
45
 
43
- Object.entries(VenuePromoCodes).forEach(promoCode => promoCode[1].code = promoCode[0]);
46
+ export const VenueFreeTrialPromoCode = "Venue0001";