@bizmap/sdk 0.0.38 → 0.0.39
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 +145 -39
- package/dist/main.js +36 -22
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -112,7 +112,7 @@ declare const CompanyUser: z.ZodObject<{
|
|
|
112
112
|
cshr: "cshr";
|
|
113
113
|
admin: "admin";
|
|
114
114
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
115
|
-
|
|
115
|
+
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
116
116
|
lastActive: z.ZodInt;
|
|
117
117
|
name: z.ZodRecord<z.ZodEnum<{
|
|
118
118
|
first: "first";
|
|
@@ -269,7 +269,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
269
269
|
cshr: "cshr";
|
|
270
270
|
admin: "admin";
|
|
271
271
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
272
|
-
|
|
272
|
+
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
273
273
|
lastActive: z.ZodInt;
|
|
274
274
|
name: z.ZodRecord<z.ZodEnum<{
|
|
275
275
|
first: "first";
|
|
@@ -282,8 +282,20 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
282
282
|
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
283
283
|
addedAt: z.ZodInt;
|
|
284
284
|
}, z.core.$strip>>>;
|
|
285
|
-
|
|
286
|
-
|
|
285
|
+
updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
286
|
+
$REMOVE: z.ZodOptional<z.ZodObject<{
|
|
287
|
+
addedAt: z.ZodInt;
|
|
288
|
+
}, z.core.$strip>>;
|
|
289
|
+
$CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
|
|
290
|
+
newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
291
|
+
doc: "doc";
|
|
292
|
+
physAsst: "physAsst";
|
|
293
|
+
rcpst: "rcpst";
|
|
294
|
+
cshr: "cshr";
|
|
295
|
+
admin: "admin";
|
|
296
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
297
|
+
addedAt: z.ZodInt;
|
|
298
|
+
}, z.core.$strip>>;
|
|
287
299
|
}, z.core.$strip>>;
|
|
288
300
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
289
301
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -296,7 +308,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
296
308
|
lastModified: number | null;
|
|
297
309
|
};
|
|
298
310
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
299
|
-
|
|
311
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
300
312
|
lastActive: number;
|
|
301
313
|
name: Record<"first" | "last", string>;
|
|
302
314
|
email: string;
|
|
@@ -307,8 +319,14 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
307
319
|
partnerMap: Record<string, Record<string, {
|
|
308
320
|
addedAt: number;
|
|
309
321
|
}>>;
|
|
310
|
-
|
|
311
|
-
|
|
322
|
+
updateQueue: Record<string, {
|
|
323
|
+
$REMOVE?: {
|
|
324
|
+
addedAt: number;
|
|
325
|
+
} | undefined;
|
|
326
|
+
$CHANGE_ROLES?: {
|
|
327
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
328
|
+
addedAt: number;
|
|
329
|
+
} | undefined;
|
|
312
330
|
}>;
|
|
313
331
|
lastModified: number | null;
|
|
314
332
|
}, {
|
|
@@ -321,7 +339,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
321
339
|
lastModified: number | null;
|
|
322
340
|
};
|
|
323
341
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
324
|
-
|
|
342
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
325
343
|
lastActive: number;
|
|
326
344
|
name: Record<"first" | "last", string>;
|
|
327
345
|
email: string;
|
|
@@ -332,8 +350,14 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
332
350
|
partnerMap: Record<string, Record<string, {
|
|
333
351
|
addedAt: number;
|
|
334
352
|
}>>;
|
|
335
|
-
|
|
336
|
-
|
|
353
|
+
updateQueue: Record<string, {
|
|
354
|
+
$REMOVE?: {
|
|
355
|
+
addedAt: number;
|
|
356
|
+
} | undefined;
|
|
357
|
+
$CHANGE_ROLES?: {
|
|
358
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
359
|
+
addedAt: number;
|
|
360
|
+
} | undefined;
|
|
337
361
|
}>;
|
|
338
362
|
lastModified: number | null;
|
|
339
363
|
}>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
@@ -357,7 +381,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
357
381
|
cshr: "cshr";
|
|
358
382
|
admin: "admin";
|
|
359
383
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
360
|
-
|
|
384
|
+
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
361
385
|
lastActive: z.ZodInt;
|
|
362
386
|
name: z.ZodRecord<z.ZodEnum<{
|
|
363
387
|
first: "first";
|
|
@@ -370,8 +394,20 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
370
394
|
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
371
395
|
addedAt: z.ZodInt;
|
|
372
396
|
}, z.core.$strip>>>;
|
|
373
|
-
|
|
374
|
-
|
|
397
|
+
updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
398
|
+
$REMOVE: z.ZodOptional<z.ZodObject<{
|
|
399
|
+
addedAt: z.ZodInt;
|
|
400
|
+
}, z.core.$strip>>;
|
|
401
|
+
$CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
|
|
402
|
+
newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
403
|
+
doc: "doc";
|
|
404
|
+
physAsst: "physAsst";
|
|
405
|
+
rcpst: "rcpst";
|
|
406
|
+
cshr: "cshr";
|
|
407
|
+
admin: "admin";
|
|
408
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
409
|
+
addedAt: z.ZodInt;
|
|
410
|
+
}, z.core.$strip>>;
|
|
375
411
|
}, z.core.$strip>>;
|
|
376
412
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
377
413
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -384,7 +420,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
384
420
|
lastModified: number | null;
|
|
385
421
|
};
|
|
386
422
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
387
|
-
|
|
423
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
388
424
|
lastActive: number;
|
|
389
425
|
name: Record<"first" | "last", string>;
|
|
390
426
|
email: string;
|
|
@@ -395,8 +431,14 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
395
431
|
partnerMap: Record<string, Record<string, {
|
|
396
432
|
addedAt: number;
|
|
397
433
|
}>>;
|
|
398
|
-
|
|
399
|
-
|
|
434
|
+
updateQueue: Record<string, {
|
|
435
|
+
$REMOVE?: {
|
|
436
|
+
addedAt: number;
|
|
437
|
+
} | undefined;
|
|
438
|
+
$CHANGE_ROLES?: {
|
|
439
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
440
|
+
addedAt: number;
|
|
441
|
+
} | undefined;
|
|
400
442
|
}>;
|
|
401
443
|
lastModified: number | null;
|
|
402
444
|
}, {
|
|
@@ -409,7 +451,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
409
451
|
lastModified: number | null;
|
|
410
452
|
};
|
|
411
453
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
412
|
-
|
|
454
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
413
455
|
lastActive: number;
|
|
414
456
|
name: Record<"first" | "last", string>;
|
|
415
457
|
email: string;
|
|
@@ -420,8 +462,14 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
420
462
|
partnerMap: Record<string, Record<string, {
|
|
421
463
|
addedAt: number;
|
|
422
464
|
}>>;
|
|
423
|
-
|
|
424
|
-
|
|
465
|
+
updateQueue: Record<string, {
|
|
466
|
+
$REMOVE?: {
|
|
467
|
+
addedAt: number;
|
|
468
|
+
} | undefined;
|
|
469
|
+
$CHANGE_ROLES?: {
|
|
470
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
471
|
+
addedAt: number;
|
|
472
|
+
} | undefined;
|
|
425
473
|
}>;
|
|
426
474
|
lastModified: number | null;
|
|
427
475
|
}>>>>;
|
|
@@ -574,7 +622,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
574
622
|
cshr: "cshr";
|
|
575
623
|
admin: "admin";
|
|
576
624
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
577
|
-
|
|
625
|
+
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
578
626
|
lastActive: z.ZodInt;
|
|
579
627
|
name: z.ZodRecord<z.ZodEnum<{
|
|
580
628
|
first: "first";
|
|
@@ -587,8 +635,20 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
587
635
|
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
588
636
|
addedAt: z.ZodInt;
|
|
589
637
|
}, z.core.$strip>>>;
|
|
590
|
-
|
|
591
|
-
|
|
638
|
+
updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
639
|
+
$REMOVE: z.ZodOptional<z.ZodObject<{
|
|
640
|
+
addedAt: z.ZodInt;
|
|
641
|
+
}, z.core.$strip>>;
|
|
642
|
+
$CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
|
|
643
|
+
newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
644
|
+
doc: "doc";
|
|
645
|
+
physAsst: "physAsst";
|
|
646
|
+
rcpst: "rcpst";
|
|
647
|
+
cshr: "cshr";
|
|
648
|
+
admin: "admin";
|
|
649
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
650
|
+
addedAt: z.ZodInt;
|
|
651
|
+
}, z.core.$strip>>;
|
|
592
652
|
}, z.core.$strip>>;
|
|
593
653
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
594
654
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -601,7 +661,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
601
661
|
lastModified: number | null;
|
|
602
662
|
};
|
|
603
663
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
604
|
-
|
|
664
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
605
665
|
lastActive: number;
|
|
606
666
|
name: Record<"first" | "last", string>;
|
|
607
667
|
email: string;
|
|
@@ -612,8 +672,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
612
672
|
partnerMap: Record<string, Record<string, {
|
|
613
673
|
addedAt: number;
|
|
614
674
|
}>>;
|
|
615
|
-
|
|
616
|
-
|
|
675
|
+
updateQueue: Record<string, {
|
|
676
|
+
$REMOVE?: {
|
|
677
|
+
addedAt: number;
|
|
678
|
+
} | undefined;
|
|
679
|
+
$CHANGE_ROLES?: {
|
|
680
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
681
|
+
addedAt: number;
|
|
682
|
+
} | undefined;
|
|
617
683
|
}>;
|
|
618
684
|
lastModified: number | null;
|
|
619
685
|
}, {
|
|
@@ -626,7 +692,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
626
692
|
lastModified: number | null;
|
|
627
693
|
};
|
|
628
694
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
629
|
-
|
|
695
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
630
696
|
lastActive: number;
|
|
631
697
|
name: Record<"first" | "last", string>;
|
|
632
698
|
email: string;
|
|
@@ -637,8 +703,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
637
703
|
partnerMap: Record<string, Record<string, {
|
|
638
704
|
addedAt: number;
|
|
639
705
|
}>>;
|
|
640
|
-
|
|
641
|
-
|
|
706
|
+
updateQueue: Record<string, {
|
|
707
|
+
$REMOVE?: {
|
|
708
|
+
addedAt: number;
|
|
709
|
+
} | undefined;
|
|
710
|
+
$CHANGE_ROLES?: {
|
|
711
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
712
|
+
addedAt: number;
|
|
713
|
+
} | undefined;
|
|
642
714
|
}>;
|
|
643
715
|
lastModified: number | null;
|
|
644
716
|
}>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
|
|
@@ -662,7 +734,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
662
734
|
cshr: "cshr";
|
|
663
735
|
admin: "admin";
|
|
664
736
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
665
|
-
|
|
737
|
+
appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
|
|
666
738
|
lastActive: z.ZodInt;
|
|
667
739
|
name: z.ZodRecord<z.ZodEnum<{
|
|
668
740
|
first: "first";
|
|
@@ -675,8 +747,20 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
675
747
|
partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
676
748
|
addedAt: z.ZodInt;
|
|
677
749
|
}, z.core.$strip>>>;
|
|
678
|
-
|
|
679
|
-
|
|
750
|
+
updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
|
|
751
|
+
$REMOVE: z.ZodOptional<z.ZodObject<{
|
|
752
|
+
addedAt: z.ZodInt;
|
|
753
|
+
}, z.core.$strip>>;
|
|
754
|
+
$CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
|
|
755
|
+
newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
756
|
+
doc: "doc";
|
|
757
|
+
physAsst: "physAsst";
|
|
758
|
+
rcpst: "rcpst";
|
|
759
|
+
cshr: "cshr";
|
|
760
|
+
admin: "admin";
|
|
761
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
|
|
762
|
+
addedAt: z.ZodInt;
|
|
763
|
+
}, z.core.$strip>>;
|
|
680
764
|
}, z.core.$strip>>;
|
|
681
765
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
682
766
|
}, z.core.$strip>, z.ZodTransform<{
|
|
@@ -689,7 +773,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
689
773
|
lastModified: number | null;
|
|
690
774
|
};
|
|
691
775
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
692
|
-
|
|
776
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
693
777
|
lastActive: number;
|
|
694
778
|
name: Record<"first" | "last", string>;
|
|
695
779
|
email: string;
|
|
@@ -700,8 +784,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
700
784
|
partnerMap: Record<string, Record<string, {
|
|
701
785
|
addedAt: number;
|
|
702
786
|
}>>;
|
|
703
|
-
|
|
704
|
-
|
|
787
|
+
updateQueue: Record<string, {
|
|
788
|
+
$REMOVE?: {
|
|
789
|
+
addedAt: number;
|
|
790
|
+
} | undefined;
|
|
791
|
+
$CHANGE_ROLES?: {
|
|
792
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
793
|
+
addedAt: number;
|
|
794
|
+
} | undefined;
|
|
705
795
|
}>;
|
|
706
796
|
lastModified: number | null;
|
|
707
797
|
}, {
|
|
@@ -714,7 +804,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
714
804
|
lastModified: number | null;
|
|
715
805
|
};
|
|
716
806
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
717
|
-
|
|
807
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
718
808
|
lastActive: number;
|
|
719
809
|
name: Record<"first" | "last", string>;
|
|
720
810
|
email: string;
|
|
@@ -725,8 +815,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
725
815
|
partnerMap: Record<string, Record<string, {
|
|
726
816
|
addedAt: number;
|
|
727
817
|
}>>;
|
|
728
|
-
|
|
729
|
-
|
|
818
|
+
updateQueue: Record<string, {
|
|
819
|
+
$REMOVE?: {
|
|
820
|
+
addedAt: number;
|
|
821
|
+
} | undefined;
|
|
822
|
+
$CHANGE_ROLES?: {
|
|
823
|
+
newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
824
|
+
addedAt: number;
|
|
825
|
+
} | undefined;
|
|
730
826
|
}>;
|
|
731
827
|
lastModified: number | null;
|
|
732
828
|
}>>>>;
|
|
@@ -765,11 +861,21 @@ declare const employeeRoles: z.ZodEnum<{
|
|
|
765
861
|
cshr: "cshr";
|
|
766
862
|
}>;
|
|
767
863
|
type EmployeeRole = z.infer<typeof employeeRoles>;
|
|
864
|
+
declare const healthcareProviderRoles: z.ZodEnum<{
|
|
865
|
+
doc: "doc";
|
|
866
|
+
physAsst: "physAsst";
|
|
867
|
+
}>;
|
|
868
|
+
type HealthcareProviderRole = z.infer<typeof healthcareProviderRoles>;
|
|
768
869
|
declare const appointmentDistAlgs: z.ZodEnum<{
|
|
769
870
|
RR: "RR";
|
|
770
871
|
LOR: "LOR";
|
|
771
872
|
}>;
|
|
772
873
|
type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
|
|
874
|
+
declare const companyServiceSelectors: z.ZodEnum<{
|
|
875
|
+
scheduler: "scheduler";
|
|
876
|
+
doctor: "doctor";
|
|
877
|
+
}>;
|
|
878
|
+
type CompanyServiceSelector = z.infer<typeof companyServiceSelectors>;
|
|
773
879
|
|
|
774
880
|
/**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
|
|
775
881
|
declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
@@ -781,7 +887,7 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
781
887
|
lastModified: number | null;
|
|
782
888
|
};
|
|
783
889
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
|
|
784
|
-
|
|
890
|
+
appointmentCounter: Record<"ongoing" | "completed", number>;
|
|
785
891
|
lastActive: number;
|
|
786
892
|
name: Record<"first" | "last", string>;
|
|
787
893
|
email: string;
|
|
@@ -792,4 +898,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
792
898
|
/**@returns the roles that are compatible with the selected role. */
|
|
793
899
|
declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
|
|
794
900
|
|
|
795
|
-
export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, InvoiceNo, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StandardTime, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
|
|
901
|
+
export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, CompanyRegistrationClaims, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InvoiceNo, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StandardTime, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles };
|
package/dist/main.js
CHANGED
|
@@ -74,7 +74,12 @@ var companyPartnerRoles = companyUserRoles.extract([
|
|
|
74
74
|
"physAsst"
|
|
75
75
|
]);
|
|
76
76
|
var employeeRoles = companyUserRoles.exclude(["admin"]);
|
|
77
|
+
var healthcareProviderRoles = companyUserRoles.extract([
|
|
78
|
+
"physAsst",
|
|
79
|
+
"doc"
|
|
80
|
+
]);
|
|
77
81
|
var appointmentDistAlgs = z3.enum(["RR", "LOR"]);
|
|
82
|
+
var companyServiceSelectors = z3.enum(["scheduler", "doctor"]);
|
|
78
83
|
|
|
79
84
|
// src/schemas/Company.ts
|
|
80
85
|
var RegisterCompanyForm = z4.object({
|
|
@@ -107,13 +112,15 @@ var CompanyUser = z4.object({
|
|
|
107
112
|
}
|
|
108
113
|
return newRoles.sort();
|
|
109
114
|
}).refine((roles) => {
|
|
110
|
-
const compatibleRoles = getCompatibleRoles(roles[0]);
|
|
111
115
|
return roles.every(
|
|
112
|
-
(role, i) => i === 0 ||
|
|
116
|
+
(role, i) => i === 0 || getCompatibleRoles(roles[0]).includes(role)
|
|
113
117
|
);
|
|
114
118
|
}, "A user is not allowed to have conflicting roles."),
|
|
115
119
|
/** This should reset at the end of every cycle. */
|
|
116
|
-
|
|
120
|
+
appointmentCounter: z4.record(
|
|
121
|
+
z4.literal(["ongoing", "completed"]),
|
|
122
|
+
z4.int().min(0)
|
|
123
|
+
),
|
|
117
124
|
lastActive: Timestamp,
|
|
118
125
|
...TimeLog.shape
|
|
119
126
|
}).superRefine((data, ctx) => {
|
|
@@ -176,7 +183,7 @@ var BillingDetails = z4.object({
|
|
|
176
183
|
/** Forces service selectors to use the list of service(s) that you've created. */
|
|
177
184
|
useCreatedServices: z4.boolean(),
|
|
178
185
|
/** The user that's allowed to record the client's services. */
|
|
179
|
-
serviceSelector:
|
|
186
|
+
serviceSelector: companyServiceSelectors,
|
|
180
187
|
/** A record of the payments made must be attached before creating the
|
|
181
188
|
* appointment
|
|
182
189
|
* @note
|
|
@@ -234,29 +241,34 @@ var StaffDetails = z4.object({
|
|
|
234
241
|
partnerMap: z4.record(
|
|
235
242
|
CompanyUser.shape.uid,
|
|
236
243
|
z4.record(CompanyUser.shape.uid, z4.object({ addedAt: Timestamp }))
|
|
237
|
-
// z
|
|
238
|
-
// .array(CompanyUser.shape.uid)
|
|
239
|
-
// .transform((pUids) => {
|
|
240
|
-
// const partners: string[] = [];
|
|
241
|
-
// for (const uid of pUids) {
|
|
242
|
-
// if (!uid || typeof uid !== "string") continue;
|
|
243
|
-
// if (!partners.some((p) => p.toLowerCase() === uid.toLowerCase())) {
|
|
244
|
-
// partners.push(uid);
|
|
245
|
-
// }
|
|
246
|
-
// }
|
|
247
|
-
// return partners.sort();
|
|
248
|
-
// }),
|
|
249
244
|
),
|
|
250
|
-
|
|
245
|
+
updateQueue: z4.record(
|
|
251
246
|
CompanyUser.shape.uid,
|
|
252
|
-
z4.object({
|
|
247
|
+
z4.object({
|
|
248
|
+
$REMOVE: z4.object({ addedAt: Timestamp }),
|
|
249
|
+
$CHANGE_ROLES: z4.object({
|
|
250
|
+
newRoles: CompanyUser.shape.roles,
|
|
251
|
+
addedAt: Timestamp
|
|
252
|
+
})
|
|
253
|
+
}).partial()
|
|
253
254
|
),
|
|
254
255
|
lastModified: Timestamp.nullable()
|
|
255
256
|
}).transform((d) => {
|
|
256
257
|
const copy = structuredClone(d);
|
|
257
|
-
for (const uid of Object.keys(copy.
|
|
258
|
-
if (uid in copy.members)
|
|
259
|
-
|
|
258
|
+
for (const uid of Object.keys(copy.updateQueue)) {
|
|
259
|
+
if (uid in copy.members) {
|
|
260
|
+
const user = copy.updateQueue[uid];
|
|
261
|
+
if ("$REMOVE" in user) {
|
|
262
|
+
copy.updateQueue[uid] = { $REMOVE: user.$REMOVE };
|
|
263
|
+
} else if (user.$CHANGE_ROLES && user.$CHANGE_ROLES.newRoles.length === copy.members[uid].roles.length && user.$CHANGE_ROLES.newRoles.every(
|
|
264
|
+
(role) => copy.members[uid].roles.includes(role)
|
|
265
|
+
)) {
|
|
266
|
+
delete copy.updateQueue[uid].$CHANGE_ROLES;
|
|
267
|
+
}
|
|
268
|
+
if (Object.keys(user).length < 1) delete copy.updateQueue[uid];
|
|
269
|
+
} else {
|
|
270
|
+
delete copy.updateQueue[uid];
|
|
271
|
+
}
|
|
260
272
|
}
|
|
261
273
|
for (const [docUid, assts] of Object.entries(copy.partnerMap)) {
|
|
262
274
|
if (docUid in d.members) {
|
|
@@ -351,8 +363,10 @@ export {
|
|
|
351
363
|
UuidV7,
|
|
352
364
|
appointmentDistAlgs,
|
|
353
365
|
companyPartnerRoles,
|
|
366
|
+
companyServiceSelectors,
|
|
354
367
|
companyUserRoles,
|
|
355
368
|
employeeRoles,
|
|
356
369
|
findConflictingPartners,
|
|
357
|
-
getCompatibleRoles
|
|
370
|
+
getCompatibleRoles,
|
|
371
|
+
healthcareProviderRoles
|
|
358
372
|
};
|