stentor-models 1.59.50 → 1.59.51

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.
@@ -2,7 +2,10 @@
2
2
  import { CrmResponse, ExternalLead } from "../Crm";
3
3
  import { DateTime, DateTimeRange } from "../DateTime";
4
4
  export type DayOfWeek = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday";
5
- export interface CrmServiceAvailabilityOptions {
5
+ /**
6
+ * Settings for the availability of the CRM service.
7
+ */
8
+ export interface CrmServiceAvailabilitySettings {
6
9
  /**
7
10
  * The days of the week they are available to schedule appointments through the scheduler.
8
11
  */
@@ -16,6 +19,16 @@ export interface CrmServiceAvailabilityOptions {
16
19
  */
17
20
  maxTotalDailyAppointments?: number;
18
21
  }
22
+ export interface CrmServiceTimeAvailability {
23
+ /**
24
+ * The time slot
25
+ */
26
+ range: DateTimeRange;
27
+ /**
28
+ * If the time slot is available.
29
+ */
30
+ available: boolean;
31
+ }
19
32
  export interface CrmServiceDateAvailability {
20
33
  /**
21
34
  * The number of appointments available for the given range.
@@ -24,13 +37,21 @@ export interface CrmServiceDateAvailability {
24
37
  */
25
38
  date: DateTime;
26
39
  /**
27
- * If the day is available for appointments.
40
+ * If the day has any availability for appointments.
28
41
  */
29
42
  available: boolean;
30
43
  /**
31
44
  * The number of remaining available appointments.
32
45
  */
33
46
  remainingAppointments?: number;
47
+ /**
48
+ * Blocked time slots for the day.
49
+ *
50
+ * These are only blocked times during their normal business hours.
51
+ *
52
+ * @note - This is only for future consideration.
53
+ */
54
+ blockedTimeSlots?: CrmServiceTimeAvailability[];
34
55
  }
35
56
  export interface CrmServiceAvailability {
36
57
  /**
@@ -39,8 +60,18 @@ export interface CrmServiceAvailability {
39
60
  range: DateTimeRange;
40
61
  /**
41
62
  * Availability for each date in the range.
63
+ *
64
+ * If the date is not included in the array, it is assumed to be available.
42
65
  */
43
- dateAvailabilities: CrmServiceDateAvailability[];
66
+ unavailabilities: CrmServiceDateAvailability[];
67
+ }
68
+ export interface CrmServiceAvailabilityOptions extends CrmServiceAvailabilitySettings {
69
+ /**
70
+ * Job Type to filter availability by.
71
+ *
72
+ * This allows to display availability for a specific job type, which can be different.
73
+ */
74
+ jobType?: string;
44
75
  }
45
76
  export interface CrmService {
46
77
  /**
@@ -73,10 +104,11 @@ export interface CrmService {
73
104
  */
74
105
  getAvailability(range: DateTimeRange, options?: CrmServiceAvailabilityOptions): Promise<CrmServiceAvailability>;
75
106
  }
76
- export type CrmServiceProps = CrmServiceAvailabilityOptions;
77
- export declare class AbstractCrmService implements CrmService, CrmServiceAvailabilityOptions {
78
- availableDays?: DayOfWeek[];
79
- blockedDays?: DateTime[];
107
+ export type CrmServiceProps = CrmServiceAvailabilitySettings;
108
+ export declare class AbstractCrmService implements CrmService {
109
+ protected availableDays?: DayOfWeek[];
110
+ protected blockedDays?: DateTime[];
111
+ protected maxTotalDailyAppointments?: number | undefined;
80
112
  constructor(props: CrmServiceProps);
81
113
  send(externalLead: ExternalLead, extras?: Record<string, unknown>): Promise<CrmResponse>;
82
114
  getAvailability(range: DateTimeRange, options?: CrmServiceAvailabilityOptions): Promise<CrmServiceAvailability>;
@@ -19,6 +19,9 @@ class AbstractCrmService {
19
19
  if (props.blockedDays) {
20
20
  this.blockedDays = props.blockedDays;
21
21
  }
22
+ if (typeof props.maxTotalDailyAppointments === "number") {
23
+ this.maxTotalDailyAppointments = props.maxTotalDailyAppointments;
24
+ }
22
25
  }
23
26
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
24
27
  send(externalLead, extras) {
@@ -1 +1 @@
1
- {"version":3,"file":"CrmService.js","sourceRoot":"","sources":["../../src/Services/CrmService.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;AAoFpC,MAAa,kBAAkB;IAM3B,YAAmB,KAAsB;QAErC,IAAI,KAAK,CAAC,aAAa,EAAE,CAAC;YACtB,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa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AI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;IAED,6DAA6D;IAChD,MAAM,CAAE,YAA0B,EAAE,MAAgC;;YAC7E,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC/C,CAAC;KAAA;CACJ;AArCD,gDAqCC"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "1.59.50",
7
+ "version": "1.59.51",
8
8
  "description": "Models for 📣 stentor",
9
9
  "types": "lib/index",
10
10
  "typings": "lib/index",
@@ -33,5 +33,5 @@
33
33
  "dependencies": {
34
34
  "@xapp/patterns": "2.0.2"
35
35
  },
36
- "gitHead": "bff39e20edff1e7c552b6ef8156b43388aa79697"
36
+ "gitHead": "3209e2f9b9aae5e7099c8076e84986aa7291cb42"
37
37
  }