@bash-app/bash-common 29.38.0 → 29.40.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.38.0",
3
+ "version": "29.40.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",
@@ -943,9 +943,13 @@ model ServiceSubscription {
943
943
  }
944
944
 
945
945
  model ServiceListingSubscription {
946
- id String @id @default(cuid())
947
- stripeCheckoutSessionId String? @unique
948
- stripeSubscriptionId String? @unique
946
+ id String @id @default(cuid())
947
+ stripeAccountId String
948
+ stripeAccount StripeAccount @relation(fields: [stripeAccountId], references: [id], onDelete: Restrict, onUpdate: Restrict)
949
+ stripeCheckoutSessionId String? @unique
950
+ stripeSubscriptionId String? @unique
951
+
952
+ subscriptionStatus ServiceSubscriptionStatus @default(None)
949
953
 
950
954
  serviceId String? @unique
951
955
  service Service? @relation(fields: [serviceId], references: [id], onDelete: Restrict)
@@ -1056,7 +1060,8 @@ model StripeAccount {
1056
1060
  createdAt DateTime @default(now())
1057
1061
  updatedAt DateTime @updatedAt
1058
1062
 
1059
- service Service[]
1063
+ service Service[]
1064
+ ServiceListingSubscription ServiceListingSubscription[]
1060
1065
 
1061
1066
  @@index([ownerId])
1062
1067
  }
@@ -1182,9 +1187,9 @@ model Venue {
1182
1187
  vibe String?
1183
1188
  dress String?
1184
1189
 
1185
- pricingPlan VenuePricingPlan?
1186
- subscriptionStatus SubscriptionStatus?
1187
- subscriptionStartDate DateTime?
1190
+ pricingPlan VenuePricingPlan?
1191
+ // subscriptionStatus SubscriptionStatus?
1192
+ // subscriptionStartDate DateTime?
1188
1193
 
1189
1194
  bashEvents BashEvent[]
1190
1195
  }
@@ -1215,7 +1220,8 @@ enum VenuePricingPlan {
1215
1220
  Subscription
1216
1221
  }
1217
1222
 
1218
- enum SubscriptionStatus {
1223
+ enum ServiceSubscriptionStatus {
1224
+ None
1219
1225
  Active
1220
1226
  Canceled
1221
1227
  Suspended
@@ -20,7 +20,7 @@ export const ServiceCancelationPolicyData: ServiceCancelationPolicyMap = {
20
20
  [ServiceCancelationPolicyOption.None]: {
21
21
  name: "None",
22
22
  refundPolicy: [],
23
- description: "No cancelation policy."
23
+ description: "No cancellation policy."
24
24
  },
25
25
  [ServiceCancelationPolicyOption.VeryFlexible]: {
26
26
  name: "Very Flexible",
@@ -102,15 +102,17 @@ Object.keys(ServiceCancelationPolicyData).filter((policyKey) => policyKey as Ser
102
102
 
103
103
  export type ServicePromoCodeType = "PerUser" | "PerService";
104
104
 
105
+ export type ServicePromoCodeDuration = {
106
+ days?: number;
107
+ };
108
+
105
109
  export type ServicePromoCode = {
106
110
  code?: string;
107
111
  maxRedemptions?: number;
108
112
  isTrial?: boolean;
109
113
  discountPercentageFee?: number;
110
114
  discountMonthlyFee?: number;
111
- duration: {
112
- days?: number;
113
- },
115
+ duration: ServicePromoCodeDuration,
114
116
  type: ServicePromoCodeType;
115
117
  automaticallyApplied: boolean;
116
118
  };