@bash-app/bash-common 30.1.0 → 30.3.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.
@@ -0,0 +1,9 @@
1
+ {
2
+ "cSpell.words": [
3
+ "autoincrement",
4
+ "bashfeed",
5
+ "cuid",
6
+ "Pinterest",
7
+ "Tradeshow"
8
+ ]
9
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bash-app/bash-common",
3
- "version": "30.1.0",
3
+ "version": "30.3.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",
@@ -77,7 +77,7 @@ model Competition {
77
77
  owner User @relation(fields: [userId], references: [id], onDelete: Cascade)
78
78
  prizes Prize[]
79
79
  userId String
80
- sponser CompetitionSponsor[]
80
+ sponsor CompetitionSponsor[]
81
81
  bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
82
82
  bashEventId String
83
83
  numberOfPrizes Int
@@ -99,7 +99,8 @@ model EventTask {
99
99
  creator User @relation(fields: [creatorId], references: [id], onDelete: Cascade)
100
100
  bashEventId String
101
101
  bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
102
- description String
102
+ title String
103
+ description String?
103
104
  assignedToId String?
104
105
  assignedTo User? @relation("TasksAssignedToMe", fields: [assignedToId], references: [id], onDelete: Cascade)
105
106
  status TaskStatus?
@@ -111,6 +112,8 @@ enum TaskStatus {
111
112
  Accepted
112
113
  Rejected
113
114
  Completed
115
+ Assigned
116
+ Open
114
117
  }
115
118
 
116
119
  model Reminder {
@@ -280,7 +283,7 @@ model TicketTier {
280
283
  bashEvent BashEvent @relation(fields: [bashEventId], references: [id], onDelete: Cascade)
281
284
  tickets Ticket[]
282
285
  waitList User[]
283
- price Int @default(0) //stored multipled by 100 to allow for decimals
286
+ price Int @default(0) //stored multiplied by 100 to allow for decimals
284
287
  title String @default("Free")
285
288
  sortOrder Int?
286
289
  description String?
@@ -931,7 +934,7 @@ model User {
931
934
  bashEventPromoCodesIUsed BashEventPromoCode[]
932
935
  // bookingForMe Booking[]
933
936
  userSubscription UserSubscription?
934
- // serviceSubcriptions ServiceSubscription[]
937
+ // serviceSubscriptions ServiceSubscription[]
935
938
  volunteerService VolunteerService[]
936
939
  stripeAccounts StripeAccount[]
937
940
  userPromoCodeRedemption UserPromoCodeRedemption[]
@@ -994,7 +997,7 @@ model AssociatedService {
994
997
  @@unique([ownerEmail, serviceId])
995
998
  }
996
999
 
997
- enum ServiceCancelationPolicy {
1000
+ enum ServiceCancellationPolicy {
998
1001
  None
999
1002
  VeryFlexible
1000
1003
  Flexible
@@ -1126,7 +1129,7 @@ model Service {
1126
1129
  emergencyContact String?
1127
1130
  contactDetails String?
1128
1131
  // rates Rate[] @relation("MultipleRates")
1129
- cancellationPolicy ServiceCancelationPolicy? @default(None)
1132
+ cancellationPolicy ServiceCancellationPolicy? @default(None)
1130
1133
  // refundPolicy String?
1131
1134
  // insurancePolicy String?
1132
1135
  // hoursOfOperation Json? @default("{}")
@@ -516,11 +516,12 @@ export const VENUE_DATA_TO_REMOVE: RemoveCommonProperties<
516
516
  //-----------------------------------------
517
517
 
518
518
  export interface BashNotificationExt extends BashNotification {
519
- creator?: PublicUser;
520
519
  bashEvent?: BashEvent;
520
+ creator?: PublicUser;
521
+ eventTask?: EventTask;
522
+ userAction?: string;
521
523
  service?: ServiceExt;
522
524
  serviceBooking?: ServiceBookingExt;
523
- eventTask?: EventTask;
524
525
  invitation?: Invitation;
525
526
  reminders?: Reminder[];
526
527
  }
@@ -1,33 +1,33 @@
1
1
  import {
2
- ServiceCancelationPolicy as ServiceCancelationPolicyOption,
2
+ ServiceCancellationPolicy as ServiceCancellationPolicyOption,
3
3
  ServiceSubscriptionStatus,
4
4
  ServiceTypes,
5
5
  } from "@prisma/client";
6
6
  import { ServiceExt } from "../../extendedSchemas";
7
7
 
8
- export type ServiceCancelationRefundPolicy = {
8
+ export type ServiceCancellationRefundPolicy = {
9
9
  days?: number;
10
10
  hours?: number;
11
11
  refundPercentage: number;
12
12
  };
13
13
 
14
- export type ServiceCancelationPolicyData = {
14
+ export type ServiceCancellationPolicyData = {
15
15
  name: string;
16
16
  description?: string;
17
- refundPolicy: ServiceCancelationRefundPolicy[];
17
+ refundPolicy: ServiceCancellationRefundPolicy[];
18
18
  };
19
19
 
20
- export type ServiceCancelationPolicyMap = {
21
- [key in ServiceCancelationPolicyOption]: ServiceCancelationPolicyData;
20
+ export type ServiceCancellationPolicyMap = {
21
+ [key in ServiceCancellationPolicyOption]: ServiceCancellationPolicyData;
22
22
  };
23
23
 
24
- export const SERVICE_CANCELATION_POLICY_DATA: ServiceCancelationPolicyMap = {
25
- [ServiceCancelationPolicyOption.None]: {
24
+ export const SERVICE_CANCELLATION_POLICY_DATA: ServiceCancellationPolicyMap = {
25
+ [ServiceCancellationPolicyOption.None]: {
26
26
  name: "None",
27
27
  refundPolicy: [],
28
28
  description: "No cancellation policy.",
29
29
  },
30
- [ServiceCancelationPolicyOption.VeryFlexible]: {
30
+ [ServiceCancellationPolicyOption.VeryFlexible]: {
31
31
  name: "Very Flexible",
32
32
  refundPolicy: [
33
33
  {
@@ -36,7 +36,7 @@ export const SERVICE_CANCELATION_POLICY_DATA: ServiceCancelationPolicyMap = {
36
36
  },
37
37
  ],
38
38
  },
39
- [ServiceCancelationPolicyOption.Flexible]: {
39
+ [ServiceCancellationPolicyOption.Flexible]: {
40
40
  name: "Flexible",
41
41
  refundPolicy: [
42
42
  {
@@ -49,7 +49,7 @@ export const SERVICE_CANCELATION_POLICY_DATA: ServiceCancelationPolicyMap = {
49
49
  },
50
50
  ],
51
51
  },
52
- [ServiceCancelationPolicyOption.Standard30Day]: {
52
+ [ServiceCancellationPolicyOption.Standard30Day]: {
53
53
  name: "Standard 30 Day",
54
54
  refundPolicy: [
55
55
  {
@@ -62,7 +62,7 @@ export const SERVICE_CANCELATION_POLICY_DATA: ServiceCancelationPolicyMap = {
62
62
  },
63
63
  ],
64
64
  },
65
- [ServiceCancelationPolicyOption.Standard90Day]: {
65
+ [ServiceCancellationPolicyOption.Standard90Day]: {
66
66
  name: "Very Flexible",
67
67
  refundPolicy: [
68
68
  {
@@ -78,7 +78,7 @@ export const SERVICE_CANCELATION_POLICY_DATA: ServiceCancelationPolicyMap = {
78
78
  } as const;
79
79
 
80
80
  function generateDescription(
81
- refundPolicy: ServiceCancelationRefundPolicy[]
81
+ refundPolicy: ServiceCancellationRefundPolicy[]
82
82
  ): string {
83
83
  const descriptions = refundPolicy.map((policy, index) => {
84
84
  const unit = policy.days ? "days" : "hours";
@@ -110,16 +110,16 @@ function generateDescription(
110
110
  return descriptions.join(" ");
111
111
  }
112
112
 
113
- Object.keys(SERVICE_CANCELATION_POLICY_DATA)
113
+ Object.keys(SERVICE_CANCELLATION_POLICY_DATA)
114
114
  .filter(
115
115
  (policyKey) =>
116
- (policyKey as ServiceCancelationPolicyOption) !=
117
- ServiceCancelationPolicyOption.None
116
+ (policyKey as ServiceCancellationPolicyOption) !=
117
+ ServiceCancellationPolicyOption.None
118
118
  )
119
119
  .forEach((policyKey) => {
120
120
  const policy =
121
- SERVICE_CANCELATION_POLICY_DATA[
122
- policyKey as ServiceCancelationPolicyOption
121
+ SERVICE_CANCELLATION_POLICY_DATA[
122
+ policyKey as ServiceCancellationPolicyOption
123
123
  ];
124
124
  policy.description = generateDescription(policy.refundPolicy);
125
125
  });