@bizmap/sdk 0.0.10 → 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 +23 -27
- package/dist/main.js +38 -23
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare const PriceTag: z.ZodObject<{
|
|
|
20
20
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
21
21
|
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
22
22
|
uid: z.ZodString;
|
|
23
|
-
|
|
23
|
+
item: z.ZodString;
|
|
24
24
|
cost: z.ZodNumber;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
26
|
type PriceTag = z.infer<typeof PriceTag>;
|
|
@@ -53,31 +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
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
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>;
|
|
81
85
|
additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
86
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
83
87
|
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
@@ -95,13 +99,9 @@ declare const CompanyBillingModel: z.ZodObject<{
|
|
|
95
99
|
services: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
96
100
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
97
101
|
lastModified: z.ZodNullable<z.ZodNumber>;
|
|
98
|
-
|
|
99
|
-
name: z.ZodString;
|
|
102
|
+
item: z.ZodString;
|
|
100
103
|
cost: z.ZodNumber;
|
|
101
104
|
}, z.core.$strip>>>;
|
|
102
|
-
acceptedCurrencies: z.ZodArray<z.ZodEnum<{
|
|
103
|
-
JMD: "JMD";
|
|
104
|
-
}>>;
|
|
105
105
|
}, z.core.$strip>;
|
|
106
106
|
type CompanyBillingModel = z.infer<typeof CompanyBillingModel>;
|
|
107
107
|
declare const RegisterCompanyForm: z.ZodObject<{
|
|
@@ -185,7 +185,6 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
185
185
|
physAsst: "physAsst";
|
|
186
186
|
rcpst: "rcpst";
|
|
187
187
|
cshr: "cshr";
|
|
188
|
-
fdc: "fdc";
|
|
189
188
|
admin: "admin";
|
|
190
189
|
}>>;
|
|
191
190
|
name: z.ZodRecord<z.ZodEnum<{
|
|
@@ -215,7 +214,6 @@ declare const StaffDetails: z.ZodObject<{
|
|
|
215
214
|
physAsst: "physAsst";
|
|
216
215
|
rcpst: "rcpst";
|
|
217
216
|
cshr: "cshr";
|
|
218
|
-
fdc: "fdc";
|
|
219
217
|
admin: "admin";
|
|
220
218
|
}>>;
|
|
221
219
|
name: z.ZodRecord<z.ZodEnum<{
|
|
@@ -228,7 +226,7 @@ declare const StaffDetails: z.ZodObject<{
|
|
|
228
226
|
uid: z.ZodString;
|
|
229
227
|
}, z.core.$strip>>;
|
|
230
228
|
partnerMap: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>;
|
|
231
|
-
|
|
229
|
+
blackList: z.ZodArray<z.ZodString>;
|
|
232
230
|
}, z.core.$strip>;
|
|
233
231
|
type StaffDetails = z.infer<typeof StaffDetails>;
|
|
234
232
|
|
|
@@ -244,7 +242,6 @@ declare const companyUserRoles: z.ZodEnum<{
|
|
|
244
242
|
physAsst: "physAsst";
|
|
245
243
|
rcpst: "rcpst";
|
|
246
244
|
cshr: "cshr";
|
|
247
|
-
fdc: "fdc";
|
|
248
245
|
admin: "admin";
|
|
249
246
|
}>;
|
|
250
247
|
type CompanyUserRole = z.infer<typeof companyUserRoles>;
|
|
@@ -258,7 +255,6 @@ declare const employeeRoles: z.ZodEnum<{
|
|
|
258
255
|
physAsst: "physAsst";
|
|
259
256
|
rcpst: "rcpst";
|
|
260
257
|
cshr: "cshr";
|
|
261
|
-
fdc: "fdc";
|
|
262
258
|
}>;
|
|
263
259
|
type EmployeeRole = z.infer<typeof employeeRoles>;
|
|
264
260
|
declare const appointmentDistAlgs: z.ZodEnum<{
|
|
@@ -267,4 +263,4 @@ declare const appointmentDistAlgs: z.ZodEnum<{
|
|
|
267
263
|
}>;
|
|
268
264
|
type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
|
|
269
265
|
|
|
270
|
-
export { type AppointmentDistAlg, CompanyBillingModel, CompanyIdentity, CompanyOpState, type CompanyPartnerRole,
|
|
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
|
@@ -25,7 +25,8 @@ var PriceAdjustment = z2.object({
|
|
|
25
25
|
});
|
|
26
26
|
var PriceTag = z2.object({
|
|
27
27
|
uid: z2.string(),
|
|
28
|
-
name
|
|
28
|
+
/**The name of the item that's being priced */
|
|
29
|
+
item: z2.string(),
|
|
29
30
|
cost: z2.number(),
|
|
30
31
|
...TimeLog.shape
|
|
31
32
|
});
|
|
@@ -47,7 +48,6 @@ var companyUserRoles = z3.enum([
|
|
|
47
48
|
"physAsst",
|
|
48
49
|
"rcpst",
|
|
49
50
|
"cshr",
|
|
50
|
-
"fdc",
|
|
51
51
|
"admin"
|
|
52
52
|
]);
|
|
53
53
|
var companyPartnerRoles = companyUserRoles.extract([
|
|
@@ -80,12 +80,6 @@ var CompanyOpState = z4.object({
|
|
|
80
80
|
// The company's uid
|
|
81
81
|
uid: CompanyIdentity.shape.uid,
|
|
82
82
|
availableBalance: z4.number(),
|
|
83
|
-
isOffline: z4.boolean(),
|
|
84
|
-
...TimeLog.shape
|
|
85
|
-
});
|
|
86
|
-
var CompanyPreferences = z4.object({
|
|
87
|
-
// The company's uid
|
|
88
|
-
uid: CompanyIdentity.shape.uid,
|
|
89
83
|
/** The amount of user provisions made for this company */
|
|
90
84
|
userProvisions: z4.number(),
|
|
91
85
|
/**
|
|
@@ -93,25 +87,47 @@ var CompanyPreferences = z4.object({
|
|
|
93
87
|
* @property LOR (Least Outstanding Requests): Distribute based on availability.
|
|
94
88
|
*/
|
|
95
89
|
apptDistAlg: appointmentDistAlgs,
|
|
96
|
-
// // Required to determine:
|
|
97
|
-
// // [1] when the working directory on the server should reset
|
|
98
|
-
// // [2] the time that company session requests are cut-off
|
|
99
|
-
// // (the cutoff time affects non-admins)
|
|
100
|
-
// workingHours: z.object({
|
|
101
|
-
// start: Time,
|
|
102
|
-
// end: Time,
|
|
103
|
-
// }),
|
|
104
90
|
...TimeLog.shape
|
|
105
91
|
});
|
|
106
92
|
var CompanyBillingModel = z4.object({
|
|
107
93
|
uid: CompanyIdentity.shape.uid,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
+
}),
|
|
111
128
|
additionalFees: z4.array(PriceAdjustment).optional(),
|
|
112
129
|
discounts: z4.array(PriceAdjustment).optional(),
|
|
113
|
-
services: z4.array(PriceTag).optional(),
|
|
114
|
-
acceptedCurrencies: z4.array(currencies),
|
|
130
|
+
services: z4.array(PriceTag.omit({ uid: true })).min(1).max(100).optional(),
|
|
115
131
|
...TimeLog.shape
|
|
116
132
|
});
|
|
117
133
|
var RegisterCompanyForm = z4.object({
|
|
@@ -143,13 +159,12 @@ var StaffDetails = z4.object({
|
|
|
143
159
|
* @relationship one -> many
|
|
144
160
|
*@description A map of doctor `uids` to their assistants `uids` */
|
|
145
161
|
partnerMap: z4.record(CompanyUser.shape.uid, z4.array(CompanyUser.shape.uid)),
|
|
146
|
-
|
|
162
|
+
blackList: z4.array(CompanyUser.shape.uid)
|
|
147
163
|
});
|
|
148
164
|
export {
|
|
149
165
|
CompanyBillingModel,
|
|
150
166
|
CompanyIdentity,
|
|
151
167
|
CompanyOpState,
|
|
152
|
-
CompanyPreferences,
|
|
153
168
|
CompanyRegistrationClaims,
|
|
154
169
|
CompanyUser,
|
|
155
170
|
PriceAdjustment,
|