@bizmap/sdk 0.0.17 → 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 +40 -38
- package/dist/main.js +20 -11
- 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>;
|
|
@@ -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
|
-
|
|
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.
|
|
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<{
|
|
@@ -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
|
-
|
|
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.
|
|
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
|
@@ -86,12 +86,15 @@ var CompanyOpState = z4.object({
|
|
|
86
86
|
// This can be changed by the company's admin
|
|
87
87
|
preferences: z4.object({
|
|
88
88
|
/** The amount of user provisions made for this company */
|
|
89
|
-
userProvisions: z4.number().
|
|
89
|
+
userProvisions: z4.number().max(150, { error: "The total user provisions can't exceed 150" }).refine(
|
|
90
|
+
(p) => !(p > 1 && p < 10),
|
|
91
|
+
"The total user provisions must either be 1 or at least 10."
|
|
92
|
+
),
|
|
90
93
|
/**
|
|
91
94
|
* @property RR (Round Robin): Even distribution.
|
|
92
95
|
* @property LOR (Least Outstanding Requests): Distribute based on availability.
|
|
93
96
|
*/
|
|
94
|
-
apptDistAlg: appointmentDistAlgs,
|
|
97
|
+
apptDistAlg: appointmentDistAlgs.default("RR"),
|
|
95
98
|
...TimeLog.shape
|
|
96
99
|
}),
|
|
97
100
|
...TimeLog.shape
|
|
@@ -100,18 +103,19 @@ var CompanyBillingModel = z4.object({
|
|
|
100
103
|
uid: CompanyIdentity.shape.uid,
|
|
101
104
|
preferences: z4.object({
|
|
102
105
|
/** Allows the serviceDecider to distribute invoices. */
|
|
103
|
-
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),
|
|
104
109
|
/** The user that's allowed to record the client's services. */
|
|
105
|
-
serviceSelector: z4.enum(["scheduler", "doctor"]),
|
|
110
|
+
serviceSelector: z4.enum(["scheduler", "doctor"]).default("doctor"),
|
|
106
111
|
/** A record of the payments made must be attached before creating the
|
|
107
112
|
* appointment
|
|
108
113
|
* @note
|
|
109
114
|
* - only allowed when `serviceDecider === "scheduler"`
|
|
110
|
-
* - removes the `cshr` role from the company's allowed user roles
|
|
111
115
|
* */
|
|
112
|
-
enforcePaidAppts: z4.boolean(),
|
|
113
|
-
primaryCurrency: currencies,
|
|
114
|
-
acceptedCurrencies: z4.array(currencies),
|
|
116
|
+
enforcePaidAppts: z4.boolean().default(false),
|
|
117
|
+
primaryCurrency: currencies.default("JMD"),
|
|
118
|
+
acceptedCurrencies: z4.array(currencies).default(["JMD"]),
|
|
115
119
|
...TimeLog.shape
|
|
116
120
|
}).superRefine((data, ctx) => {
|
|
117
121
|
if (data.enforcePaidAppts && data.serviceSelector !== "scheduler") {
|
|
@@ -120,10 +124,15 @@ var CompanyBillingModel = z4.object({
|
|
|
120
124
|
);
|
|
121
125
|
}
|
|
122
126
|
}),
|
|
123
|
-
additionalFees: z4.array(PriceAdjustment).
|
|
124
|
-
discounts: z4.array(PriceAdjustment).
|
|
125
|
-
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([]),
|
|
126
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
|
+
}
|
|
127
136
|
});
|
|
128
137
|
var RegisterCompanyForm = z4.object({
|
|
129
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.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.
|
|
23
|
+
"@wavy/util": "^0.0.8",
|
|
24
24
|
"tsup": "^8.5.0",
|
|
25
25
|
"typescript": "^5.9.2",
|
|
26
26
|
"zod": "^4.2.1"
|