@bizmap/sdk 0.0.18 → 0.0.20
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 +24 -22
- package/dist/main.js +11 -5
- package/package.json +2 -2
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.
|
|
39
|
-
streetAddress:
|
|
40
|
-
city:
|
|
41
|
-
parish:
|
|
42
|
-
country:
|
|
43
|
-
}
|
|
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>;
|
|
@@ -72,6 +72,7 @@ declare const CompanyBillingModel: z.ZodObject<{
|
|
|
72
72
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
73
73
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
74
|
allowInvoiceDist: z.ZodBoolean;
|
|
75
|
+
useDefinedServices: z.ZodBoolean;
|
|
75
76
|
serviceSelector: z.ZodEnum<{
|
|
76
77
|
scheduler: "scheduler";
|
|
77
78
|
doctor: "doctor";
|
|
@@ -84,21 +85,21 @@ declare const CompanyBillingModel: z.ZodObject<{
|
|
|
84
85
|
JMD: "JMD";
|
|
85
86
|
}>>;
|
|
86
87
|
}, z.core.$strip>;
|
|
87
|
-
additionalFees: z.
|
|
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.
|
|
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.
|
|
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.
|
|
302
|
-
streetAddress:
|
|
303
|
-
city:
|
|
304
|
-
parish:
|
|
305
|
-
country:
|
|
306
|
-
}
|
|
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<{
|
|
@@ -337,6 +338,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
337
338
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
338
339
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
339
340
|
allowInvoiceDist: z.ZodBoolean;
|
|
341
|
+
useDefinedServices: z.ZodBoolean;
|
|
340
342
|
serviceSelector: z.ZodEnum<{
|
|
341
343
|
scheduler: "scheduler";
|
|
342
344
|
doctor: "doctor";
|
|
@@ -349,21 +351,21 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
349
351
|
JMD: "JMD";
|
|
350
352
|
}>>;
|
|
351
353
|
}, z.core.$strip>;
|
|
352
|
-
additionalFees: z.
|
|
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.
|
|
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.
|
|
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
|
|
@@ -104,13 +104,14 @@ var CompanyBillingModel = z4.object({
|
|
|
104
104
|
preferences: z4.object({
|
|
105
105
|
/** Allows the serviceDecider to distribute invoices. */
|
|
106
106
|
allowInvoiceDist: z4.boolean(),
|
|
107
|
+
/** Forces service selectors to select service(s) from the list of services you've created. */
|
|
108
|
+
useDefinedServices: z4.boolean(),
|
|
107
109
|
/** The user that's allowed to record the client's services. */
|
|
108
110
|
serviceSelector: z4.enum(["scheduler", "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
116
|
enforcePaidAppts: z4.boolean(),
|
|
116
117
|
primaryCurrency: currencies,
|
|
@@ -123,10 +124,15 @@ var CompanyBillingModel = z4.object({
|
|
|
123
124
|
);
|
|
124
125
|
}
|
|
125
126
|
}),
|
|
126
|
-
additionalFees: z4.array(PriceAdjustment).
|
|
127
|
-
discounts: z4.array(PriceAdjustment).
|
|
128
|
-
services: z4.array(PriceTag.omit({ uid: true })).
|
|
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.
|
|
3
|
+
"version": "0.0.20",
|
|
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.
|
|
23
|
+
"@wavy/util": "^0.0.8",
|
|
24
24
|
"tsup": "^8.5.0",
|
|
25
25
|
"typescript": "^5.9.2",
|
|
26
26
|
"zod": "^4.2.1"
|