@bizmap/sdk 0.0.70 → 0.0.72
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 +207 -226
- package/dist/main.js +131 -121
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare const companyUserRoles: z.ZodEnum<{
|
|
|
6
6
|
physAsst: "physAsst";
|
|
7
7
|
rcpst: "rcpst";
|
|
8
8
|
cshr: "cshr";
|
|
9
|
-
|
|
9
|
+
founder: "founder";
|
|
10
10
|
}>;
|
|
11
11
|
type CompanyUserRole = z.infer<typeof companyUserRoles>;
|
|
12
12
|
declare const companyPartnerRoles: z.ZodEnum<{
|
|
@@ -21,6 +21,9 @@ declare const employeeRoles: z.ZodEnum<{
|
|
|
21
21
|
cshr: "cshr";
|
|
22
22
|
}>;
|
|
23
23
|
type EmployeeRole = z.infer<typeof employeeRoles>;
|
|
24
|
+
declare const adminRoles: z.ZodEnum<{
|
|
25
|
+
founder: "founder";
|
|
26
|
+
}>;
|
|
24
27
|
declare const healthcareProviderRoles: z.ZodEnum<{
|
|
25
28
|
doc: "doc";
|
|
26
29
|
physAsst: "physAsst";
|
|
@@ -40,6 +43,12 @@ declare const companyTypes: z.ZodEnum<{
|
|
|
40
43
|
MEDICAL: "MEDICAL";
|
|
41
44
|
}>;
|
|
42
45
|
type CompanyType = z.infer<typeof companyTypes>;
|
|
46
|
+
declare const companyUserStatus: z.ZodEnum<{
|
|
47
|
+
inviteSent: "inviteSent";
|
|
48
|
+
active: "active";
|
|
49
|
+
inactive: "inactive";
|
|
50
|
+
}>;
|
|
51
|
+
type CompanyUserStatus = z.infer<typeof companyUserStatus>;
|
|
43
52
|
|
|
44
53
|
declare const tiers: z.ZodEnum<{
|
|
45
54
|
basic: "basic";
|
|
@@ -77,13 +86,14 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
77
86
|
MEDICAL: "MEDICAL";
|
|
78
87
|
}>>;
|
|
79
88
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
80
|
-
|
|
89
|
+
version: z.ZodInt;
|
|
90
|
+
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
91
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
81
92
|
streetAddress: z.ZodString;
|
|
82
93
|
city: z.ZodOptional<z.ZodString>;
|
|
83
94
|
parish: z.ZodString;
|
|
84
95
|
country: z.ZodString;
|
|
85
|
-
}, z.core.$strip
|
|
86
|
-
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
96
|
+
}, z.core.$strip>>;
|
|
87
97
|
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
88
98
|
contact: z.ZodObject<{
|
|
89
99
|
email: z.ZodEmail;
|
|
@@ -134,6 +144,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
134
144
|
state: z.ZodObject<{
|
|
135
145
|
createdAt: z.ZodInt;
|
|
136
146
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
147
|
+
version: z.ZodInt;
|
|
137
148
|
credits: z.ZodObject<{
|
|
138
149
|
current: z.ZodNumber;
|
|
139
150
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
@@ -152,6 +163,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
152
163
|
}, z.core.$strip>;
|
|
153
164
|
preferences: z.ZodObject<{
|
|
154
165
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
166
|
+
version: z.ZodInt;
|
|
155
167
|
serviceSelector: z.ZodEnum<{
|
|
156
168
|
scheduler: "scheduler";
|
|
157
169
|
doctor: "doctor";
|
|
@@ -164,6 +176,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
164
176
|
}, z.core.$strip>;
|
|
165
177
|
billing: z.ZodObject<{
|
|
166
178
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
179
|
+
version: z.ZodInt;
|
|
167
180
|
additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
168
181
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
169
182
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -234,34 +247,24 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
234
247
|
}, z.core.$strip>;
|
|
235
248
|
staff: z.ZodObject<{
|
|
236
249
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
250
|
+
version: z.ZodInt;
|
|
237
251
|
members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
238
|
-
|
|
252
|
+
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
239
253
|
email: z.ZodEmail;
|
|
240
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
241
254
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
242
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
-
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
244
|
-
doc: "doc";
|
|
245
|
-
physAsst: "physAsst";
|
|
246
|
-
rcpst: "rcpst";
|
|
247
|
-
cshr: "cshr";
|
|
248
|
-
admin: "admin";
|
|
249
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
250
|
-
isAvailable: z.ZodObject<{
|
|
251
|
-
value: z.ZodBoolean;
|
|
252
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
253
|
-
}, z.core.$strip>;
|
|
254
|
-
isBusy: z.ZodObject<{
|
|
255
|
-
value: z.ZodBoolean;
|
|
256
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
257
|
-
}, z.core.$strip>;
|
|
258
255
|
status: z.ZodEnum<{
|
|
259
256
|
inviteSent: "inviteSent";
|
|
260
257
|
active: "active";
|
|
261
258
|
inactive: "inactive";
|
|
262
259
|
}>;
|
|
263
|
-
inviteSent: z.ZodNullable<z.ZodInt>;
|
|
264
260
|
appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
261
|
+
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
262
|
+
doc: "doc";
|
|
263
|
+
physAsst: "physAsst";
|
|
264
|
+
rcpst: "rcpst";
|
|
265
|
+
cshr: "cshr";
|
|
266
|
+
founder: "founder";
|
|
267
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
265
268
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
266
269
|
inviteAccepted: z.ZodNullable<z.ZodInt>;
|
|
267
270
|
}, z.core.$strip>>;
|
|
@@ -278,8 +281,8 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
278
281
|
physAsst: "physAsst";
|
|
279
282
|
rcpst: "rcpst";
|
|
280
283
|
cshr: "cshr";
|
|
281
|
-
|
|
282
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
284
|
+
founder: "founder";
|
|
285
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
283
286
|
addedAt: z.ZodInt;
|
|
284
287
|
}, z.core.$strip>>;
|
|
285
288
|
}, z.core.$strip>>;
|
|
@@ -289,13 +292,13 @@ type CompanyDetails = z.infer<typeof CompanyDetails>;
|
|
|
289
292
|
declare const MutableCompanyDetails: z.ZodObject<{
|
|
290
293
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
291
294
|
identity: z.ZodOptional<z.ZodObject<{
|
|
292
|
-
|
|
295
|
+
alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
296
|
+
address: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
293
297
|
streetAddress: z.ZodString;
|
|
294
298
|
city: z.ZodOptional<z.ZodString>;
|
|
295
299
|
parish: z.ZodString;
|
|
296
300
|
country: z.ZodString;
|
|
297
|
-
}, z.core.$strip
|
|
298
|
-
alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
301
|
+
}, z.core.$strip>>>;
|
|
299
302
|
logo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
300
303
|
contact: z.ZodOptional<z.ZodObject<{
|
|
301
304
|
email: z.ZodEmail;
|
|
@@ -309,6 +312,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
309
312
|
}, z.core.$strip>>>;
|
|
310
313
|
}, z.core.$strip>>;
|
|
311
314
|
preferences: z.ZodOptional<z.ZodObject<{
|
|
315
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
312
316
|
_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
313
317
|
serviceSelector: z.ZodOptional<z.ZodEnum<{
|
|
314
318
|
scheduler: "scheduler";
|
|
@@ -321,6 +325,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
321
325
|
}>>>;
|
|
322
326
|
}, z.core.$strip>>;
|
|
323
327
|
billing: z.ZodOptional<z.ZodObject<{
|
|
328
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
324
329
|
_id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
325
330
|
additionalFees: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
326
331
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
@@ -404,8 +409,8 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
404
409
|
physAsst: "physAsst";
|
|
405
410
|
rcpst: "rcpst";
|
|
406
411
|
cshr: "cshr";
|
|
407
|
-
|
|
408
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
412
|
+
founder: "founder";
|
|
413
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
409
414
|
addedAt: z.ZodInt;
|
|
410
415
|
}, z.core.$strip>>;
|
|
411
416
|
}, z.core.$strip>>>;
|
|
@@ -482,10 +487,12 @@ declare const CompanyBilling: z.ZodObject<{
|
|
|
482
487
|
cost: z.ZodNumber;
|
|
483
488
|
}, z.core.$strip>>;
|
|
484
489
|
}, z.core.$strip>;
|
|
490
|
+
version: z.ZodInt;
|
|
485
491
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
486
492
|
}, z.core.$strip>;
|
|
487
493
|
type CompanyBilling = z.infer<typeof CompanyBilling>;
|
|
488
494
|
declare const MutableCompanyBilling: z.ZodObject<{
|
|
495
|
+
version: z.ZodInt;
|
|
489
496
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
490
497
|
additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
491
498
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
@@ -560,16 +567,16 @@ type MutableCompanyBilling = z.infer<typeof MutableCompanyBilling>;
|
|
|
560
567
|
declare const CompanyIdentity: z.ZodObject<{
|
|
561
568
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
562
569
|
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
563
|
-
|
|
564
|
-
type: z.ZodReadonly<z.ZodEnum<{
|
|
565
|
-
MEDICAL: "MEDICAL";
|
|
566
|
-
}>>;
|
|
567
|
-
address: z.ZodObject<{
|
|
570
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
568
571
|
streetAddress: z.ZodString;
|
|
569
572
|
city: z.ZodOptional<z.ZodString>;
|
|
570
573
|
parish: z.ZodString;
|
|
571
574
|
country: z.ZodString;
|
|
572
|
-
}, z.core.$strip
|
|
575
|
+
}, z.core.$strip>>;
|
|
576
|
+
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
577
|
+
type: z.ZodReadonly<z.ZodEnum<{
|
|
578
|
+
MEDICAL: "MEDICAL";
|
|
579
|
+
}>>;
|
|
573
580
|
contact: z.ZodObject<{
|
|
574
581
|
email: z.ZodEmail;
|
|
575
582
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -590,17 +597,18 @@ declare const CompanyIdentity: z.ZodObject<{
|
|
|
590
597
|
trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
591
598
|
gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
592
599
|
}, z.core.$strip>>;
|
|
600
|
+
version: z.ZodInt;
|
|
593
601
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
594
602
|
}, z.core.$strip>;
|
|
595
603
|
type CompanyIdentity = z.infer<typeof CompanyIdentity>;
|
|
596
604
|
declare const MutableCompanyIdentity: z.ZodObject<{
|
|
597
|
-
|
|
605
|
+
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
606
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
598
607
|
streetAddress: z.ZodString;
|
|
599
608
|
city: z.ZodOptional<z.ZodString>;
|
|
600
609
|
parish: z.ZodString;
|
|
601
610
|
country: z.ZodString;
|
|
602
|
-
}, z.core.$strip
|
|
603
|
-
alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
611
|
+
}, z.core.$strip>>;
|
|
604
612
|
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
605
613
|
contact: z.ZodObject<{
|
|
606
614
|
email: z.ZodEmail;
|
|
@@ -641,10 +649,12 @@ declare const CompanyPreferences: z.ZodObject<{
|
|
|
641
649
|
RR: "RR";
|
|
642
650
|
LOR: "LOR";
|
|
643
651
|
}>>;
|
|
652
|
+
version: z.ZodInt;
|
|
644
653
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
645
654
|
}, z.core.$strip>;
|
|
646
655
|
type CompanyPreferences = z.infer<typeof CompanyPreferences>;
|
|
647
656
|
declare const MutableCompanyPreferences: z.ZodObject<{
|
|
657
|
+
version: z.ZodInt;
|
|
648
658
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
649
659
|
serviceSelector: z.ZodEnum<{
|
|
650
660
|
scheduler: "scheduler";
|
|
@@ -660,33 +670,22 @@ type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
|
|
|
660
670
|
|
|
661
671
|
declare const CompanyStaff: z.ZodObject<{
|
|
662
672
|
members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
663
|
-
|
|
673
|
+
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
664
674
|
email: z.ZodEmail;
|
|
665
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
666
675
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
667
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
668
|
-
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
669
|
-
doc: "doc";
|
|
670
|
-
physAsst: "physAsst";
|
|
671
|
-
rcpst: "rcpst";
|
|
672
|
-
cshr: "cshr";
|
|
673
|
-
admin: "admin";
|
|
674
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
675
|
-
isAvailable: z.ZodObject<{
|
|
676
|
-
value: z.ZodBoolean;
|
|
677
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
678
|
-
}, z.core.$strip>;
|
|
679
|
-
isBusy: z.ZodObject<{
|
|
680
|
-
value: z.ZodBoolean;
|
|
681
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
682
|
-
}, z.core.$strip>;
|
|
683
676
|
status: z.ZodEnum<{
|
|
684
677
|
inviteSent: "inviteSent";
|
|
685
678
|
active: "active";
|
|
686
679
|
inactive: "inactive";
|
|
687
680
|
}>;
|
|
688
|
-
inviteSent: z.ZodNullable<z.ZodInt>;
|
|
689
681
|
appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
682
|
+
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
683
|
+
doc: "doc";
|
|
684
|
+
physAsst: "physAsst";
|
|
685
|
+
rcpst: "rcpst";
|
|
686
|
+
cshr: "cshr";
|
|
687
|
+
founder: "founder";
|
|
688
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
690
689
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
691
690
|
inviteAccepted: z.ZodNullable<z.ZodInt>;
|
|
692
691
|
}, z.core.$strip>>;
|
|
@@ -704,11 +703,12 @@ declare const CompanyStaff: z.ZodObject<{
|
|
|
704
703
|
physAsst: "physAsst";
|
|
705
704
|
rcpst: "rcpst";
|
|
706
705
|
cshr: "cshr";
|
|
707
|
-
|
|
708
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
706
|
+
founder: "founder";
|
|
707
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
709
708
|
addedAt: z.ZodInt;
|
|
710
709
|
}, z.core.$strip>>;
|
|
711
710
|
}, z.core.$strip>>;
|
|
711
|
+
version: z.ZodInt;
|
|
712
712
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
713
713
|
}, z.core.$strip>;
|
|
714
714
|
type CompanyStaff = z.infer<typeof CompanyStaff>;
|
|
@@ -732,19 +732,19 @@ declare const CompanyState: z.ZodObject<{
|
|
|
732
732
|
tktNoCounter: z.ZodInt;
|
|
733
733
|
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
734
734
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
735
|
+
version: z.ZodInt;
|
|
735
736
|
createdAt: z.ZodInt;
|
|
736
737
|
}, z.core.$strip>;
|
|
737
738
|
type CompanyState = z.infer<typeof CompanyState>;
|
|
738
739
|
|
|
739
|
-
declare const
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
740
|
+
declare const CompanyUserSession: z.ZodObject<{
|
|
741
|
+
ip: z.ZodString;
|
|
742
|
+
user: z.ZodObject<{
|
|
743
|
+
_id: z.ZodUUID;
|
|
744
|
+
email: z.ZodEmail;
|
|
745
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
746
|
+
}, z.core.$strip>;
|
|
747
|
+
companyId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
748
748
|
isAvailable: z.ZodObject<{
|
|
749
749
|
value: z.ZodBoolean;
|
|
750
750
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
@@ -753,47 +753,51 @@ declare const MiniCompanyUser: z.ZodObject<{
|
|
|
753
753
|
value: z.ZodBoolean;
|
|
754
754
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
755
755
|
}, z.core.$strip>;
|
|
756
|
-
status: z.ZodEnum<{
|
|
757
|
-
inviteSent: "inviteSent";
|
|
758
|
-
active: "active";
|
|
759
|
-
inactive: "inactive";
|
|
760
|
-
}>;
|
|
761
756
|
appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
757
|
+
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
758
|
+
doc: "doc";
|
|
759
|
+
physAsst: "physAsst";
|
|
760
|
+
rcpst: "rcpst";
|
|
761
|
+
cshr: "cshr";
|
|
762
|
+
founder: "founder";
|
|
763
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
764
|
+
expiresAfter: z.ZodDate;
|
|
765
|
+
}, z.core.$strip>;
|
|
766
|
+
declare const MiniCompanyUser: z.ZodObject<{
|
|
762
767
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
763
|
-
inviteSent: z.ZodNullable<z.ZodInt
|
|
768
|
+
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
764
769
|
inviteAccepted: z.ZodNullable<z.ZodInt>;
|
|
765
|
-
|
|
766
|
-
type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
|
|
767
|
-
declare const CompanyUser: z.ZodObject<{
|
|
768
|
-
_id: z.ZodUUID;
|
|
769
|
-
email: z.ZodEmail;
|
|
770
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
771
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
772
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
770
|
+
appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
773
771
|
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
774
772
|
doc: "doc";
|
|
775
773
|
physAsst: "physAsst";
|
|
776
774
|
rcpst: "rcpst";
|
|
777
775
|
cshr: "cshr";
|
|
778
|
-
|
|
779
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
isBusy: z.ZodObject<{
|
|
785
|
-
value: z.ZodBoolean;
|
|
786
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
787
|
-
}, z.core.$strip>;
|
|
776
|
+
founder: "founder";
|
|
777
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
778
|
+
_id: z.ZodUUID;
|
|
779
|
+
}, z.core.$strip>;
|
|
780
|
+
type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
|
|
781
|
+
declare const CompanyUser: z.ZodObject<{
|
|
788
782
|
status: z.ZodEnum<{
|
|
789
783
|
inviteSent: "inviteSent";
|
|
790
784
|
active: "active";
|
|
791
785
|
inactive: "inactive";
|
|
792
786
|
}>;
|
|
793
|
-
|
|
794
|
-
|
|
787
|
+
_id: z.ZodUUID;
|
|
788
|
+
email: z.ZodEmail;
|
|
789
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
795
790
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
791
|
+
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
796
792
|
inviteAccepted: z.ZodNullable<z.ZodInt>;
|
|
793
|
+
appointments: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
794
|
+
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
795
|
+
doc: "doc";
|
|
796
|
+
physAsst: "physAsst";
|
|
797
|
+
rcpst: "rcpst";
|
|
798
|
+
cshr: "cshr";
|
|
799
|
+
founder: "founder";
|
|
800
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
797
801
|
}, z.core.$strip>;
|
|
798
802
|
type CompanyUser = z.infer<typeof CompanyUser>;
|
|
799
803
|
|
|
@@ -804,76 +808,11 @@ declare const CompanyInviteList: z.ZodRecord<z.ZodEmail, z.ZodObject<{
|
|
|
804
808
|
physAsst: "physAsst";
|
|
805
809
|
rcpst: "rcpst";
|
|
806
810
|
cshr: "cshr";
|
|
807
|
-
|
|
808
|
-
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
811
|
+
founder: "founder";
|
|
812
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[]>>;
|
|
809
813
|
}, z.core.$strip>>;
|
|
810
814
|
type CompanyInviteList = z.infer<typeof CompanyInviteList>;
|
|
811
815
|
|
|
812
|
-
declare const PriceAdjustment: z.ZodObject<{
|
|
813
|
-
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
814
|
-
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
815
|
-
description: z.ZodOptional<z.ZodString>;
|
|
816
|
-
fixedAmount: z.ZodObject<{
|
|
817
|
-
value: z.ZodNumber;
|
|
818
|
-
currency: z.ZodEnum<{
|
|
819
|
-
JMD: "JMD";
|
|
820
|
-
USD: "USD";
|
|
821
|
-
EUR: "EUR";
|
|
822
|
-
GBP: "GBP";
|
|
823
|
-
CAD: "CAD";
|
|
824
|
-
}>;
|
|
825
|
-
}, z.core.$strip>;
|
|
826
|
-
percentage: z.ZodNumber;
|
|
827
|
-
isOptional: z.ZodBoolean;
|
|
828
|
-
}, z.core.$strip>;
|
|
829
|
-
type PriceAdjustment = z.infer<typeof PriceAdjustment>;
|
|
830
|
-
declare const PriceTag: z.ZodObject<{
|
|
831
|
-
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
832
|
-
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
833
|
-
uid: z.ZodUUID;
|
|
834
|
-
item: z.ZodString;
|
|
835
|
-
cost: z.ZodNumber;
|
|
836
|
-
currency: z.ZodEnum<{
|
|
837
|
-
JMD: "JMD";
|
|
838
|
-
USD: "USD";
|
|
839
|
-
EUR: "EUR";
|
|
840
|
-
GBP: "GBP";
|
|
841
|
-
CAD: "CAD";
|
|
842
|
-
}>;
|
|
843
|
-
}, z.core.$strip>;
|
|
844
|
-
type PriceTag = z.infer<typeof PriceTag>;
|
|
845
|
-
declare const Receipts: z.ZodArray<z.ZodObject<{
|
|
846
|
-
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
847
|
-
currency: z.ZodEnum<{
|
|
848
|
-
JMD: "JMD";
|
|
849
|
-
USD: "USD";
|
|
850
|
-
EUR: "EUR";
|
|
851
|
-
GBP: "GBP";
|
|
852
|
-
CAD: "CAD";
|
|
853
|
-
}>;
|
|
854
|
-
item: z.ZodString;
|
|
855
|
-
cost: z.ZodNumber;
|
|
856
|
-
}, z.core.$strip>>;
|
|
857
|
-
|
|
858
|
-
declare const ClientIdentity: z.ZodObject<{
|
|
859
|
-
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
860
|
-
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
861
|
-
_id: z.ZodUUID;
|
|
862
|
-
email: z.ZodEmail;
|
|
863
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
864
|
-
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
865
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
866
|
-
linked: z.ZodBoolean;
|
|
867
|
-
dob: z.ZodOptional<z.ZodInt>;
|
|
868
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
869
|
-
streetAddress: z.ZodString;
|
|
870
|
-
city: z.ZodOptional<z.ZodString>;
|
|
871
|
-
parish: z.ZodString;
|
|
872
|
-
country: z.ZodString;
|
|
873
|
-
}, z.core.$strip>>;
|
|
874
|
-
}, z.core.$strip>;
|
|
875
|
-
type ClientIdentity = z.infer<typeof ClientIdentity>;
|
|
876
|
-
|
|
877
816
|
declare const TierList: z.ZodRecord<z.ZodEnum<{
|
|
878
817
|
basic: "basic";
|
|
879
818
|
pro: "pro";
|
|
@@ -970,9 +909,76 @@ declare const MedicalDetails: z.ZodObject<{
|
|
|
970
909
|
}, z.core.$strip>;
|
|
971
910
|
type MedicalDetails = z.infer<typeof MedicalDetails>;
|
|
972
911
|
|
|
912
|
+
declare const InvoiceNo: z.ZodString;
|
|
913
|
+
declare const StandardTime: z.ZodString;
|
|
914
|
+
declare const Timestamp: z.ZodInt;
|
|
915
|
+
declare const InviteResponse: z.ZodEnum<{
|
|
916
|
+
accepted: "accepted";
|
|
917
|
+
declined: "declined";
|
|
918
|
+
}>;
|
|
919
|
+
type InviteResponse = z.infer<typeof InviteResponse>;
|
|
920
|
+
declare const TimeLog: z.ZodObject<{
|
|
921
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
922
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
923
|
+
}, z.core.$strip>;
|
|
924
|
+
type TimeLog = z.infer<typeof TimeLog>;
|
|
925
|
+
declare const TicketNo: z.ZodReadonly<z.ZodInt>;
|
|
926
|
+
declare const Reason: z.ZodObject<{
|
|
927
|
+
value: z.ZodString;
|
|
928
|
+
lastModified: z.ZodInt;
|
|
929
|
+
}, z.core.$strip>;
|
|
930
|
+
declare const Version: z.ZodInt;
|
|
931
|
+
|
|
932
|
+
declare const PriceAdjustment: z.ZodObject<{
|
|
933
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
934
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
935
|
+
description: z.ZodOptional<z.ZodString>;
|
|
936
|
+
fixedAmount: z.ZodObject<{
|
|
937
|
+
value: z.ZodNumber;
|
|
938
|
+
currency: z.ZodEnum<{
|
|
939
|
+
JMD: "JMD";
|
|
940
|
+
USD: "USD";
|
|
941
|
+
EUR: "EUR";
|
|
942
|
+
GBP: "GBP";
|
|
943
|
+
CAD: "CAD";
|
|
944
|
+
}>;
|
|
945
|
+
}, z.core.$strip>;
|
|
946
|
+
percentage: z.ZodNumber;
|
|
947
|
+
isOptional: z.ZodBoolean;
|
|
948
|
+
}, z.core.$strip>;
|
|
949
|
+
type PriceAdjustment = z.infer<typeof PriceAdjustment>;
|
|
950
|
+
declare const PriceTag: z.ZodObject<{
|
|
951
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
952
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
953
|
+
uid: z.ZodUUID;
|
|
954
|
+
item: z.ZodString;
|
|
955
|
+
cost: z.ZodNumber;
|
|
956
|
+
currency: z.ZodEnum<{
|
|
957
|
+
JMD: "JMD";
|
|
958
|
+
USD: "USD";
|
|
959
|
+
EUR: "EUR";
|
|
960
|
+
GBP: "GBP";
|
|
961
|
+
CAD: "CAD";
|
|
962
|
+
}>;
|
|
963
|
+
}, z.core.$strip>;
|
|
964
|
+
type PriceTag = z.infer<typeof PriceTag>;
|
|
965
|
+
declare const Receipts: z.ZodArray<z.ZodObject<{
|
|
966
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
967
|
+
currency: z.ZodEnum<{
|
|
968
|
+
JMD: "JMD";
|
|
969
|
+
USD: "USD";
|
|
970
|
+
EUR: "EUR";
|
|
971
|
+
GBP: "GBP";
|
|
972
|
+
CAD: "CAD";
|
|
973
|
+
}>;
|
|
974
|
+
item: z.ZodString;
|
|
975
|
+
cost: z.ZodNumber;
|
|
976
|
+
}, z.core.$strip>>;
|
|
977
|
+
|
|
973
978
|
declare const UserDetails: z.ZodObject<{
|
|
974
979
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
975
980
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
981
|
+
version: z.ZodInt;
|
|
976
982
|
_id: z.ZodUUID;
|
|
977
983
|
email: z.ZodEmail;
|
|
978
984
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
@@ -992,28 +998,28 @@ declare const UserDetails: z.ZodObject<{
|
|
|
992
998
|
}, z.core.$strip>;
|
|
993
999
|
createdAt: z.ZodInt;
|
|
994
1000
|
}, z.core.$strip>>;
|
|
995
|
-
linked: z.ZodBoolean;
|
|
996
1001
|
}, z.core.$strip>;
|
|
997
1002
|
type UserDetails = z.infer<typeof UserDetails>;
|
|
998
1003
|
|
|
999
|
-
declare const
|
|
1000
|
-
declare const StandardTime: z.ZodString;
|
|
1001
|
-
declare const Timestamp: z.ZodInt;
|
|
1002
|
-
declare const InviteResponse: z.ZodEnum<{
|
|
1003
|
-
accepted: "accepted";
|
|
1004
|
-
declined: "declined";
|
|
1005
|
-
}>;
|
|
1006
|
-
type InviteResponse = z.infer<typeof InviteResponse>;
|
|
1007
|
-
declare const TimeLog: z.ZodObject<{
|
|
1004
|
+
declare const ClientIdentity: z.ZodObject<{
|
|
1008
1005
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1009
1006
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1007
|
+
version: z.ZodInt;
|
|
1008
|
+
_id: z.ZodUUID;
|
|
1009
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1010
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1011
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1012
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
1013
|
+
dob: z.ZodOptional<z.ZodInt>;
|
|
1014
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
1015
|
+
streetAddress: z.ZodString;
|
|
1016
|
+
city: z.ZodOptional<z.ZodString>;
|
|
1017
|
+
parish: z.ZodString;
|
|
1018
|
+
country: z.ZodString;
|
|
1019
|
+
}, z.core.$strip>>;
|
|
1020
|
+
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
1010
1021
|
}, z.core.$strip>;
|
|
1011
|
-
type
|
|
1012
|
-
declare const TicketNo: z.ZodReadonly<z.ZodInt>;
|
|
1013
|
-
declare const Reason: z.ZodObject<{
|
|
1014
|
-
value: z.ZodString;
|
|
1015
|
-
lastModified: z.ZodInt;
|
|
1016
|
-
}, z.core.$strip>;
|
|
1022
|
+
type ClientIdentity = z.infer<typeof ClientIdentity>;
|
|
1017
1023
|
|
|
1018
1024
|
declare const MiniAppointmentDetails: z.ZodObject<{
|
|
1019
1025
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
@@ -1315,12 +1321,12 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1315
1321
|
client: z.ZodObject<{
|
|
1316
1322
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1317
1323
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1324
|
+
version: z.ZodInt;
|
|
1318
1325
|
_id: z.ZodUUID;
|
|
1319
|
-
email: z.ZodEmail;
|
|
1320
1326
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1321
1327
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1322
1328
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1323
|
-
|
|
1329
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
1324
1330
|
dob: z.ZodOptional<z.ZodInt>;
|
|
1325
1331
|
address: z.ZodOptional<z.ZodObject<{
|
|
1326
1332
|
streetAddress: z.ZodString;
|
|
@@ -1328,6 +1334,7 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1328
1334
|
parish: z.ZodString;
|
|
1329
1335
|
country: z.ZodString;
|
|
1330
1336
|
}, z.core.$strip>>;
|
|
1337
|
+
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
1331
1338
|
}, z.core.$strip>;
|
|
1332
1339
|
}, z.core.$strip>;
|
|
1333
1340
|
type AppointmentDetails = z.infer<typeof AppointmentDetails>;
|
|
@@ -1481,12 +1488,12 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1481
1488
|
client: z.ZodObject<{
|
|
1482
1489
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1483
1490
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1491
|
+
version: z.ZodInt;
|
|
1484
1492
|
_id: z.ZodUUID;
|
|
1485
|
-
email: z.ZodEmail;
|
|
1486
1493
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1487
1494
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1488
1495
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1489
|
-
|
|
1496
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
1490
1497
|
dob: z.ZodOptional<z.ZodInt>;
|
|
1491
1498
|
address: z.ZodOptional<z.ZodObject<{
|
|
1492
1499
|
streetAddress: z.ZodString;
|
|
@@ -1494,6 +1501,7 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1494
1501
|
parish: z.ZodString;
|
|
1495
1502
|
country: z.ZodString;
|
|
1496
1503
|
}, z.core.$strip>>;
|
|
1504
|
+
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
1497
1505
|
}, z.core.$strip>;
|
|
1498
1506
|
_hash: z.ZodString;
|
|
1499
1507
|
}, z.core.$strip>;
|
|
@@ -1584,29 +1592,19 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1584
1592
|
tktNoCounter: number;
|
|
1585
1593
|
lastSavedAt: number | null;
|
|
1586
1594
|
lastModified: number | null;
|
|
1595
|
+
version: number;
|
|
1587
1596
|
createdAt: number;
|
|
1588
1597
|
};
|
|
1589
1598
|
staffDetails: {
|
|
1590
1599
|
members: Record<string, {
|
|
1591
|
-
_id: string;
|
|
1592
1600
|
email: string;
|
|
1593
1601
|
name: string;
|
|
1594
|
-
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1595
|
-
isAvailable: {
|
|
1596
|
-
value: boolean;
|
|
1597
|
-
lastModified: number | null;
|
|
1598
|
-
};
|
|
1599
|
-
isBusy: {
|
|
1600
|
-
value: boolean;
|
|
1601
|
-
lastModified: number | null;
|
|
1602
|
-
};
|
|
1603
1602
|
status: "inviteSent" | "active" | "inactive";
|
|
1604
|
-
inviteSent: number | null;
|
|
1605
1603
|
appointments: Record<"ongoing" | "completed", number>;
|
|
1604
|
+
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
|
|
1606
1605
|
lastActive: number | null;
|
|
1607
1606
|
inviteAccepted: number | null;
|
|
1608
|
-
|
|
1609
|
-
photoUrl?: string | null | undefined;
|
|
1607
|
+
inviteSent?: number | null | undefined;
|
|
1610
1608
|
}>;
|
|
1611
1609
|
_id: string;
|
|
1612
1610
|
partnerMap: Record<string, Record<string, {
|
|
@@ -1617,10 +1615,11 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1617
1615
|
addedAt: number;
|
|
1618
1616
|
} | undefined;
|
|
1619
1617
|
$CHANGE_ROLES?: {
|
|
1620
|
-
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "
|
|
1618
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
|
|
1621
1619
|
addedAt: number;
|
|
1622
1620
|
} | undefined;
|
|
1623
1621
|
}>;
|
|
1622
|
+
version: number;
|
|
1624
1623
|
lastModified: number | null;
|
|
1625
1624
|
};
|
|
1626
1625
|
};
|
|
@@ -1689,13 +1688,13 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1689
1688
|
};
|
|
1690
1689
|
client: {
|
|
1691
1690
|
createdAt: number;
|
|
1691
|
+
version: number;
|
|
1692
1692
|
_id: string;
|
|
1693
|
-
email: string;
|
|
1694
1693
|
name: string;
|
|
1695
|
-
linked: boolean;
|
|
1696
1694
|
lastModified?: number | null | undefined;
|
|
1697
1695
|
phoneNumber?: string | undefined;
|
|
1698
1696
|
photoUrl?: string | null | undefined;
|
|
1697
|
+
email?: string | undefined;
|
|
1699
1698
|
dob?: number | undefined;
|
|
1700
1699
|
address?: {
|
|
1701
1700
|
streetAddress: string;
|
|
@@ -1703,6 +1702,7 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1703
1702
|
country: string;
|
|
1704
1703
|
city?: string | undefined;
|
|
1705
1704
|
} | undefined;
|
|
1705
|
+
linkedTo?: string | undefined;
|
|
1706
1706
|
};
|
|
1707
1707
|
_hash: string;
|
|
1708
1708
|
lastModified?: number | null | undefined;
|
|
@@ -1775,41 +1775,22 @@ declare function findNextAvailableStaff(userUids: string[], algorithm: CompanyPr
|
|
|
1775
1775
|
* @returns {(CompanyUser|MiniCompanyUser)[]|null} an array of the users that have conflicting roles or roles that are
|
|
1776
1776
|
* incompatible with the other partners, or null if none was found. */
|
|
1777
1777
|
declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyUser)[]) => ({
|
|
1778
|
+
status: "inviteSent" | "active" | "inactive";
|
|
1778
1779
|
_id: string;
|
|
1779
1780
|
email: string;
|
|
1780
1781
|
name: string;
|
|
1781
|
-
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1782
|
-
isAvailable: {
|
|
1783
|
-
value: boolean;
|
|
1784
|
-
lastModified: number | null;
|
|
1785
|
-
};
|
|
1786
|
-
isBusy: {
|
|
1787
|
-
value: boolean;
|
|
1788
|
-
lastModified: number | null;
|
|
1789
|
-
};
|
|
1790
|
-
status: "inviteSent" | "active" | "inactive";
|
|
1791
|
-
inviteSent: number | null;
|
|
1792
|
-
appointments: Record<"ongoing" | "completed", number>;
|
|
1793
1782
|
lastActive: number | null;
|
|
1794
1783
|
inviteAccepted: number | null;
|
|
1795
|
-
phoneNumber?: string | undefined;
|
|
1796
|
-
photoUrl?: string | null | undefined;
|
|
1797
|
-
} | {
|
|
1798
|
-
_id: string;
|
|
1799
|
-
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1800
|
-
isAvailable: {
|
|
1801
|
-
value: boolean;
|
|
1802
|
-
lastModified: number | null;
|
|
1803
|
-
};
|
|
1804
|
-
isBusy: {
|
|
1805
|
-
value: boolean;
|
|
1806
|
-
lastModified: number | null;
|
|
1807
|
-
};
|
|
1808
|
-
status: "inviteSent" | "active" | "inactive";
|
|
1809
1784
|
appointments: Record<"ongoing" | "completed", number>;
|
|
1785
|
+
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
|
|
1786
|
+
inviteSent?: number | null | undefined;
|
|
1787
|
+
} | {
|
|
1810
1788
|
lastActive: number | null;
|
|
1811
|
-
inviteSent: number | null;
|
|
1812
1789
|
inviteAccepted: number | null;
|
|
1790
|
+
appointments: Record<"ongoing" | "completed", number>;
|
|
1791
|
+
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "founder")[];
|
|
1792
|
+
_id: string;
|
|
1793
|
+
inviteSent?: number | null | undefined;
|
|
1813
1794
|
})[] | null;
|
|
1814
1795
|
/**
|
|
1815
1796
|
* @param {CompanyUserRole} role
|
|
@@ -1822,4 +1803,4 @@ declare function createNotifId(options?: {
|
|
|
1822
1803
|
to: string;
|
|
1823
1804
|
}): string;
|
|
1824
1805
|
|
|
1825
|
-
export { AppointmentDetails, type AppointmentDistAlg, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CreditCurrency, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Vitals, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, getCompatibleRoles, healthcareProviderRoles, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
|
|
1806
|
+
export { AppointmentDetails, type AppointmentDistAlg, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreditCurrency, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Version, Vitals, adminRoles, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, getCompatibleRoles, healthcareProviderRoles, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
|
package/dist/main.js
CHANGED
|
@@ -5,13 +5,15 @@ var companyUserRoles = z.enum([
|
|
|
5
5
|
"physAsst",
|
|
6
6
|
"rcpst",
|
|
7
7
|
"cshr",
|
|
8
|
-
"
|
|
8
|
+
"founder"
|
|
9
|
+
// "admin",
|
|
9
10
|
]);
|
|
10
11
|
var companyPartnerRoles = companyUserRoles.extract([
|
|
11
12
|
"doc",
|
|
12
13
|
"physAsst"
|
|
13
14
|
]);
|
|
14
|
-
var employeeRoles = companyUserRoles.exclude(["
|
|
15
|
+
var employeeRoles = companyUserRoles.exclude(["founder"]);
|
|
16
|
+
var adminRoles = companyUserRoles.extract(["founder"]);
|
|
15
17
|
var healthcareProviderRoles = companyUserRoles.extract([
|
|
16
18
|
"physAsst",
|
|
17
19
|
"doc"
|
|
@@ -19,6 +21,7 @@ var healthcareProviderRoles = companyUserRoles.extract([
|
|
|
19
21
|
var appointmentDistAlgs = z.enum(["RR", "LOR"]);
|
|
20
22
|
var companyServiceSelectors = z.enum(["scheduler", "doctor"]);
|
|
21
23
|
var companyTypes = z.enum(["MEDICAL"]);
|
|
24
|
+
var companyUserStatus = z.enum(["inviteSent", "active", "inactive"]);
|
|
22
25
|
|
|
23
26
|
// src/enums/Global.ts
|
|
24
27
|
import * as z2 from "zod";
|
|
@@ -47,11 +50,14 @@ var serviceProviders = z4.enum([
|
|
|
47
50
|
// src/schemas/company/CompanyDetails.ts
|
|
48
51
|
import * as z16 from "zod";
|
|
49
52
|
|
|
50
|
-
// src/schemas/Billing.ts
|
|
53
|
+
// src/schemas/company/components/Billing.ts
|
|
54
|
+
import * as z8 from "zod";
|
|
55
|
+
|
|
56
|
+
// src/schemas/utils/billing.ts
|
|
51
57
|
import { currencies } from "@wavy/util";
|
|
52
58
|
import * as z6 from "zod";
|
|
53
59
|
|
|
54
|
-
// src/schemas/utils.ts
|
|
60
|
+
// src/schemas/utils/core.ts
|
|
55
61
|
import * as z5 from "zod";
|
|
56
62
|
var InvoiceNo = z5.string().regex(
|
|
57
63
|
/^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
|
|
@@ -78,8 +84,9 @@ var Reason = z5.object({
|
|
|
78
84
|
value: z5.string().trim().max(150),
|
|
79
85
|
lastModified: Timestamp
|
|
80
86
|
});
|
|
87
|
+
var Version = z5.int().min(1);
|
|
81
88
|
|
|
82
|
-
// src/schemas/
|
|
89
|
+
// src/schemas/utils/billing.ts
|
|
83
90
|
var PriceAdjustment = z6.object({
|
|
84
91
|
description: z6.string().trim().min(3, "A description must have atleast (3) characters.").max(25, "A description can't have more that (25) characters.").optional(),
|
|
85
92
|
fixedAmount: z6.object({
|
|
@@ -102,9 +109,6 @@ var Receipts = z6.array(
|
|
|
102
109
|
PriceTag.omit({ uid: true, lastModified: true })
|
|
103
110
|
);
|
|
104
111
|
|
|
105
|
-
// src/schemas/company/components/Billing.ts
|
|
106
|
-
import * as z8 from "zod";
|
|
107
|
-
|
|
108
112
|
// src/schemas/company/components/State.ts
|
|
109
113
|
import * as z7 from "zod";
|
|
110
114
|
var CompanyState = z7.object({
|
|
@@ -141,6 +145,7 @@ var CompanyState = z7.object({
|
|
|
141
145
|
tktNoCounter: z7.int().min(1),
|
|
142
146
|
lastSavedAt: Timestamp.nullable(),
|
|
143
147
|
lastModified: Timestamp.nullable(),
|
|
148
|
+
version: Version,
|
|
144
149
|
createdAt: Timestamp
|
|
145
150
|
});
|
|
146
151
|
|
|
@@ -174,6 +179,7 @@ var CompanyBilling = z8.object({
|
|
|
174
179
|
);
|
|
175
180
|
}
|
|
176
181
|
}),
|
|
182
|
+
version: Version,
|
|
177
183
|
lastModified: Timestamp.nullable()
|
|
178
184
|
});
|
|
179
185
|
var MutableCompanyBilling = CompanyBilling.omit({
|
|
@@ -189,9 +195,9 @@ var CompanyIdentity = z9.object({
|
|
|
189
195
|
alias: z9.string().trim().min(3).max(63).regex(/[a-z1-9 ]/gi).transform(
|
|
190
196
|
(data) => data.replace(/[^a-z1-9 ]/gi, "").replace(/\s+/g, " ")
|
|
191
197
|
),
|
|
192
|
-
|
|
198
|
+
address: Address.optional(),
|
|
199
|
+
logo: z9.string().nullish(),
|
|
193
200
|
type: companyTypes.readonly(),
|
|
194
|
-
address: Address,
|
|
195
201
|
contact: z9.object({
|
|
196
202
|
email: z9.email().max(25),
|
|
197
203
|
phoneNumber: PhoneNumber.optional(),
|
|
@@ -209,6 +215,7 @@ var CompanyIdentity = z9.object({
|
|
|
209
215
|
trn: z9.string().regex(/[0-9]{3}-[0-9]{3}-[0-9]{3}/).nullish(),
|
|
210
216
|
gctRegNo: z9.string().max(15).nullish()
|
|
211
217
|
}).optional(),
|
|
218
|
+
version: Version,
|
|
212
219
|
lastModified: Timestamp.nullable()
|
|
213
220
|
}).superRefine((data, ctx) => {
|
|
214
221
|
const hasLegalInfo = "legal" in data;
|
|
@@ -352,6 +359,7 @@ var CompanyPreferences = z12.object({
|
|
|
352
359
|
* @property LOR (Least Outstanding Requests): Distribute based on availability.
|
|
353
360
|
*/
|
|
354
361
|
apptDistAlg: appointmentDistAlgs.default("RR"),
|
|
362
|
+
version: Version,
|
|
355
363
|
lastModified: Timestamp.nullable()
|
|
356
364
|
}).refine(
|
|
357
365
|
(data) => !data.enforcePaidAppointments || data.enforcePaidAppointments && data.serviceSelector === "scheduler",
|
|
@@ -366,37 +374,8 @@ var MutableCompanyPreferences = CompanyPreferences.omit({
|
|
|
366
374
|
import * as z15 from "zod";
|
|
367
375
|
|
|
368
376
|
// src/schemas/company/components/User.ts
|
|
369
|
-
import { UserModel as UserModel2 } from "@wavy/util";
|
|
370
377
|
import * as z14 from "zod";
|
|
371
378
|
|
|
372
|
-
// src/schemas/User.ts
|
|
373
|
-
import { UserModel } from "@wavy/util";
|
|
374
|
-
import * as z13 from "zod";
|
|
375
|
-
var UserDetails = z13.object({
|
|
376
|
-
...UserModel.shape,
|
|
377
|
-
_id: z13.uuidv4(),
|
|
378
|
-
name: z13.string().transform((data) => {
|
|
379
|
-
const [firstName = "", lastName = ""] = data.split(" ");
|
|
380
|
-
return (firstName + " " + lastName).trim();
|
|
381
|
-
}).superRefine((data, ctx) => {
|
|
382
|
-
data.split(" ").forEach((name, idx) => {
|
|
383
|
-
const nty = idx === 0 ? "First" : "Last";
|
|
384
|
-
if (idx === 0 && name.length < 2) {
|
|
385
|
-
ctx.addIssue(`${nty} name must have at least (2) characters.`);
|
|
386
|
-
}
|
|
387
|
-
if (name.length > 25) {
|
|
388
|
-
ctx.addIssue(`${nty} name can't have more than (25) characters.`);
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
}),
|
|
392
|
-
email: UserModel.shape.email,
|
|
393
|
-
publicKey: z13.string().nullable(),
|
|
394
|
-
notifications: z13.array(Notification),
|
|
395
|
-
/** Only true when linked to a client */
|
|
396
|
-
linked: z13.boolean(),
|
|
397
|
-
...TimeLog.shape
|
|
398
|
-
}).omit({ uid: true });
|
|
399
|
-
|
|
400
379
|
// src/functions/helper-functions.ts
|
|
401
380
|
var findConflictingPartners = (...partners) => {
|
|
402
381
|
let hasSingleDoctor = false;
|
|
@@ -420,17 +399,55 @@ var findConflictingPartners = (...partners) => {
|
|
|
420
399
|
};
|
|
421
400
|
var getCompatibleRoles = (role) => {
|
|
422
401
|
if (role === "physAsst") {
|
|
423
|
-
return companyUserRoles.exclude([
|
|
402
|
+
return companyUserRoles.exclude([...adminRoles.options, "doc", role]).options;
|
|
424
403
|
}
|
|
425
|
-
if (role
|
|
404
|
+
if (adminRoles.safeParse(role).success || role === "doc") {
|
|
426
405
|
return companyUserRoles.exclude(["physAsst", role]).options;
|
|
427
406
|
}
|
|
428
407
|
return companyUserRoles.exclude([role]).options;
|
|
429
408
|
};
|
|
430
409
|
|
|
410
|
+
// src/schemas/profiles/User.ts
|
|
411
|
+
import { UserModel } from "@wavy/util";
|
|
412
|
+
import * as z13 from "zod";
|
|
413
|
+
var UserDetails = z13.object({
|
|
414
|
+
...UserModel.shape,
|
|
415
|
+
_id: z13.uuidv4(),
|
|
416
|
+
name: z13.string().transform((data) => {
|
|
417
|
+
const [firstName = "", lastName = ""] = data.split(" ");
|
|
418
|
+
return (firstName + " " + lastName).trim();
|
|
419
|
+
}).superRefine((data, ctx) => {
|
|
420
|
+
data.split(" ").forEach((name, idx) => {
|
|
421
|
+
const nty = idx === 0 ? "First" : "Last";
|
|
422
|
+
if (idx === 0 && name.length < 2) {
|
|
423
|
+
ctx.addIssue(`${nty} name must have at least (2) characters.`);
|
|
424
|
+
}
|
|
425
|
+
if (name.length > 25) {
|
|
426
|
+
ctx.addIssue(`${nty} name can't have more than (25) characters.`);
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
}),
|
|
430
|
+
email: UserModel.shape.email,
|
|
431
|
+
publicKey: z13.string().nullable(),
|
|
432
|
+
notifications: z13.array(Notification),
|
|
433
|
+
version: Version,
|
|
434
|
+
...TimeLog.shape
|
|
435
|
+
}).omit({ uid: true });
|
|
436
|
+
|
|
431
437
|
// src/schemas/company/components/User.ts
|
|
432
|
-
var
|
|
433
|
-
|
|
438
|
+
var CompanyUserSession = z14.object({
|
|
439
|
+
ip: z14.string(),
|
|
440
|
+
user: UserDetails.pick({ _id: true, name: true, email: true }),
|
|
441
|
+
companyId: CompanyState.shape._id,
|
|
442
|
+
isAvailable: z14.object({
|
|
443
|
+
value: z14.boolean(),
|
|
444
|
+
lastModified: Timestamp.nullable()
|
|
445
|
+
}),
|
|
446
|
+
isBusy: z14.object({
|
|
447
|
+
value: z14.boolean(),
|
|
448
|
+
lastModified: Timestamp.nullable()
|
|
449
|
+
}),
|
|
450
|
+
appointments: z14.record(z14.literal(["ongoing", "completed"]), z14.int().min(0)),
|
|
434
451
|
roles: z14.array(companyUserRoles).transform((roles) => {
|
|
435
452
|
const newRoles = [];
|
|
436
453
|
for (const role of roles) {
|
|
@@ -442,48 +459,37 @@ var MiniCompanyUser2 = z14.object({
|
|
|
442
459
|
(role, i) => i === 0 || getCompatibleRoles(roles[0]).includes(role)
|
|
443
460
|
);
|
|
444
461
|
}, "A user is not allowed to have conflicting roles."),
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}),
|
|
453
|
-
|
|
454
|
-
appointments: z14.record(z14.literal(["ongoing", "completed"]), z14.int().min(0)),
|
|
462
|
+
expiresAfter: z14.date()
|
|
463
|
+
});
|
|
464
|
+
var MiniCompanyUser2 = z14.object({
|
|
465
|
+
_id: UserDetails.shape._id,
|
|
466
|
+
...CompanyUserSession.pick({
|
|
467
|
+
appointments: true,
|
|
468
|
+
roles: true
|
|
469
|
+
}).shape,
|
|
470
|
+
/** The time before the company session gets deleted */
|
|
455
471
|
lastActive: Timestamp.nullable(),
|
|
456
|
-
inviteSent: Timestamp.
|
|
472
|
+
inviteSent: Timestamp.nullish(),
|
|
457
473
|
inviteAccepted: Timestamp.nullable()
|
|
458
|
-
}).superRefine((data, ctx) => {
|
|
459
|
-
if (!data.isAvailable && data.status !== "active") {
|
|
460
|
-
ctx.addIssue('Unavailable users MUST also have the "active" status.');
|
|
461
|
-
}
|
|
462
|
-
if (!data.isAvailable && !data.roles.some((role) => role === "doc" || role === "physAsst")) {
|
|
463
|
-
ctx.addIssue(
|
|
464
|
-
'Only users with the "doc" or "physAsst" role can be marked as unavailable.'
|
|
465
|
-
);
|
|
466
|
-
}
|
|
467
474
|
});
|
|
468
475
|
var CompanyUser = z14.object({
|
|
469
|
-
...UserModel2.shape,
|
|
470
476
|
...MiniCompanyUser2.shape,
|
|
471
|
-
|
|
472
|
-
|
|
477
|
+
...CompanyUserSession.shape.user.shape,
|
|
478
|
+
// Determined based on:
|
|
479
|
+
// [1] where the data was retrieved from (if it is from the session pool then status === "active")
|
|
480
|
+
// [2] user's roles
|
|
481
|
+
// [3] inviteSent timestamp (if it )
|
|
482
|
+
status: companyUserStatus
|
|
483
|
+
});
|
|
473
484
|
|
|
474
485
|
// src/schemas/company/components/Staff.ts
|
|
475
|
-
var refineMembers = (data, ctx) => {
|
|
476
|
-
for (const [uid, user] of Object.entries(data)) {
|
|
477
|
-
if (uid !== user._id) {
|
|
478
|
-
ctx.addIssue(
|
|
479
|
-
`User found with a uid that doesn't match their respective key. (${uid} !== ${user._id}).`
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
};
|
|
484
486
|
var MiniRawCompanyStaff = z15.object({
|
|
485
487
|
_id: CompanyState.shape._id,
|
|
486
|
-
members: z15.record(
|
|
488
|
+
members: z15.record(
|
|
489
|
+
MiniCompanyUser2.shape._id,
|
|
490
|
+
MiniCompanyUser2.omit({ _id: true })
|
|
491
|
+
),
|
|
492
|
+
// .superRefine(refineMembers),
|
|
487
493
|
/**
|
|
488
494
|
* @relationship one -> many
|
|
489
495
|
*@description A map of doctor `uids` to their assistants `uids` */
|
|
@@ -501,11 +507,12 @@ var MiniRawCompanyStaff = z15.object({
|
|
|
501
507
|
})
|
|
502
508
|
}).partial()
|
|
503
509
|
),
|
|
510
|
+
version: Version,
|
|
504
511
|
lastModified: Timestamp.nullable()
|
|
505
512
|
});
|
|
506
513
|
var RawCompanyStaff = z15.object({
|
|
507
514
|
...MiniRawCompanyStaff.shape,
|
|
508
|
-
members: z15.record(CompanyUser.shape._id, CompanyUser
|
|
515
|
+
members: z15.record(CompanyUser.shape._id, CompanyUser.omit({ _id: true }))
|
|
509
516
|
});
|
|
510
517
|
var transformStaff = (object16) => {
|
|
511
518
|
return object16.transform((d) => {
|
|
@@ -537,27 +544,22 @@ var transformStaff = (object16) => {
|
|
|
537
544
|
}
|
|
538
545
|
return copy;
|
|
539
546
|
}).superRefine((details, ctx) => {
|
|
540
|
-
for (const user of Object.
|
|
541
|
-
if (user.roles.includes("doc") &&
|
|
542
|
-
for (const asstUid of Object.keys(details.partnerMap[
|
|
547
|
+
for (const [_id, user] of Object.entries(details.members)) {
|
|
548
|
+
if (user.roles.includes("doc") && _id in details.partnerMap) {
|
|
549
|
+
for (const asstUid of Object.keys(details.partnerMap[_id])) {
|
|
543
550
|
if (!details.members[asstUid].roles.includes("physAsst")) {
|
|
544
551
|
ctx.addIssue(
|
|
545
|
-
`A partner group member must have the "physAsst" role (${
|
|
552
|
+
`A partner group member must have the "physAsst" role (${_id}) -> (${asstUid}).`
|
|
546
553
|
);
|
|
547
554
|
}
|
|
548
555
|
}
|
|
549
|
-
} else if (
|
|
556
|
+
} else if (_id in details.partnerMap) {
|
|
550
557
|
ctx.addIssue(
|
|
551
|
-
`A partner group leader must have the "doc" role. (${
|
|
558
|
+
`A partner group leader must have the "doc" role. (${_id})`
|
|
552
559
|
);
|
|
553
560
|
} else if (user.roles.includes("doc")) {
|
|
554
561
|
ctx.addIssue(
|
|
555
|
-
`All users that have the "doc" role must be the leader of a partner group. (${
|
|
556
|
-
);
|
|
557
|
-
}
|
|
558
|
-
if (!user.isBusy && user._id in details.updateQueue) {
|
|
559
|
-
ctx.addIssue(
|
|
560
|
-
`Having users that aren't busy in the update queue is prohibited.`
|
|
562
|
+
`All users that have the "doc" role must be the leader of a partner group. (${_id})`
|
|
561
563
|
);
|
|
562
564
|
}
|
|
563
565
|
}
|
|
@@ -599,54 +601,57 @@ var CompanyInviteList = z17.record(
|
|
|
599
601
|
"Insufficient amount of members invited."
|
|
600
602
|
);
|
|
601
603
|
|
|
602
|
-
// src/schemas/appointment/components/
|
|
604
|
+
// src/schemas/appointment/components/Medical.ts
|
|
603
605
|
import * as z18 from "zod";
|
|
604
|
-
|
|
605
|
-
var ClientIdentity = UserDetails.omit({
|
|
606
|
-
notifications: true,
|
|
607
|
-
publicKey: true
|
|
608
|
-
}).safeExtend(
|
|
609
|
-
z18.object({
|
|
610
|
-
dob: Timestamp.optional(),
|
|
611
|
-
address: Address2.optional()
|
|
612
|
-
}).shape
|
|
613
|
-
);
|
|
614
|
-
|
|
615
|
-
// src/schemas/appointment/components/payload/Medical.ts
|
|
616
|
-
import * as z19 from "zod";
|
|
617
|
-
var Vitals = z19.record(
|
|
606
|
+
var Vitals = z18.record(
|
|
618
607
|
vitalKeys,
|
|
619
|
-
|
|
620
|
-
value:
|
|
608
|
+
z18.object({
|
|
609
|
+
value: z18.string().trim().regex(/^\d{0,3}((\/|\.)\d{1,3})?/),
|
|
621
610
|
lastModified: Timestamp.nullable()
|
|
622
611
|
})
|
|
623
612
|
);
|
|
624
|
-
var Medicine =
|
|
625
|
-
brand:
|
|
613
|
+
var Medicine = z18.object({
|
|
614
|
+
brand: z18.string().trim(),
|
|
626
615
|
expiresAt: Timestamp.nullish(),
|
|
627
|
-
quantity:
|
|
616
|
+
quantity: z18.string().trim().regex(/^\d+(\.\d{1,3})? ?[a-zA-Z]{1,20}/, {
|
|
628
617
|
error: "Failed to match the pattern <number>+(.<number>{1,3})? ?[a-zA-Z]{1,20}"
|
|
629
618
|
}),
|
|
630
|
-
refills:
|
|
631
|
-
directions:
|
|
619
|
+
refills: z18.string().trim().regex(/^[0-8]/, { error: "Must be between 0 and 8" }),
|
|
620
|
+
directions: z18.string().trim().max(100, { error: "Must be 100 characters or less" }),
|
|
632
621
|
...TimeLog.shape
|
|
633
622
|
});
|
|
634
|
-
var MedicalDetails =
|
|
623
|
+
var MedicalDetails = z18.object({
|
|
635
624
|
vitals: Vitals,
|
|
636
|
-
prescriptions:
|
|
637
|
-
doctorNote:
|
|
638
|
-
value:
|
|
625
|
+
prescriptions: z18.array(z18.array(Medicine)).nullish(),
|
|
626
|
+
doctorNote: z18.object({
|
|
627
|
+
value: z18.string(),
|
|
639
628
|
lastModified: Timestamp.nullable()
|
|
640
629
|
}),
|
|
641
|
-
physAsstNotes:
|
|
642
|
-
|
|
643
|
-
title:
|
|
644
|
-
content:
|
|
630
|
+
physAsstNotes: z18.array(
|
|
631
|
+
z18.object({
|
|
632
|
+
title: z18.string(),
|
|
633
|
+
content: z18.string(),
|
|
645
634
|
...TimeLog.shape
|
|
646
635
|
})
|
|
647
636
|
).optional()
|
|
648
637
|
});
|
|
649
638
|
|
|
639
|
+
// src/schemas/profiles/Client.ts
|
|
640
|
+
import * as z19 from "zod";
|
|
641
|
+
import { Address as Address2 } from "@wavy/util";
|
|
642
|
+
var ClientIdentity = UserDetails.omit({
|
|
643
|
+
notifications: true,
|
|
644
|
+
publicKey: true,
|
|
645
|
+
email: true
|
|
646
|
+
}).safeExtend(
|
|
647
|
+
z19.object({
|
|
648
|
+
email: UserDetails.shape.email.optional(),
|
|
649
|
+
dob: Timestamp.optional(),
|
|
650
|
+
address: Address2.optional(),
|
|
651
|
+
linkedTo: UserDetails.shape._id.optional()
|
|
652
|
+
}).shape
|
|
653
|
+
);
|
|
654
|
+
|
|
650
655
|
// src/schemas/appointment/Appointment.ts
|
|
651
656
|
import * as z20 from "zod";
|
|
652
657
|
var TimelineActivity = z20.object({
|
|
@@ -744,7 +749,7 @@ function findAvailableStaff(role, staff) {
|
|
|
744
749
|
return Object.keys(role === "doc" ? staff.partnerMap : staff.members).filter(
|
|
745
750
|
(uid) => {
|
|
746
751
|
const user = staff.members[uid];
|
|
747
|
-
return !(uid in staff.updateQueue) && user.roles.includes(role) && user.status === "active"
|
|
752
|
+
return !(uid in staff.updateQueue) && user.roles.includes(role) && user.status === "active";
|
|
748
753
|
}
|
|
749
754
|
);
|
|
750
755
|
}
|
|
@@ -777,6 +782,7 @@ function findNextAvailableStaff(userUids, algorithm, staff) {
|
|
|
777
782
|
}
|
|
778
783
|
|
|
779
784
|
// src/functions/scheduleAppointment.ts
|
|
785
|
+
import { adminRoles as adminRoles2 } from "src/main";
|
|
780
786
|
async function scheduleAppointment(request) {
|
|
781
787
|
request.form = ScheduleAppointmentForm.parse(request.form);
|
|
782
788
|
request.sender = UserDetails.parse(request.sender);
|
|
@@ -852,7 +858,7 @@ async function scheduleAppointment(request) {
|
|
|
852
858
|
if (totalPaid < totalOwed) throw new Error("Insufficient payments made.");
|
|
853
859
|
}
|
|
854
860
|
if (stateCopy.credits.current < request.cost) {
|
|
855
|
-
if (companyUser.roles.
|
|
861
|
+
if (companyUser.roles.some((role) => adminRoles2.safeParse(role).success)) {
|
|
856
862
|
throw new Error("Account balance has insufficient funds.");
|
|
857
863
|
} else {
|
|
858
864
|
throw new Error(
|
|
@@ -934,6 +940,7 @@ export {
|
|
|
934
940
|
CompanyStaff,
|
|
935
941
|
CompanyState,
|
|
936
942
|
CompanyUser,
|
|
943
|
+
CompanyUserSession,
|
|
937
944
|
CreditCurrency,
|
|
938
945
|
InviteResponse,
|
|
939
946
|
InvoiceNo,
|
|
@@ -958,12 +965,15 @@ export {
|
|
|
958
965
|
TimeLog,
|
|
959
966
|
Timestamp,
|
|
960
967
|
UserDetails,
|
|
968
|
+
Version,
|
|
961
969
|
Vitals,
|
|
970
|
+
adminRoles,
|
|
962
971
|
appointmentDistAlgs,
|
|
963
972
|
companyPartnerRoles,
|
|
964
973
|
companyServiceSelectors,
|
|
965
974
|
companyTypes,
|
|
966
975
|
companyUserRoles,
|
|
976
|
+
companyUserStatus,
|
|
967
977
|
createNotifId,
|
|
968
978
|
employeeRoles,
|
|
969
979
|
findAvailableStaff,
|