@bizmap/sdk 0.0.18 → 0.0.19

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
@@ -35,12 +35,12 @@ declare const CompanyIdentity: z.ZodObject<{
35
35
  email: z.ZodEmail;
36
36
  phoneNumber: z.ZodOptional<z.ZodString>;
37
37
  }, z.core.$strip>;
38
- address: z.ZodRecord<z.ZodEnum<{
39
- streetAddress: "streetAddress";
40
- city: "city";
41
- parish: "parish";
42
- country: "country";
43
- }>, z.ZodString>;
38
+ address: z.ZodObject<{
39
+ streetAddress: z.ZodString;
40
+ city: z.ZodOptional<z.ZodString>;
41
+ parish: z.ZodString;
42
+ country: z.ZodString;
43
+ }, z.core.$strip>;
44
44
  legal: z.ZodObject<{
45
45
  regNo: z.ZodReadonly<z.ZodString>;
46
46
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -57,10 +57,10 @@ declare const CompanyOpState: z.ZodObject<{
57
57
  createdAt: z.ZodReadonly<z.ZodNumber>;
58
58
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
59
  userProvisions: z.ZodNumber;
60
- apptDistAlg: z.ZodEnum<{
60
+ apptDistAlg: z.ZodDefault<z.ZodEnum<{
61
61
  RR: "RR";
62
62
  LOR: "LOR";
63
- }>;
63
+ }>>;
64
64
  }, z.core.$strip>;
65
65
  }, z.core.$strip>;
66
66
  type CompanyOpState = z.infer<typeof CompanyOpState>;
@@ -71,34 +71,35 @@ declare const CompanyBillingModel: z.ZodObject<{
71
71
  preferences: z.ZodObject<{
72
72
  createdAt: z.ZodReadonly<z.ZodNumber>;
73
73
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
74
- allowInvoiceDist: z.ZodBoolean;
75
- serviceSelector: z.ZodEnum<{
74
+ allowInvoiceDist: z.ZodDefault<z.ZodBoolean>;
75
+ useDefinedServices: z.ZodDefault<z.ZodBoolean>;
76
+ serviceSelector: z.ZodDefault<z.ZodEnum<{
76
77
  scheduler: "scheduler";
77
78
  doctor: "doctor";
78
- }>;
79
- enforcePaidAppts: z.ZodBoolean;
80
- primaryCurrency: z.ZodEnum<{
81
- JMD: "JMD";
82
- }>;
83
- acceptedCurrencies: z.ZodArray<z.ZodEnum<{
79
+ }>>;
80
+ enforcePaidAppts: z.ZodDefault<z.ZodBoolean>;
81
+ primaryCurrency: z.ZodDefault<z.ZodEnum<{
84
82
  JMD: "JMD";
85
83
  }>>;
84
+ acceptedCurrencies: z.ZodDefault<z.ZodArray<z.ZodEnum<{
85
+ JMD: "JMD";
86
+ }>>>;
86
87
  }, z.core.$strip>;
87
- additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
+ additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
88
89
  createdAt: z.ZodReadonly<z.ZodNumber>;
89
90
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
90
91
  description: z.ZodOptional<z.ZodString>;
91
92
  fixedAmount: z.ZodNumber;
92
93
  percentage: z.ZodNumber;
93
94
  }, z.core.$strip>>>;
94
- discounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
95
+ discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
95
96
  createdAt: z.ZodReadonly<z.ZodNumber>;
96
97
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
97
98
  description: z.ZodOptional<z.ZodString>;
98
99
  fixedAmount: z.ZodNumber;
99
100
  percentage: z.ZodNumber;
100
101
  }, z.core.$strip>>>;
101
- services: z.ZodOptional<z.ZodArray<z.ZodObject<{
102
+ services: z.ZodDefault<z.ZodArray<z.ZodObject<{
102
103
  createdAt: z.ZodReadonly<z.ZodNumber>;
103
104
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
104
105
  item: z.ZodString;
@@ -298,12 +299,12 @@ declare const CompanyDetails: z.ZodObject<{
298
299
  identity: z.ZodObject<{
299
300
  createdAt: z.ZodReadonly<z.ZodNumber>;
300
301
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
301
- address: z.ZodRecord<z.ZodEnum<{
302
- streetAddress: "streetAddress";
303
- city: "city";
304
- parish: "parish";
305
- country: "country";
306
- }>, z.ZodString>;
302
+ address: z.ZodObject<{
303
+ streetAddress: z.ZodString;
304
+ city: z.ZodOptional<z.ZodString>;
305
+ parish: z.ZodString;
306
+ country: z.ZodString;
307
+ }, z.core.$strip>;
307
308
  displayName: z.ZodString;
308
309
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
309
310
  contact: z.ZodObject<{
@@ -324,10 +325,10 @@ declare const CompanyDetails: z.ZodObject<{
324
325
  createdAt: z.ZodReadonly<z.ZodNumber>;
325
326
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
326
327
  userProvisions: z.ZodNumber;
327
- apptDistAlg: z.ZodEnum<{
328
+ apptDistAlg: z.ZodDefault<z.ZodEnum<{
328
329
  RR: "RR";
329
330
  LOR: "LOR";
330
- }>;
331
+ }>>;
331
332
  }, z.core.$strip>;
332
333
  }, z.core.$strip>;
333
334
  billing: z.ZodObject<{
@@ -336,34 +337,35 @@ declare const CompanyDetails: z.ZodObject<{
336
337
  preferences: z.ZodObject<{
337
338
  createdAt: z.ZodReadonly<z.ZodNumber>;
338
339
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
339
- allowInvoiceDist: z.ZodBoolean;
340
- serviceSelector: z.ZodEnum<{
340
+ allowInvoiceDist: z.ZodDefault<z.ZodBoolean>;
341
+ useDefinedServices: z.ZodDefault<z.ZodBoolean>;
342
+ serviceSelector: z.ZodDefault<z.ZodEnum<{
341
343
  scheduler: "scheduler";
342
344
  doctor: "doctor";
343
- }>;
344
- enforcePaidAppts: z.ZodBoolean;
345
- primaryCurrency: z.ZodEnum<{
346
- JMD: "JMD";
347
- }>;
348
- acceptedCurrencies: z.ZodArray<z.ZodEnum<{
345
+ }>>;
346
+ enforcePaidAppts: z.ZodDefault<z.ZodBoolean>;
347
+ primaryCurrency: z.ZodDefault<z.ZodEnum<{
349
348
  JMD: "JMD";
350
349
  }>>;
350
+ acceptedCurrencies: z.ZodDefault<z.ZodArray<z.ZodEnum<{
351
+ JMD: "JMD";
352
+ }>>>;
351
353
  }, z.core.$strip>;
352
- additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
354
+ additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
353
355
  createdAt: z.ZodReadonly<z.ZodNumber>;
354
356
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
355
357
  description: z.ZodOptional<z.ZodString>;
356
358
  fixedAmount: z.ZodNumber;
357
359
  percentage: z.ZodNumber;
358
360
  }, z.core.$strip>>>;
359
- discounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
361
+ discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
360
362
  createdAt: z.ZodReadonly<z.ZodNumber>;
361
363
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
362
364
  description: z.ZodOptional<z.ZodString>;
363
365
  fixedAmount: z.ZodNumber;
364
366
  percentage: z.ZodNumber;
365
367
  }, z.core.$strip>>>;
366
- services: z.ZodOptional<z.ZodArray<z.ZodObject<{
368
+ services: z.ZodDefault<z.ZodArray<z.ZodObject<{
367
369
  createdAt: z.ZodReadonly<z.ZodNumber>;
368
370
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
369
371
  item: z.ZodString;
package/dist/main.js CHANGED
@@ -94,7 +94,7 @@ var CompanyOpState = z4.object({
94
94
  * @property RR (Round Robin): Even distribution.
95
95
  * @property LOR (Least Outstanding Requests): Distribute based on availability.
96
96
  */
97
- apptDistAlg: appointmentDistAlgs,
97
+ apptDistAlg: appointmentDistAlgs.default("RR"),
98
98
  ...TimeLog.shape
99
99
  }),
100
100
  ...TimeLog.shape
@@ -103,18 +103,19 @@ var CompanyBillingModel = z4.object({
103
103
  uid: CompanyIdentity.shape.uid,
104
104
  preferences: z4.object({
105
105
  /** Allows the serviceDecider to distribute invoices. */
106
- allowInvoiceDist: z4.boolean(),
106
+ allowInvoiceDist: z4.boolean().default(true),
107
+ /** Forces service selectors to select service(s) from the list of services you've created. */
108
+ useDefinedServices: z4.boolean().default(false),
107
109
  /** The user that's allowed to record the client's services. */
108
- serviceSelector: z4.enum(["scheduler", "doctor"]),
110
+ serviceSelector: z4.enum(["scheduler", "doctor"]).default("doctor"),
109
111
  /** A record of the payments made must be attached before creating the
110
112
  * appointment
111
113
  * @note
112
114
  * - only allowed when `serviceDecider === "scheduler"`
113
- * - removes the `cshr` role from the company's allowed user roles
114
115
  * */
115
- enforcePaidAppts: z4.boolean(),
116
- primaryCurrency: currencies,
117
- acceptedCurrencies: z4.array(currencies),
116
+ enforcePaidAppts: z4.boolean().default(false),
117
+ primaryCurrency: currencies.default("JMD"),
118
+ acceptedCurrencies: z4.array(currencies).default(["JMD"]),
118
119
  ...TimeLog.shape
119
120
  }).superRefine((data, ctx) => {
120
121
  if (data.enforcePaidAppts && data.serviceSelector !== "scheduler") {
@@ -123,10 +124,15 @@ var CompanyBillingModel = z4.object({
123
124
  );
124
125
  }
125
126
  }),
126
- additionalFees: z4.array(PriceAdjustment).optional(),
127
- discounts: z4.array(PriceAdjustment).optional(),
128
- services: z4.array(PriceTag.omit({ uid: true })).min(1).max(100).optional(),
127
+ additionalFees: z4.array(PriceAdjustment).default([]),
128
+ discounts: z4.array(PriceAdjustment).default([]),
129
+ services: z4.array(PriceTag.omit({ uid: true })).max(100).default([]),
129
130
  ...TimeLog.shape
131
+ }).superRefine((billing, ctx) => {
132
+ const totalServices = billing?.services?.length ?? 0;
133
+ if (billing?.preferences?.useDefinedServices && totalServices < 1) {
134
+ ctx.addIssue("At least (1) service must be added to the services list.");
135
+ }
130
136
  });
131
137
  var RegisterCompanyForm = z4.object({
132
138
  regNo: z4.string(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "description": "",
22
22
  "devDependencies": {
23
- "@wavy/util": "^0.0.7",
23
+ "@wavy/util": "^0.0.8",
24
24
  "tsup": "^8.5.0",
25
25
  "typescript": "^5.9.2",
26
26
  "zod": "^4.2.1"