@bizmap/sdk 0.0.15 → 0.0.17
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 +70 -76
- package/dist/main.js +19 -19
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare const PricingRate: z.ZodObject<{
|
|
|
10
10
|
type PricingRate = z.infer<typeof PricingRate>;
|
|
11
11
|
declare const PriceAdjustment: z.ZodObject<{
|
|
12
12
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
13
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
13
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
14
14
|
description: z.ZodOptional<z.ZodString>;
|
|
15
15
|
fixedAmount: z.ZodNumber;
|
|
16
16
|
percentage: z.ZodNumber;
|
|
@@ -18,7 +18,7 @@ declare const PriceAdjustment: z.ZodObject<{
|
|
|
18
18
|
type PriceAdjustment = z.infer<typeof PriceAdjustment>;
|
|
19
19
|
declare const PriceTag: z.ZodObject<{
|
|
20
20
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
21
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
21
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
22
22
|
uid: z.ZodString;
|
|
23
23
|
item: z.ZodString;
|
|
24
24
|
cost: z.ZodNumber;
|
|
@@ -27,10 +27,10 @@ type PriceTag = z.infer<typeof PriceTag>;
|
|
|
27
27
|
|
|
28
28
|
declare const CompanyIdentity: z.ZodObject<{
|
|
29
29
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
30
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
30
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
31
|
uid: z.ZodReadonly<z.ZodString>;
|
|
32
32
|
displayName: z.ZodString;
|
|
33
|
-
logo: z.ZodOptional<z.ZodString
|
|
33
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
34
34
|
contact: z.ZodObject<{
|
|
35
35
|
email: z.ZodEmail;
|
|
36
36
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -43,19 +43,19 @@ declare const CompanyIdentity: z.ZodObject<{
|
|
|
43
43
|
}>, z.ZodString>;
|
|
44
44
|
legal: z.ZodObject<{
|
|
45
45
|
regNo: z.ZodReadonly<z.ZodString>;
|
|
46
|
-
trn: z.ZodOptional<z.ZodString
|
|
47
|
-
gctRegNo: z.ZodOptional<z.ZodString
|
|
46
|
+
trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
48
48
|
}, z.core.$strip>;
|
|
49
49
|
}, z.core.$strip>;
|
|
50
50
|
type CompanyIdentity = z.infer<typeof CompanyIdentity>;
|
|
51
51
|
declare const CompanyOpState: z.ZodObject<{
|
|
52
52
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
53
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
53
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
54
|
uid: z.ZodReadonly<z.ZodString>;
|
|
55
55
|
availableBalance: z.ZodNumber;
|
|
56
56
|
preferences: z.ZodObject<{
|
|
57
57
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
58
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
58
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
59
|
userProvisions: z.ZodNumber;
|
|
60
60
|
apptDistAlg: z.ZodEnum<{
|
|
61
61
|
RR: "RR";
|
|
@@ -66,11 +66,11 @@ declare const CompanyOpState: z.ZodObject<{
|
|
|
66
66
|
type CompanyOpState = z.infer<typeof CompanyOpState>;
|
|
67
67
|
declare const CompanyBillingModel: z.ZodObject<{
|
|
68
68
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
69
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
69
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
70
70
|
uid: z.ZodReadonly<z.ZodString>;
|
|
71
71
|
preferences: z.ZodObject<{
|
|
72
72
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
73
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
73
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
74
|
allowInvoiceDist: z.ZodBoolean;
|
|
75
75
|
serviceSelector: z.ZodEnum<{
|
|
76
76
|
scheduler: "scheduler";
|
|
@@ -86,21 +86,21 @@ declare const CompanyBillingModel: z.ZodObject<{
|
|
|
86
86
|
}, z.core.$strip>;
|
|
87
87
|
additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
88
88
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
89
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
89
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
90
90
|
description: z.ZodOptional<z.ZodString>;
|
|
91
91
|
fixedAmount: z.ZodNumber;
|
|
92
92
|
percentage: z.ZodNumber;
|
|
93
93
|
}, z.core.$strip>>>;
|
|
94
94
|
discounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
95
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
96
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
96
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
97
97
|
description: z.ZodOptional<z.ZodString>;
|
|
98
98
|
fixedAmount: z.ZodNumber;
|
|
99
99
|
percentage: z.ZodNumber;
|
|
100
100
|
}, z.core.$strip>>>;
|
|
101
101
|
services: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
102
102
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
103
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
103
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
104
104
|
item: z.ZodString;
|
|
105
105
|
cost: z.ZodNumber;
|
|
106
106
|
}, z.core.$strip>>>;
|
|
@@ -155,7 +155,7 @@ declare const RegisterCompanyForm: z.ZodObject<{
|
|
|
155
155
|
type RegisterCompanyForm = z.infer<typeof RegisterCompanyForm>;
|
|
156
156
|
declare const CompanyRegistrationClaims: z.ZodObject<{
|
|
157
157
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
158
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
158
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
159
159
|
sender: z.ZodObject<{
|
|
160
160
|
name: z.ZodRecord<z.ZodEnum<{
|
|
161
161
|
first: "first";
|
|
@@ -175,7 +175,7 @@ declare const CompanyRegistrationClaims: z.ZodObject<{
|
|
|
175
175
|
type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
|
|
176
176
|
declare const CompanyUser: z.ZodObject<{
|
|
177
177
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
178
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
178
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
179
179
|
status: z.ZodEnum<{
|
|
180
180
|
inviteSent: "inviteSent";
|
|
181
181
|
active: "active";
|
|
@@ -199,12 +199,42 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
199
199
|
uid: z.ZodString;
|
|
200
200
|
}, z.core.$strip>;
|
|
201
201
|
type CompanyUser = z.infer<typeof CompanyUser>;
|
|
202
|
+
declare const _staffDetails: z.ZodObject<{
|
|
203
|
+
uid: z.ZodReadonly<z.ZodString>;
|
|
204
|
+
members: z.ZodArray<z.ZodObject<{
|
|
205
|
+
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
206
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
207
|
+
status: z.ZodEnum<{
|
|
208
|
+
inviteSent: "inviteSent";
|
|
209
|
+
active: "active";
|
|
210
|
+
inactive: "inactive";
|
|
211
|
+
}>;
|
|
212
|
+
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
213
|
+
doc: "doc";
|
|
214
|
+
physAsst: "physAsst";
|
|
215
|
+
rcpst: "rcpst";
|
|
216
|
+
cshr: "cshr";
|
|
217
|
+
admin: "admin";
|
|
218
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
219
|
+
lastActive: z.ZodNumber;
|
|
220
|
+
name: z.ZodRecord<z.ZodEnum<{
|
|
221
|
+
first: "first";
|
|
222
|
+
last: "last";
|
|
223
|
+
}>, z.ZodString>;
|
|
224
|
+
photoUrl: z.ZodOptional<z.ZodString>;
|
|
225
|
+
email: z.ZodEmail;
|
|
226
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
227
|
+
uid: z.ZodString;
|
|
228
|
+
}, z.core.$strip>>;
|
|
229
|
+
partnerMap: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
230
|
+
blackList: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
|
|
231
|
+
}, z.core.$strip>;
|
|
202
232
|
/** The unpacked Staff Details */
|
|
203
233
|
declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
204
234
|
uid: z.ZodReadonly<z.ZodString>;
|
|
205
235
|
members: z.ZodArray<z.ZodObject<{
|
|
206
236
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
207
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
237
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
208
238
|
status: z.ZodEnum<{
|
|
209
239
|
inviteSent: "inviteSent";
|
|
210
240
|
active: "active";
|
|
@@ -233,13 +263,13 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
233
263
|
uid: string;
|
|
234
264
|
members: {
|
|
235
265
|
createdAt: number;
|
|
236
|
-
lastModified: number | null;
|
|
237
266
|
status: "inviteSent" | "active" | "inactive";
|
|
238
267
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
239
268
|
lastActive: number;
|
|
240
269
|
name: Record<"first" | "last", string>;
|
|
241
270
|
email: string;
|
|
242
271
|
uid: string;
|
|
272
|
+
lastModified?: number | null | undefined;
|
|
243
273
|
photoUrl?: string | undefined;
|
|
244
274
|
phoneNumber?: string | undefined;
|
|
245
275
|
}[];
|
|
@@ -249,52 +279,50 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
|
|
|
249
279
|
uid: string;
|
|
250
280
|
members: {
|
|
251
281
|
createdAt: number;
|
|
252
|
-
lastModified: number | null;
|
|
253
282
|
status: "inviteSent" | "active" | "inactive";
|
|
254
283
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
255
284
|
lastActive: number;
|
|
256
285
|
name: Record<"first" | "last", string>;
|
|
257
286
|
email: string;
|
|
258
287
|
uid: string;
|
|
288
|
+
lastModified?: number | null | undefined;
|
|
259
289
|
photoUrl?: string | undefined;
|
|
260
290
|
phoneNumber?: string | undefined;
|
|
261
291
|
}[];
|
|
262
292
|
partnerMap: Record<string, string[]>;
|
|
263
293
|
blackList: string[];
|
|
264
294
|
}>>;
|
|
265
|
-
type StaffDetails = z.infer<typeof
|
|
295
|
+
type StaffDetails = z.infer<typeof _staffDetails>;
|
|
266
296
|
declare const CompanyDetails: z.ZodObject<{
|
|
267
297
|
uid: z.ZodString;
|
|
268
298
|
identity: z.ZodObject<{
|
|
269
299
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
270
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
271
|
-
uid: z.ZodReadonly<z.ZodString>;
|
|
272
|
-
displayName: z.ZodString;
|
|
273
|
-
logo: z.ZodOptional<z.ZodString>;
|
|
274
|
-
contact: z.ZodObject<{
|
|
275
|
-
email: z.ZodEmail;
|
|
276
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
277
|
-
}, z.core.$strip>;
|
|
300
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
278
301
|
address: z.ZodRecord<z.ZodEnum<{
|
|
279
302
|
streetAddress: "streetAddress";
|
|
280
303
|
city: "city";
|
|
281
304
|
parish: "parish";
|
|
282
305
|
country: "country";
|
|
283
306
|
}>, z.ZodString>;
|
|
307
|
+
displayName: z.ZodString;
|
|
308
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
309
|
+
contact: z.ZodObject<{
|
|
310
|
+
email: z.ZodEmail;
|
|
311
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
312
|
+
}, z.core.$strip>;
|
|
284
313
|
legal: z.ZodObject<{
|
|
285
314
|
regNo: z.ZodReadonly<z.ZodString>;
|
|
286
|
-
trn: z.ZodOptional<z.ZodString
|
|
287
|
-
gctRegNo: z.ZodOptional<z.ZodString
|
|
315
|
+
trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
316
|
+
gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
317
|
}, z.core.$strip>;
|
|
289
318
|
}, z.core.$strip>;
|
|
290
319
|
opState: z.ZodObject<{
|
|
291
320
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
292
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
293
|
-
uid: z.ZodReadonly<z.ZodString>;
|
|
321
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
294
322
|
availableBalance: z.ZodNumber;
|
|
295
323
|
preferences: z.ZodObject<{
|
|
296
324
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
297
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
325
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
298
326
|
userProvisions: z.ZodNumber;
|
|
299
327
|
apptDistAlg: z.ZodEnum<{
|
|
300
328
|
RR: "RR";
|
|
@@ -304,11 +332,10 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
304
332
|
}, z.core.$strip>;
|
|
305
333
|
billing: z.ZodObject<{
|
|
306
334
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
307
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
308
|
-
uid: z.ZodReadonly<z.ZodString>;
|
|
335
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
309
336
|
preferences: z.ZodObject<{
|
|
310
337
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
311
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
338
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
312
339
|
allowInvoiceDist: z.ZodBoolean;
|
|
313
340
|
serviceSelector: z.ZodEnum<{
|
|
314
341
|
scheduler: "scheduler";
|
|
@@ -324,30 +351,29 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
324
351
|
}, z.core.$strip>;
|
|
325
352
|
additionalFees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
326
353
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
327
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
354
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
328
355
|
description: z.ZodOptional<z.ZodString>;
|
|
329
356
|
fixedAmount: z.ZodNumber;
|
|
330
357
|
percentage: z.ZodNumber;
|
|
331
358
|
}, z.core.$strip>>>;
|
|
332
359
|
discounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
333
360
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
334
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
361
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
335
362
|
description: z.ZodOptional<z.ZodString>;
|
|
336
363
|
fixedAmount: z.ZodNumber;
|
|
337
364
|
percentage: z.ZodNumber;
|
|
338
365
|
}, z.core.$strip>>>;
|
|
339
366
|
services: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
340
367
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
341
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
368
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
342
369
|
item: z.ZodString;
|
|
343
370
|
cost: z.ZodNumber;
|
|
344
371
|
}, z.core.$strip>>>;
|
|
345
372
|
}, z.core.$strip>;
|
|
346
|
-
staffDetails: z.
|
|
347
|
-
uid: z.ZodReadonly<z.ZodString>;
|
|
373
|
+
staffDetails: z.ZodObject<{
|
|
348
374
|
members: z.ZodArray<z.ZodObject<{
|
|
349
375
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
350
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
376
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
351
377
|
status: z.ZodEnum<{
|
|
352
378
|
inviteSent: "inviteSent";
|
|
353
379
|
active: "active";
|
|
@@ -372,45 +398,13 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
372
398
|
}, z.core.$strip>>;
|
|
373
399
|
partnerMap: z.ZodRecord<z.ZodString, z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>>;
|
|
374
400
|
blackList: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
|
|
375
|
-
}, z.core.$strip
|
|
376
|
-
uid: string;
|
|
377
|
-
members: {
|
|
378
|
-
createdAt: number;
|
|
379
|
-
lastModified: number | null;
|
|
380
|
-
status: "inviteSent" | "active" | "inactive";
|
|
381
|
-
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
382
|
-
lastActive: number;
|
|
383
|
-
name: Record<"first" | "last", string>;
|
|
384
|
-
email: string;
|
|
385
|
-
uid: string;
|
|
386
|
-
photoUrl?: string | undefined;
|
|
387
|
-
phoneNumber?: string | undefined;
|
|
388
|
-
}[];
|
|
389
|
-
partnerMap: Record<string, string[]>;
|
|
390
|
-
blackList: string[];
|
|
391
|
-
}, {
|
|
392
|
-
uid: string;
|
|
393
|
-
members: {
|
|
394
|
-
createdAt: number;
|
|
395
|
-
lastModified: number | null;
|
|
396
|
-
status: "inviteSent" | "active" | "inactive";
|
|
397
|
-
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
398
|
-
lastActive: number;
|
|
399
|
-
name: Record<"first" | "last", string>;
|
|
400
|
-
email: string;
|
|
401
|
-
uid: string;
|
|
402
|
-
photoUrl?: string | undefined;
|
|
403
|
-
phoneNumber?: string | undefined;
|
|
404
|
-
}[];
|
|
405
|
-
partnerMap: Record<string, string[]>;
|
|
406
|
-
blackList: string[];
|
|
407
|
-
}>>;
|
|
401
|
+
}, z.core.$strip>;
|
|
408
402
|
}, z.core.$strip>;
|
|
409
403
|
type CompanyDetails = z.infer<typeof CompanyDetails>;
|
|
410
404
|
|
|
411
405
|
declare const TimeLog: z.ZodObject<{
|
|
412
406
|
createdAt: z.ZodReadonly<z.ZodNumber>;
|
|
413
|
-
lastModified: z.ZodNullable<z.ZodNumber
|
|
407
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
414
408
|
}, z.core.$strip>;
|
|
415
409
|
type TimeLog = z.infer<typeof TimeLog>;
|
|
416
410
|
declare const Time: z.ZodString;
|
|
@@ -444,13 +438,13 @@ type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
|
|
|
444
438
|
/**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
|
|
445
439
|
declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
446
440
|
createdAt: number;
|
|
447
|
-
lastModified: number | null;
|
|
448
441
|
status: "inviteSent" | "active" | "inactive";
|
|
449
442
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
450
443
|
lastActive: number;
|
|
451
444
|
name: Record<"first" | "last", string>;
|
|
452
445
|
email: string;
|
|
453
446
|
uid: string;
|
|
447
|
+
lastModified?: number | null | undefined;
|
|
454
448
|
photoUrl?: string | undefined;
|
|
455
449
|
phoneNumber?: string | undefined;
|
|
456
450
|
}[] | null;
|
package/dist/main.js
CHANGED
|
@@ -5,9 +5,11 @@ import * as z2 from "zod";
|
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
var TimeLog = z.object({
|
|
7
7
|
createdAt: z.number().readonly(),
|
|
8
|
-
lastModified: z.number().
|
|
8
|
+
lastModified: z.number().nullish()
|
|
9
|
+
});
|
|
10
|
+
var Time = z.string().regex(/^[0-9]{1,2}:[0-9]{2} (am|AM|pm|PM)/, {
|
|
11
|
+
error: "Must match the pattern hh:mm A"
|
|
9
12
|
});
|
|
10
|
-
var Time = z.string().regex(/^[0-9]{1,2}:[0-9]{2} (am|AM|pm|PM)/, { error: "Must match the pattern hh:mm A" });
|
|
11
13
|
|
|
12
14
|
// src/schemas/Billing.ts
|
|
13
15
|
var PricingRate = z2.object({
|
|
@@ -62,7 +64,7 @@ var CompanyIdentity = z4.object({
|
|
|
62
64
|
uid: z4.string().readonly(),
|
|
63
65
|
// The company's uid
|
|
64
66
|
displayName: z4.string(),
|
|
65
|
-
logo: z4.string().
|
|
67
|
+
logo: z4.string().nullish(),
|
|
66
68
|
contact: z4.object({
|
|
67
69
|
email: z4.email(),
|
|
68
70
|
phoneNumber: PhoneNumber.optional()
|
|
@@ -71,8 +73,8 @@ var CompanyIdentity = z4.object({
|
|
|
71
73
|
legal: z4.object({
|
|
72
74
|
regNo: z4.string().readonly(),
|
|
73
75
|
// The company's registration number
|
|
74
|
-
trn: z4.string().
|
|
75
|
-
gctRegNo: z4.string().
|
|
76
|
+
trn: z4.string().nullish(),
|
|
77
|
+
gctRegNo: z4.string().nullish()
|
|
76
78
|
}),
|
|
77
79
|
...TimeLog.shape
|
|
78
80
|
});
|
|
@@ -144,10 +146,9 @@ var CompanyUser = z4.object({
|
|
|
144
146
|
roles: z4.array(companyUserRoles).transform((roles) => {
|
|
145
147
|
const newRoles = [];
|
|
146
148
|
for (const role of roles) {
|
|
147
|
-
if (
|
|
148
|
-
if (!newRoles.includes(role)) newRoles.push(role);
|
|
149
|
+
if (!!role && !newRoles.includes(role)) newRoles.push(role);
|
|
149
150
|
}
|
|
150
|
-
return newRoles;
|
|
151
|
+
return newRoles.sort();
|
|
151
152
|
}).refine((roles) => {
|
|
152
153
|
const compatibleRoles = getCompatibleRoles(roles[0]);
|
|
153
154
|
return roles.every(
|
|
@@ -157,7 +158,7 @@ var CompanyUser = z4.object({
|
|
|
157
158
|
lastActive: z4.number(),
|
|
158
159
|
...TimeLog.shape
|
|
159
160
|
});
|
|
160
|
-
var
|
|
161
|
+
var _staffDetails = z4.object({
|
|
161
162
|
uid: CompanyIdentity.shape.uid,
|
|
162
163
|
members: z4.array(CompanyUser).superRefine((users, ctx) => {
|
|
163
164
|
const duplicateUids = [];
|
|
@@ -203,23 +204,22 @@ var StaffDetails = z4.object({
|
|
|
203
204
|
partners.push(uid);
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
return partners;
|
|
207
|
+
return partners.sort();
|
|
207
208
|
})
|
|
208
209
|
),
|
|
209
210
|
blackList: z4.array(CompanyUser.shape.uid).transform((list) => {
|
|
210
211
|
const newList = [];
|
|
211
212
|
for (const uid of list) {
|
|
212
213
|
if (!uid || typeof uid !== "string") continue;
|
|
213
|
-
if (!newList.some(
|
|
214
|
-
(newUid) => newUid.toLowerCase() === uid.toLowerCase()
|
|
215
|
-
)) {
|
|
214
|
+
if (!newList.some((newUid) => newUid.toLowerCase() === uid.toLowerCase())) {
|
|
216
215
|
newList.push(uid);
|
|
217
216
|
}
|
|
218
217
|
}
|
|
219
|
-
return newList;
|
|
218
|
+
return newList.sort();
|
|
220
219
|
})
|
|
221
220
|
// ...TimeLog.shape,
|
|
222
|
-
})
|
|
221
|
+
});
|
|
222
|
+
var StaffDetails = _staffDetails.transform((d) => {
|
|
223
223
|
let blackListWithExisitingUsers = [];
|
|
224
224
|
for (const uid of d.blackList) {
|
|
225
225
|
if (!uid || typeof uid !== "string") continue;
|
|
@@ -260,10 +260,10 @@ var StaffDetails = z4.object({
|
|
|
260
260
|
});
|
|
261
261
|
var CompanyDetails = z4.object({
|
|
262
262
|
uid: z4.string(),
|
|
263
|
-
identity: CompanyIdentity,
|
|
264
|
-
opState: CompanyOpState,
|
|
265
|
-
billing: CompanyBillingModel,
|
|
266
|
-
staffDetails:
|
|
263
|
+
identity: CompanyIdentity.omit({ uid: true }),
|
|
264
|
+
opState: CompanyOpState.omit({ uid: true }),
|
|
265
|
+
billing: CompanyBillingModel.omit({ uid: true }),
|
|
266
|
+
staffDetails: _staffDetails.omit({ uid: true })
|
|
267
267
|
});
|
|
268
268
|
|
|
269
269
|
// src/functions/helper-functions.ts
|