@bizmap/sdk 0.0.63 → 0.0.65
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 +59 -76
- package/dist/main.js +59 -44
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ declare const companyServiceSelectors: z.ZodEnum<{
|
|
|
38
38
|
type CompanyServiceSelector = z.infer<typeof companyServiceSelectors>;
|
|
39
39
|
|
|
40
40
|
declare const tiers: z.ZodEnum<{
|
|
41
|
-
|
|
41
|
+
basic: "basic";
|
|
42
42
|
pro: "pro";
|
|
43
43
|
premium: "premium";
|
|
44
44
|
gold: "gold";
|
|
@@ -67,7 +67,7 @@ declare const serviceProviders: z.ZodEnum<{
|
|
|
67
67
|
}>;
|
|
68
68
|
|
|
69
69
|
declare const CompanyDetails: z.ZodObject<{
|
|
70
|
-
|
|
70
|
+
_id: z.ZodUUID;
|
|
71
71
|
identity: z.ZodObject<{
|
|
72
72
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
73
73
|
address: z.ZodObject<{
|
|
@@ -84,7 +84,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
84
84
|
}, z.core.$strip>;
|
|
85
85
|
tier: z.ZodObject<{
|
|
86
86
|
current: z.ZodEnum<{
|
|
87
|
-
|
|
87
|
+
basic: "basic";
|
|
88
88
|
pro: "pro";
|
|
89
89
|
premium: "premium";
|
|
90
90
|
gold: "gold";
|
|
@@ -224,7 +224,11 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
224
224
|
staff: z.ZodObject<{
|
|
225
225
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
226
226
|
members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
227
|
-
|
|
227
|
+
_id: z.ZodUUID;
|
|
228
|
+
email: z.ZodEmail;
|
|
229
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
230
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
231
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
232
|
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
229
233
|
doc: "doc";
|
|
230
234
|
physAsst: "physAsst";
|
|
@@ -243,13 +247,6 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
243
247
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
244
248
|
isAvailableLastModified: z.ZodNullable<z.ZodInt>;
|
|
245
249
|
isBusyLastModified: z.ZodNullable<z.ZodInt>;
|
|
246
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
247
|
-
first: "first";
|
|
248
|
-
last: "last";
|
|
249
|
-
}>, z.ZodString>;
|
|
250
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
|
-
email: z.ZodEmail;
|
|
252
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
253
250
|
}, z.core.$strip>>;
|
|
254
251
|
partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
255
252
|
addedAt: z.ZodInt;
|
|
@@ -277,7 +274,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
277
274
|
}, z.core.$strip>;
|
|
278
275
|
type CompanyDetails = z.infer<typeof CompanyDetails>;
|
|
279
276
|
declare const MutableCompanyDetails: z.ZodObject<{
|
|
280
|
-
|
|
277
|
+
_id: z.ZodUUID;
|
|
281
278
|
identity: z.ZodOptional<z.ZodObject<{
|
|
282
279
|
address: z.ZodOptional<z.ZodObject<{
|
|
283
280
|
streetAddress: z.ZodString;
|
|
@@ -297,6 +294,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
297
294
|
}, z.core.$strip>>;
|
|
298
295
|
}, z.core.$strip>>;
|
|
299
296
|
preferences: z.ZodOptional<z.ZodObject<{
|
|
297
|
+
_id: z.ZodOptional<z.ZodUUID>;
|
|
300
298
|
serviceSelector: z.ZodOptional<z.ZodEnum<{
|
|
301
299
|
scheduler: "scheduler";
|
|
302
300
|
doctor: "doctor";
|
|
@@ -308,6 +306,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
308
306
|
}>>>;
|
|
309
307
|
}, z.core.$strip>>;
|
|
310
308
|
billing: z.ZodOptional<z.ZodObject<{
|
|
309
|
+
_id: z.ZodOptional<z.ZodUUID>;
|
|
311
310
|
additionalFees: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
312
311
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
313
312
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -400,7 +399,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
400
399
|
type MutableCompanyDetails = z.infer<typeof MutableCompanyDetails>;
|
|
401
400
|
|
|
402
401
|
declare const CompanyBilling: z.ZodObject<{
|
|
403
|
-
|
|
402
|
+
_id: z.ZodUUID;
|
|
404
403
|
additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
405
404
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
406
405
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -472,6 +471,7 @@ declare const CompanyBilling: z.ZodObject<{
|
|
|
472
471
|
}, z.core.$strip>;
|
|
473
472
|
type CompanyBilling = z.infer<typeof CompanyBilling>;
|
|
474
473
|
declare const MutableCompanyBilling: z.ZodObject<{
|
|
474
|
+
_id: z.ZodUUID;
|
|
475
475
|
additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
476
476
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
477
477
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -543,7 +543,7 @@ declare const MutableCompanyBilling: z.ZodObject<{
|
|
|
543
543
|
type MutableCompanyBilling = z.infer<typeof MutableCompanyBilling>;
|
|
544
544
|
|
|
545
545
|
declare const CompanyIdentity: z.ZodObject<{
|
|
546
|
-
|
|
546
|
+
_id: z.ZodUUID;
|
|
547
547
|
displayName: z.ZodString;
|
|
548
548
|
logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
549
549
|
contact: z.ZodObject<{
|
|
@@ -558,7 +558,7 @@ declare const CompanyIdentity: z.ZodObject<{
|
|
|
558
558
|
}, z.core.$strip>;
|
|
559
559
|
tier: z.ZodObject<{
|
|
560
560
|
current: z.ZodEnum<{
|
|
561
|
-
|
|
561
|
+
basic: "basic";
|
|
562
562
|
pro: "pro";
|
|
563
563
|
premium: "premium";
|
|
564
564
|
gold: "gold";
|
|
@@ -607,7 +607,7 @@ declare const CompanyNotifications: z.ZodArray<z.ZodObject<{
|
|
|
607
607
|
type CompanyNotifications = z.infer<typeof CompanyNotifications>;
|
|
608
608
|
|
|
609
609
|
declare const CompanyPreferences: z.ZodObject<{
|
|
610
|
-
|
|
610
|
+
_id: z.ZodUUID;
|
|
611
611
|
serviceSelector: z.ZodEnum<{
|
|
612
612
|
scheduler: "scheduler";
|
|
613
613
|
doctor: "doctor";
|
|
@@ -621,6 +621,7 @@ declare const CompanyPreferences: z.ZodObject<{
|
|
|
621
621
|
}, z.core.$strip>;
|
|
622
622
|
type CompanyPreferences = z.infer<typeof CompanyPreferences>;
|
|
623
623
|
declare const MutableCompanyPreferences: z.ZodObject<{
|
|
624
|
+
_id: z.ZodUUID;
|
|
624
625
|
serviceSelector: z.ZodEnum<{
|
|
625
626
|
scheduler: "scheduler";
|
|
626
627
|
doctor: "doctor";
|
|
@@ -635,7 +636,11 @@ type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
|
|
|
635
636
|
|
|
636
637
|
declare const CompanyStaff: z.ZodObject<{
|
|
637
638
|
members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
638
|
-
|
|
639
|
+
_id: z.ZodUUID;
|
|
640
|
+
email: z.ZodEmail;
|
|
641
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
642
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
643
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
639
644
|
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
640
645
|
doc: "doc";
|
|
641
646
|
physAsst: "physAsst";
|
|
@@ -654,15 +659,8 @@ declare const CompanyStaff: z.ZodObject<{
|
|
|
654
659
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
655
660
|
isAvailableLastModified: z.ZodNullable<z.ZodInt>;
|
|
656
661
|
isBusyLastModified: z.ZodNullable<z.ZodInt>;
|
|
657
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
658
|
-
first: "first";
|
|
659
|
-
last: "last";
|
|
660
|
-
}>, z.ZodString>;
|
|
661
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
662
|
-
email: z.ZodEmail;
|
|
663
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
664
662
|
}, z.core.$strip>>;
|
|
665
|
-
|
|
663
|
+
_id: z.ZodUUID;
|
|
666
664
|
partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
667
665
|
addedAt: z.ZodInt;
|
|
668
666
|
}, z.core.$strip>>>;
|
|
@@ -691,7 +689,7 @@ type CompanyStaff = z.infer<typeof CompanyStaff>;
|
|
|
691
689
|
|
|
692
690
|
/** Can only be modifiede by the server */
|
|
693
691
|
declare const CompanyState: z.ZodObject<{
|
|
694
|
-
|
|
692
|
+
_id: z.ZodUUID;
|
|
695
693
|
credits: z.ZodObject<{
|
|
696
694
|
current: z.ZodNumber;
|
|
697
695
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
@@ -713,7 +711,7 @@ declare const CompanyState: z.ZodObject<{
|
|
|
713
711
|
type CompanyState = z.infer<typeof CompanyState>;
|
|
714
712
|
|
|
715
713
|
declare const MiniCompanyUser: z.ZodObject<{
|
|
716
|
-
|
|
714
|
+
_id: z.ZodUUID;
|
|
717
715
|
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
718
716
|
doc: "doc";
|
|
719
717
|
physAsst: "physAsst";
|
|
@@ -735,7 +733,11 @@ declare const MiniCompanyUser: z.ZodObject<{
|
|
|
735
733
|
}, z.core.$strip>;
|
|
736
734
|
type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
|
|
737
735
|
declare const CompanyUser: z.ZodObject<{
|
|
738
|
-
|
|
736
|
+
_id: z.ZodUUID;
|
|
737
|
+
email: z.ZodEmail;
|
|
738
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
739
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
740
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
739
741
|
roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
740
742
|
doc: "doc";
|
|
741
743
|
physAsst: "physAsst";
|
|
@@ -754,13 +756,6 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
754
756
|
lastActive: z.ZodNullable<z.ZodInt>;
|
|
755
757
|
isAvailableLastModified: z.ZodNullable<z.ZodInt>;
|
|
756
758
|
isBusyLastModified: z.ZodNullable<z.ZodInt>;
|
|
757
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
758
|
-
first: "first";
|
|
759
|
-
last: "last";
|
|
760
|
-
}>, z.ZodString>;
|
|
761
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
762
|
-
email: z.ZodEmail;
|
|
763
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
764
759
|
}, z.core.$strip>;
|
|
765
760
|
type CompanyUser = z.infer<typeof CompanyUser>;
|
|
766
761
|
|
|
@@ -825,13 +820,10 @@ declare const Receipts: z.ZodArray<z.ZodObject<{
|
|
|
825
820
|
declare const ClientIdentity: z.ZodObject<{
|
|
826
821
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
827
822
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
828
|
-
|
|
823
|
+
_id: z.ZodUUID;
|
|
829
824
|
email: z.ZodEmail;
|
|
830
825
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
831
|
-
name: z.
|
|
832
|
-
first: "first";
|
|
833
|
-
last: "last";
|
|
834
|
-
}>, z.ZodString>;
|
|
826
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
835
827
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
836
828
|
linked: z.ZodBoolean;
|
|
837
829
|
dob: z.ZodOptional<z.ZodInt>;
|
|
@@ -845,7 +837,7 @@ declare const ClientIdentity: z.ZodObject<{
|
|
|
845
837
|
type ClientIdentity = z.infer<typeof ClientIdentity>;
|
|
846
838
|
|
|
847
839
|
declare const TierList: z.ZodRecord<z.ZodEnum<{
|
|
848
|
-
|
|
840
|
+
basic: "basic";
|
|
849
841
|
pro: "pro";
|
|
850
842
|
premium: "premium";
|
|
851
843
|
gold: "gold";
|
|
@@ -941,8 +933,11 @@ type MedicalDetails = z.infer<typeof MedicalDetails>;
|
|
|
941
933
|
declare const UserDetails: z.ZodObject<{
|
|
942
934
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
943
935
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
944
|
-
|
|
936
|
+
_id: z.ZodUUID;
|
|
945
937
|
email: z.ZodEmail;
|
|
938
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
939
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
940
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
946
941
|
publicKey: z.ZodNullable<z.ZodString>;
|
|
947
942
|
notifications: z.ZodArray<z.ZodObject<{
|
|
948
943
|
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE" | "ALERT">;
|
|
@@ -956,12 +951,6 @@ declare const UserDetails: z.ZodObject<{
|
|
|
956
951
|
createdAt: z.ZodInt;
|
|
957
952
|
}, z.core.$strip>>;
|
|
958
953
|
linked: z.ZodBoolean;
|
|
959
|
-
name: z.ZodRecord<z.ZodEnum<{
|
|
960
|
-
first: "first";
|
|
961
|
-
last: "last";
|
|
962
|
-
}>, z.ZodString>;
|
|
963
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
964
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
965
954
|
}, z.core.$strip>;
|
|
966
955
|
type UserDetails = z.infer<typeof UserDetails>;
|
|
967
956
|
|
|
@@ -1137,6 +1126,7 @@ type MiniAppointmentDetails = z.infer<typeof MiniAppointmentDetails>;
|
|
|
1137
1126
|
declare const AppointmentDetails: z.ZodObject<{
|
|
1138
1127
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1139
1128
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1129
|
+
_id: z.ZodUUID;
|
|
1140
1130
|
additionalFees: z.ZodReadonly<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1141
1131
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1142
1132
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1240,7 +1230,6 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1240
1230
|
}, z.core.$strip>>;
|
|
1241
1231
|
}, z.core.$strip>;
|
|
1242
1232
|
tkt: z.ZodReadonly<z.ZodInt>;
|
|
1243
|
-
_id: z.ZodUUID;
|
|
1244
1233
|
reason: z.ZodOptional<z.ZodObject<{
|
|
1245
1234
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1246
1235
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1284,13 +1273,10 @@ declare const AppointmentDetails: z.ZodObject<{
|
|
|
1284
1273
|
client: z.ZodObject<{
|
|
1285
1274
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1286
1275
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1287
|
-
|
|
1276
|
+
_id: z.ZodUUID;
|
|
1288
1277
|
email: z.ZodEmail;
|
|
1289
1278
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1290
|
-
name: z.
|
|
1291
|
-
first: "first";
|
|
1292
|
-
last: "last";
|
|
1293
|
-
}>, z.ZodString>;
|
|
1279
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1294
1280
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1295
1281
|
linked: z.ZodBoolean;
|
|
1296
1282
|
dob: z.ZodOptional<z.ZodInt>;
|
|
@@ -1306,6 +1292,7 @@ type AppointmentDetails = z.infer<typeof AppointmentDetails>;
|
|
|
1306
1292
|
declare const MutableAppointmentDetails: z.ZodObject<{
|
|
1307
1293
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1308
1294
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1295
|
+
_id: z.ZodUUID;
|
|
1309
1296
|
additionalFees: z.ZodReadonly<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
1310
1297
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1311
1298
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1409,7 +1396,6 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1409
1396
|
}, z.core.$strip>>;
|
|
1410
1397
|
}, z.core.$strip>;
|
|
1411
1398
|
tkt: z.ZodReadonly<z.ZodInt>;
|
|
1412
|
-
_id: z.ZodUUID;
|
|
1413
1399
|
reason: z.ZodOptional<z.ZodObject<{
|
|
1414
1400
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1415
1401
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -1453,13 +1439,10 @@ declare const MutableAppointmentDetails: z.ZodObject<{
|
|
|
1453
1439
|
client: z.ZodObject<{
|
|
1454
1440
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
1455
1441
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
1456
|
-
|
|
1442
|
+
_id: z.ZodUUID;
|
|
1457
1443
|
email: z.ZodEmail;
|
|
1458
1444
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
1459
|
-
name: z.
|
|
1460
|
-
first: "first";
|
|
1461
|
-
last: "last";
|
|
1462
|
-
}>, z.ZodString>;
|
|
1445
|
+
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
1463
1446
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1464
1447
|
linked: z.ZodBoolean;
|
|
1465
1448
|
dob: z.ZodOptional<z.ZodInt>;
|
|
@@ -1524,8 +1507,8 @@ type ScheduleAppointmentForm = z.infer<typeof ScheduleAppointmentForm>;
|
|
|
1524
1507
|
type RequestParameter = {
|
|
1525
1508
|
form: ScheduleAppointmentForm;
|
|
1526
1509
|
sender: UserDetails;
|
|
1527
|
-
billing: SafeOmit<CompanyBilling, "
|
|
1528
|
-
preferences: SafeOmit<CompanyPreferences, "
|
|
1510
|
+
billing: SafeOmit<CompanyBilling, "_id" | "prepayments" | "lastModified">;
|
|
1511
|
+
preferences: SafeOmit<CompanyPreferences, "_id" | "lastModified">;
|
|
1529
1512
|
state: CompanyState;
|
|
1530
1513
|
staff: CompanyStaff;
|
|
1531
1514
|
cost: number;
|
|
@@ -1542,7 +1525,7 @@ type RequestParameter = {
|
|
|
1542
1525
|
declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
1543
1526
|
updates: {
|
|
1544
1527
|
state: {
|
|
1545
|
-
|
|
1528
|
+
_id: string;
|
|
1546
1529
|
credits: {
|
|
1547
1530
|
current: number;
|
|
1548
1531
|
lastModified: number | null;
|
|
@@ -1563,7 +1546,9 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1563
1546
|
};
|
|
1564
1547
|
staffDetails: {
|
|
1565
1548
|
members: Record<string, {
|
|
1566
|
-
|
|
1549
|
+
_id: string;
|
|
1550
|
+
email: string;
|
|
1551
|
+
name: string;
|
|
1567
1552
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1568
1553
|
isAvailable: boolean;
|
|
1569
1554
|
isBusy: boolean;
|
|
@@ -1572,12 +1557,10 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1572
1557
|
lastActive: number | null;
|
|
1573
1558
|
isAvailableLastModified: number | null;
|
|
1574
1559
|
isBusyLastModified: number | null;
|
|
1575
|
-
name: Record<"first" | "last", string>;
|
|
1576
|
-
email: string;
|
|
1577
|
-
photoUrl?: string | null | undefined;
|
|
1578
1560
|
phoneNumber?: string | undefined;
|
|
1561
|
+
photoUrl?: string | null | undefined;
|
|
1579
1562
|
}>;
|
|
1580
|
-
|
|
1563
|
+
_id: string;
|
|
1581
1564
|
partnerMap: Record<string, Record<string, {
|
|
1582
1565
|
addedAt: number;
|
|
1583
1566
|
}>>;
|
|
@@ -1599,6 +1582,7 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1599
1582
|
};
|
|
1600
1583
|
appointment: {
|
|
1601
1584
|
createdAt: number;
|
|
1585
|
+
_id: string;
|
|
1602
1586
|
additionalFees: readonly {
|
|
1603
1587
|
createdAt: number;
|
|
1604
1588
|
fixedAmount: {
|
|
@@ -1652,7 +1636,6 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1652
1636
|
} | null;
|
|
1653
1637
|
};
|
|
1654
1638
|
tkt: number;
|
|
1655
|
-
_id: string;
|
|
1656
1639
|
charges: {
|
|
1657
1640
|
createdAt: number;
|
|
1658
1641
|
currency: "JMD" | "USD" | "EUR" | "GBP" | "CAD";
|
|
@@ -1662,9 +1645,9 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1662
1645
|
}[];
|
|
1663
1646
|
client: {
|
|
1664
1647
|
createdAt: number;
|
|
1665
|
-
|
|
1648
|
+
_id: string;
|
|
1666
1649
|
email: string;
|
|
1667
|
-
name:
|
|
1650
|
+
name: string;
|
|
1668
1651
|
linked: boolean;
|
|
1669
1652
|
lastModified?: number | null | undefined;
|
|
1670
1653
|
phoneNumber?: string | undefined;
|
|
@@ -1748,7 +1731,9 @@ declare function findNextAvailableStaff(userUids: string[], algorithm: CompanyPr
|
|
|
1748
1731
|
* @returns {(CompanyUser|MiniCompanyUser)[]|null} an array of the users that have conflicting roles or roles that are
|
|
1749
1732
|
* incompatible with the other partners, or null if none was found. */
|
|
1750
1733
|
declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyUser)[]) => ({
|
|
1751
|
-
|
|
1734
|
+
_id: string;
|
|
1735
|
+
email: string;
|
|
1736
|
+
name: string;
|
|
1752
1737
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1753
1738
|
isAvailable: boolean;
|
|
1754
1739
|
isBusy: boolean;
|
|
@@ -1757,12 +1742,10 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
|
|
|
1757
1742
|
lastActive: number | null;
|
|
1758
1743
|
isAvailableLastModified: number | null;
|
|
1759
1744
|
isBusyLastModified: number | null;
|
|
1760
|
-
name: Record<"first" | "last", string>;
|
|
1761
|
-
email: string;
|
|
1762
|
-
photoUrl?: string | null | undefined;
|
|
1763
1745
|
phoneNumber?: string | undefined;
|
|
1746
|
+
photoUrl?: string | null | undefined;
|
|
1764
1747
|
} | {
|
|
1765
|
-
|
|
1748
|
+
_id: string;
|
|
1766
1749
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
1767
1750
|
isAvailable: boolean;
|
|
1768
1751
|
isBusy: boolean;
|
package/dist/main.js
CHANGED
|
@@ -21,7 +21,7 @@ var companyServiceSelectors = z.enum(["scheduler", "doctor"]);
|
|
|
21
21
|
|
|
22
22
|
// src/enums/Global.ts
|
|
23
23
|
import * as z2 from "zod";
|
|
24
|
-
var tiers = z2.enum(["
|
|
24
|
+
var tiers = z2.enum(["basic", "pro", "premium", "gold"]);
|
|
25
25
|
var paymentMethods = z2.enum(["cash", "card", "insurance"]);
|
|
26
26
|
|
|
27
27
|
// src/enums/Medical.ts
|
|
@@ -107,7 +107,7 @@ import * as z8 from "zod";
|
|
|
107
107
|
// src/schemas/company/components/State.ts
|
|
108
108
|
import * as z7 from "zod";
|
|
109
109
|
var CompanyState = z7.object({
|
|
110
|
-
|
|
110
|
+
_id: z7.uuidv4(),
|
|
111
111
|
credits: z7.object({
|
|
112
112
|
current: z7.number(),
|
|
113
113
|
lastModified: Timestamp.nullable()
|
|
@@ -143,7 +143,7 @@ var createAdjustments = (resource) => z8.record(z8.uuidv4(), PriceAdjustment).re
|
|
|
143
143
|
`Adding more than 100 ${resource}s is prohibited.`
|
|
144
144
|
);
|
|
145
145
|
var CompanyBilling = z8.object({
|
|
146
|
-
|
|
146
|
+
_id: CompanyState.shape._id,
|
|
147
147
|
additionalFees: createAdjustments("additional fee"),
|
|
148
148
|
discounts: createAdjustments("discount"),
|
|
149
149
|
/** Optionally deductable from bills */
|
|
@@ -178,9 +178,9 @@ var MutableCompanyBilling = CompanyBilling.omit({
|
|
|
178
178
|
import * as z9 from "zod";
|
|
179
179
|
import { Address, PhoneNumber } from "@wavy/util";
|
|
180
180
|
var CompanyIdentity = z9.object({
|
|
181
|
-
|
|
181
|
+
_id: CompanyState.shape._id,
|
|
182
182
|
displayName: z9.string().min(3).max(25),
|
|
183
|
-
logo: z9.string().max(
|
|
183
|
+
logo: z9.string().max(150).nullish(),
|
|
184
184
|
/** Hash this field */
|
|
185
185
|
// password: z.string(),
|
|
186
186
|
contact: z9.object({
|
|
@@ -221,8 +221,8 @@ var TierList = z10.record(
|
|
|
221
221
|
perks: z10.array(z10.string()).min(1)
|
|
222
222
|
})
|
|
223
223
|
).superRefine((data, ctx) => {
|
|
224
|
-
if (data.
|
|
225
|
-
ctx.addIssue("The
|
|
224
|
+
if (data.basic.cost !== 0) {
|
|
225
|
+
ctx.addIssue("The basic tier must always cost $0.00");
|
|
226
226
|
}
|
|
227
227
|
});
|
|
228
228
|
var Notification = z10.object({
|
|
@@ -285,7 +285,7 @@ var CompanyNotifications = z11.array(Notification).refine(
|
|
|
285
285
|
// src/schemas/company/components/Preferences.ts
|
|
286
286
|
import * as z12 from "zod";
|
|
287
287
|
var CompanyPreferences = z12.object({
|
|
288
|
-
|
|
288
|
+
_id: CompanyState.shape._id,
|
|
289
289
|
/** The user that's allowed to record the client's services. */
|
|
290
290
|
serviceSelector: companyServiceSelectors,
|
|
291
291
|
/** A record of the payments made must be attached before creating the
|
|
@@ -321,14 +321,28 @@ import { UserModel } from "@wavy/util";
|
|
|
321
321
|
import * as z13 from "zod";
|
|
322
322
|
var UserDetails = z13.object({
|
|
323
323
|
...UserModel.shape,
|
|
324
|
-
|
|
324
|
+
_id: z13.uuidv4(),
|
|
325
|
+
name: z13.string().transform((data) => {
|
|
326
|
+
const [firstName = "", lastName = ""] = data.split(" ");
|
|
327
|
+
return (firstName + " " + lastName).trim();
|
|
328
|
+
}).superRefine((data, ctx) => {
|
|
329
|
+
data.split(" ").forEach((name, idx) => {
|
|
330
|
+
const nty = idx === 0 ? "First" : "Last";
|
|
331
|
+
if (idx === 0 && name.length < 2) {
|
|
332
|
+
ctx.addIssue(`${nty} name must have at least (2) characters.`);
|
|
333
|
+
}
|
|
334
|
+
if (name.length > 25) {
|
|
335
|
+
ctx.addIssue(`${nty} name can't have more than (25) characters.`);
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
}),
|
|
325
339
|
email: UserModel.shape.email,
|
|
326
340
|
publicKey: z13.string().nullable(),
|
|
327
341
|
notifications: z13.array(Notification),
|
|
328
342
|
/** Only true when linked to a client */
|
|
329
343
|
linked: z13.boolean(),
|
|
330
344
|
...TimeLog.shape
|
|
331
|
-
});
|
|
345
|
+
}).omit({ uid: true });
|
|
332
346
|
|
|
333
347
|
// src/functions/helper-functions.ts
|
|
334
348
|
var findConflictingPartners = (...partners) => {
|
|
@@ -363,7 +377,7 @@ var getCompatibleRoles = (role) => {
|
|
|
363
377
|
|
|
364
378
|
// src/schemas/company/components/User.ts
|
|
365
379
|
var MiniCompanyUser2 = z14.object({
|
|
366
|
-
|
|
380
|
+
_id: UserDetails.shape._id,
|
|
367
381
|
roles: z14.array(companyUserRoles).transform((roles) => {
|
|
368
382
|
const newRoles = [];
|
|
369
383
|
for (const role of roles) {
|
|
@@ -394,31 +408,32 @@ var MiniCompanyUser2 = z14.object({
|
|
|
394
408
|
});
|
|
395
409
|
var CompanyUser = z14.object({
|
|
396
410
|
...UserModel2.shape,
|
|
397
|
-
...MiniCompanyUser2.shape
|
|
398
|
-
|
|
411
|
+
...MiniCompanyUser2.shape,
|
|
412
|
+
name: UserDetails.shape.name
|
|
413
|
+
}).omit({ uid: true });
|
|
399
414
|
|
|
400
415
|
// src/schemas/company/components/Staff.ts
|
|
401
416
|
var refineMembers = (data, ctx) => {
|
|
402
417
|
for (const [uid, user] of Object.entries(data)) {
|
|
403
|
-
if (uid !== user.
|
|
418
|
+
if (uid !== user._id) {
|
|
404
419
|
ctx.addIssue(
|
|
405
|
-
`User found with a uid that doesn't match their respective key. (${uid} !== ${user.
|
|
420
|
+
`User found with a uid that doesn't match their respective key. (${uid} !== ${user._id}).`
|
|
406
421
|
);
|
|
407
422
|
}
|
|
408
423
|
}
|
|
409
424
|
};
|
|
410
425
|
var MiniRawCompanyStaff = z15.object({
|
|
411
|
-
|
|
412
|
-
members: z15.record(MiniCompanyUser2.shape.
|
|
426
|
+
_id: CompanyState.shape._id,
|
|
427
|
+
members: z15.record(MiniCompanyUser2.shape._id, MiniCompanyUser2).superRefine(refineMembers),
|
|
413
428
|
/**
|
|
414
429
|
* @relationship one -> many
|
|
415
430
|
*@description A map of doctor `uids` to their assistants `uids` */
|
|
416
431
|
partnerMap: z15.record(
|
|
417
|
-
CompanyUser.shape.
|
|
418
|
-
z15.record(CompanyUser.shape.
|
|
432
|
+
CompanyUser.shape._id,
|
|
433
|
+
z15.record(CompanyUser.shape._id, z15.object({ addedAt: Timestamp }))
|
|
419
434
|
),
|
|
420
435
|
updateQueue: z15.record(
|
|
421
|
-
CompanyUser.shape.
|
|
436
|
+
CompanyUser.shape._id,
|
|
422
437
|
z15.object({
|
|
423
438
|
$REMOVE: z15.object({ addedAt: Timestamp }),
|
|
424
439
|
$CHANGE_ROLES: z15.object({
|
|
@@ -428,7 +443,7 @@ var MiniRawCompanyStaff = z15.object({
|
|
|
428
443
|
}).partial()
|
|
429
444
|
),
|
|
430
445
|
timeline: z15.record(
|
|
431
|
-
CompanyUser.shape.
|
|
446
|
+
CompanyUser.shape._id,
|
|
432
447
|
z15.object({
|
|
433
448
|
inviteSent: Timestamp.nullable(),
|
|
434
449
|
inviteAccepted: Timestamp.nullable()
|
|
@@ -438,7 +453,7 @@ var MiniRawCompanyStaff = z15.object({
|
|
|
438
453
|
});
|
|
439
454
|
var RawCompanyStaff = z15.object({
|
|
440
455
|
...MiniRawCompanyStaff.shape,
|
|
441
|
-
members: z15.record(CompanyUser.shape.
|
|
456
|
+
members: z15.record(CompanyUser.shape._id, CompanyUser).superRefine(refineMembers)
|
|
442
457
|
});
|
|
443
458
|
var transformStaff = (object16) => {
|
|
444
459
|
return object16.transform((d) => {
|
|
@@ -471,24 +486,24 @@ var transformStaff = (object16) => {
|
|
|
471
486
|
return copy;
|
|
472
487
|
}).superRefine((details, ctx) => {
|
|
473
488
|
for (const user of Object.values(details.members)) {
|
|
474
|
-
if (user.roles.includes("doc") && user.
|
|
475
|
-
for (const asstUid of Object.keys(details.partnerMap[user.
|
|
489
|
+
if (user.roles.includes("doc") && user._id in details.partnerMap) {
|
|
490
|
+
for (const asstUid of Object.keys(details.partnerMap[user._id])) {
|
|
476
491
|
if (!details.members[asstUid].roles.includes("physAsst")) {
|
|
477
492
|
ctx.addIssue(
|
|
478
|
-
`A partner group member must have the "physAsst" role (${user.
|
|
493
|
+
`A partner group member must have the "physAsst" role (${user._id}) -> (${asstUid}).`
|
|
479
494
|
);
|
|
480
495
|
}
|
|
481
496
|
}
|
|
482
|
-
} else if (user.
|
|
497
|
+
} else if (user._id in details.partnerMap) {
|
|
483
498
|
ctx.addIssue(
|
|
484
|
-
`A partner group leader must have the "doc" role. (${user.
|
|
499
|
+
`A partner group leader must have the "doc" role. (${user._id})`
|
|
485
500
|
);
|
|
486
501
|
} else if (user.roles.includes("doc")) {
|
|
487
502
|
ctx.addIssue(
|
|
488
|
-
`All users that have the "doc" role must be the leader of a partner group. (${user.
|
|
503
|
+
`All users that have the "doc" role must be the leader of a partner group. (${user._id})`
|
|
489
504
|
);
|
|
490
505
|
}
|
|
491
|
-
if (!user.isBusy && user.
|
|
506
|
+
if (!user.isBusy && user._id in details.updateQueue) {
|
|
492
507
|
ctx.addIssue(
|
|
493
508
|
`Having users that aren't busy in the update queue is prohibited.`
|
|
494
509
|
);
|
|
@@ -505,17 +520,17 @@ var MutableCompanyStaff = RawCompanyStaff.pick({
|
|
|
505
520
|
|
|
506
521
|
// src/schemas/company/CompanyDetails.ts
|
|
507
522
|
var CompanyDetails = z16.object({
|
|
508
|
-
|
|
509
|
-
identity: CompanyIdentity.omit({
|
|
523
|
+
_id: CompanyState.shape._id,
|
|
524
|
+
identity: CompanyIdentity.omit({ _id: true }),
|
|
510
525
|
notifications: CompanyNotifications,
|
|
511
526
|
receipts: Receipts,
|
|
512
|
-
state: CompanyState.omit({
|
|
513
|
-
preferences: CompanyPreferences.omit({
|
|
514
|
-
billing: CompanyBilling.omit({
|
|
515
|
-
staff: RawCompanyStaff.omit({
|
|
527
|
+
state: CompanyState.omit({ _id: true }),
|
|
528
|
+
preferences: CompanyPreferences.omit({ _id: true }),
|
|
529
|
+
billing: CompanyBilling.omit({ _id: true }),
|
|
530
|
+
staff: RawCompanyStaff.omit({ _id: true })
|
|
516
531
|
});
|
|
517
532
|
var MutableCompanyDetails = z16.object({
|
|
518
|
-
|
|
533
|
+
_id: CompanyDetails.shape._id,
|
|
519
534
|
identity: MutableCompanyIdentity.partial().optional(),
|
|
520
535
|
preferences: MutableCompanyPreferences.partial().optional(),
|
|
521
536
|
billing: MutableCompanyBilling.partial().optional(),
|
|
@@ -584,13 +599,13 @@ var MedicalDetails = z19.object({
|
|
|
584
599
|
import * as z20 from "zod";
|
|
585
600
|
var TimelineActivity = z20.object({
|
|
586
601
|
postedAt: Timestamp.nullish(),
|
|
587
|
-
userUid: CompanyUser.shape.
|
|
602
|
+
userUid: CompanyUser.shape._id.nonoptional()
|
|
588
603
|
});
|
|
589
604
|
var MiniAppointmentDetails = z20.object({
|
|
590
605
|
/** A random uid that identifies the document. */
|
|
591
606
|
_id: z20.uuidv4(),
|
|
592
607
|
/** The company's uid */
|
|
593
|
-
src: CompanyState.shape.
|
|
608
|
+
src: CompanyState.shape._id,
|
|
594
609
|
/** The ticket number */
|
|
595
610
|
tkt: TicketNo,
|
|
596
611
|
/**The reason for the service */
|
|
@@ -613,7 +628,7 @@ var MiniAppointmentDetails = z20.object({
|
|
|
613
628
|
discounts: z20.array(PriceAdjustment).nullable().readonly(),
|
|
614
629
|
prepayments: z20.array(PriceAdjustment).nullable(),
|
|
615
630
|
/** The client's identity */
|
|
616
|
-
clientUid: ClientIdentity.shape.
|
|
631
|
+
clientUid: ClientIdentity.shape._id,
|
|
617
632
|
/**
|
|
618
633
|
* Data that is specific to the entity (for now it's just medical data).
|
|
619
634
|
* It will only be defined for the participants that have access to it.
|
|
@@ -659,9 +674,9 @@ var MutableAppointmentDetails = AppointmentDetails.safeExtend(
|
|
|
659
674
|
}).shape
|
|
660
675
|
);
|
|
661
676
|
var ScheduleAppointmentForm = z20.object({
|
|
662
|
-
clientUid: ClientIdentity.shape.
|
|
677
|
+
clientUid: ClientIdentity.shape._id,
|
|
663
678
|
/** A nullish value === next_available */
|
|
664
|
-
serviceProviderUid: CompanyUser.shape.
|
|
679
|
+
serviceProviderUid: CompanyUser.shape._id.nullish(),
|
|
665
680
|
charges: AppointmentDetails.shape.charges.optional(),
|
|
666
681
|
prepayments: AppointmentDetails.shape.prepayments.optional(),
|
|
667
682
|
payments: AppointmentDetails.shape.payments.optional(),
|
|
@@ -722,7 +737,7 @@ async function scheduleAppointment(request) {
|
|
|
722
737
|
prepayments: true,
|
|
723
738
|
lastModified: true
|
|
724
739
|
}).parse(request.billing);
|
|
725
|
-
const companyUser = request.staff?.members[request.sender.
|
|
740
|
+
const companyUser = request.staff?.members[request.sender._id];
|
|
726
741
|
const staffDetailsCopy = CompanyStaff.parse(structuredClone(request.staff));
|
|
727
742
|
const stateCopy = CompanyState.parse(structuredClone(request.state));
|
|
728
743
|
let selectedDoctor = null;
|
|
@@ -804,7 +819,7 @@ async function scheduleAppointment(request) {
|
|
|
804
819
|
staffDetailsCopy.lastModified = today;
|
|
805
820
|
const appointment = {
|
|
806
821
|
_id: v4(),
|
|
807
|
-
src: stateCopy.
|
|
822
|
+
src: stateCopy._id,
|
|
808
823
|
tkt: request.state.tktNoCounter,
|
|
809
824
|
discounts: Object.values(request.billing.discounts || {}).filter(
|
|
810
825
|
(disc) => !disc.isOptional
|
|
@@ -819,7 +834,7 @@ async function scheduleAppointment(request) {
|
|
|
819
834
|
_hash: "aa.aa.aa",
|
|
820
835
|
lastModified: null,
|
|
821
836
|
timeline: {
|
|
822
|
-
scheduler: { userUid: request.sender.
|
|
837
|
+
scheduler: { userUid: request.sender._id, postedAt: today },
|
|
823
838
|
doctor: { userUid: selectedDoctor },
|
|
824
839
|
physAsst: selectedPhysAsst ? { userUid: selectedPhysAsst } : "none",
|
|
825
840
|
get cashier() {
|