@bizmap/sdk 0.0.11 → 0.0.12

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/dist/main.d.ts CHANGED
@@ -53,34 +53,35 @@ declare const CompanyOpState: z.ZodObject<{
53
53
  lastModified: z.ZodNullable<z.ZodNumber>;
54
54
  uid: z.ZodReadonly<z.ZodString>;
55
55
  availableBalance: z.ZodNumber;
56
- isOffline: z.ZodBoolean;
57
- }, z.core.$strip>;
58
- type CompanyOpState = z.infer<typeof CompanyOpState>;
59
- declare const CompanyPreferences: z.ZodObject<{
60
- createdAt: z.ZodReadonly<z.ZodNumber>;
61
- lastModified: z.ZodNullable<z.ZodNumber>;
62
- uid: z.ZodReadonly<z.ZodString>;
63
56
  userProvisions: z.ZodNumber;
64
57
  apptDistAlg: z.ZodEnum<{
65
58
  RR: "RR";
66
59
  LOR: "LOR";
67
60
  }>;
68
61
  }, z.core.$strip>;
69
- type CompanyPreferences = z.infer<typeof CompanyPreferences>;
62
+ type CompanyOpState = z.infer<typeof CompanyOpState>;
70
63
  declare const CompanyBillingModel: z.ZodObject<{
71
64
  createdAt: z.ZodReadonly<z.ZodNumber>;
72
65
  lastModified: z.ZodNullable<z.ZodNumber>;
73
66
  uid: z.ZodReadonly<z.ZodString>;
74
- biller: z.ZodEnum<{
75
- doc: "doc";
76
- fdc: "fdc";
77
- }>;
78
- primaryCurrency: z.ZodEnum<{
79
- JMD: "JMD";
80
- }>;
81
- acceptedCurrencies: z.ZodArray<z.ZodEnum<{
82
- JMD: "JMD";
83
- }>>;
67
+ preferences: z.ZodObject<{
68
+ allowInvoiceDist: z.ZodBoolean;
69
+ serviceDecider: z.ZodEnum<{
70
+ scheduler: "scheduler";
71
+ doctor: "doctor";
72
+ }>;
73
+ enforcePaidAppts: z.ZodBoolean;
74
+ paymentCollector: z.ZodNullable<z.ZodEnum<{
75
+ doc: "doc";
76
+ cshr: "cshr";
77
+ }>>;
78
+ primaryCurrency: z.ZodEnum<{
79
+ JMD: "JMD";
80
+ }>;
81
+ acceptedCurrencies: z.ZodArray<z.ZodEnum<{
82
+ JMD: "JMD";
83
+ }>>;
84
+ }, z.core.$strip>;
84
85
  additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
85
86
  createdAt: z.ZodReadonly<z.ZodNumber>;
86
87
  lastModified: z.ZodNullable<z.ZodNumber>;
@@ -184,7 +185,6 @@ declare const CompanyUser: z.ZodObject<{
184
185
  physAsst: "physAsst";
185
186
  rcpst: "rcpst";
186
187
  cshr: "cshr";
187
- fdc: "fdc";
188
188
  admin: "admin";
189
189
  }>>;
190
190
  name: z.ZodRecord<z.ZodEnum<{
@@ -214,7 +214,6 @@ declare const StaffDetails: z.ZodObject<{
214
214
  physAsst: "physAsst";
215
215
  rcpst: "rcpst";
216
216
  cshr: "cshr";
217
- fdc: "fdc";
218
217
  admin: "admin";
219
218
  }>>;
220
219
  name: z.ZodRecord<z.ZodEnum<{
@@ -243,7 +242,6 @@ declare const companyUserRoles: z.ZodEnum<{
243
242
  physAsst: "physAsst";
244
243
  rcpst: "rcpst";
245
244
  cshr: "cshr";
246
- fdc: "fdc";
247
245
  admin: "admin";
248
246
  }>;
249
247
  type CompanyUserRole = z.infer<typeof companyUserRoles>;
@@ -257,7 +255,6 @@ declare const employeeRoles: z.ZodEnum<{
257
255
  physAsst: "physAsst";
258
256
  rcpst: "rcpst";
259
257
  cshr: "cshr";
260
- fdc: "fdc";
261
258
  }>;
262
259
  type EmployeeRole = z.infer<typeof employeeRoles>;
263
260
  declare const appointmentDistAlgs: z.ZodEnum<{
@@ -266,4 +263,4 @@ declare const appointmentDistAlgs: z.ZodEnum<{
266
263
  }>;
267
264
  type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
268
265
 
269
- export { type AppointmentDistAlg, CompanyBillingModel, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyPreferences, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles };
266
+ export { type AppointmentDistAlg, CompanyBillingModel, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles };
package/dist/main.js CHANGED
@@ -48,7 +48,6 @@ var companyUserRoles = z3.enum([
48
48
  "physAsst",
49
49
  "rcpst",
50
50
  "cshr",
51
- "fdc",
52
51
  "admin"
53
52
  ]);
54
53
  var companyPartnerRoles = companyUserRoles.extract([
@@ -81,12 +80,6 @@ var CompanyOpState = z4.object({
81
80
  // The company's uid
82
81
  uid: CompanyIdentity.shape.uid,
83
82
  availableBalance: z4.number(),
84
- isOffline: z4.boolean(),
85
- ...TimeLog.shape
86
- });
87
- var CompanyPreferences = z4.object({
88
- // The company's uid
89
- uid: CompanyIdentity.shape.uid,
90
83
  /** The amount of user provisions made for this company */
91
84
  userProvisions: z4.number(),
92
85
  /**
@@ -94,26 +87,47 @@ var CompanyPreferences = z4.object({
94
87
  * @property LOR (Least Outstanding Requests): Distribute based on availability.
95
88
  */
96
89
  apptDistAlg: appointmentDistAlgs,
97
- // // Required to determine:
98
- // // [1] when the working directory on the server should reset
99
- // // [2] the time that company session requests are cut-off
100
- // // (the cutoff time affects non-admins)
101
- // workingHours: z.object({
102
- // start: Time,
103
- // end: Time,
104
- // }),
105
90
  ...TimeLog.shape
106
91
  });
107
92
  var CompanyBillingModel = z4.object({
108
93
  uid: CompanyIdentity.shape.uid,
109
- // Preferences
110
- /** The user that provides the bill to the client */
111
- biller: companyUserRoles.extract(["doc", "fdc"]),
112
- primaryCurrency: currencies,
113
- acceptedCurrencies: z4.array(currencies),
94
+ preferences: z4.object({
95
+ /** Allows the serviceDecider to distribute invoices. */
96
+ allowInvoiceDist: z4.boolean(),
97
+ /** The user that's allowed to record the client's services. */
98
+ serviceDecider: z4.enum(["scheduler", "doctor"]),
99
+ /** A record of the payments made must be attached before creating the
100
+ * appointment
101
+ * @note
102
+ * - only allowed when `serviceDecider === "scheduler"`
103
+ * - removes the `cshr` role from the company's allowed user roles
104
+ * */
105
+ enforcePaidAppts: z4.boolean(),
106
+ /**
107
+ * Determines who collects & records payments made by clients.
108
+ * @default "cshr"
109
+ * @note
110
+ * - if `collector === "doc"`, the `cshr` role will be removed from the company's allowed user roles.
111
+ * - if `enforcePaidAppts === true`, this should be null.
112
+ */
113
+ paymentCollector: companyUserRoles.extract(["doc", "cshr"]).nullable(),
114
+ primaryCurrency: currencies,
115
+ acceptedCurrencies: z4.array(currencies)
116
+ }).superRefine((data, ctx) => {
117
+ if (data.enforcePaidAppts && data.serviceDecider !== "scheduler") {
118
+ ctx.addIssue(
119
+ "serviceDecider must be scheduler when enforcePaidAppts is true."
120
+ );
121
+ }
122
+ if (data.enforcePaidAppts && data.paymentCollector !== null) {
123
+ ctx.addIssue(
124
+ "paymentCollector must be null when enforcePaidAppts is true."
125
+ );
126
+ }
127
+ }),
114
128
  additionalFees: z4.array(PriceAdjustment).optional(),
115
129
  discounts: z4.array(PriceAdjustment).optional(),
116
- services: z4.array(PriceTag.omit({ uid: true })).optional(),
130
+ services: z4.array(PriceTag.omit({ uid: true })).min(1).max(100).optional(),
117
131
  ...TimeLog.shape
118
132
  });
119
133
  var RegisterCompanyForm = z4.object({
@@ -151,7 +165,6 @@ export {
151
165
  CompanyBillingModel,
152
166
  CompanyIdentity,
153
167
  CompanyOpState,
154
- CompanyPreferences,
155
168
  CompanyRegistrationClaims,
156
169
  CompanyUser,
157
170
  PriceAdjustment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.11",
3
+ "version": "0.0.12",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",