@bizmap/sdk 0.0.38 → 0.0.40

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.
Files changed (3) hide show
  1. package/dist/main.d.ts +163 -106
  2. package/dist/main.js +48 -50
  3. package/package.json +1 -1
package/dist/main.d.ts CHANGED
@@ -25,73 +25,6 @@ declare const PriceTag: z.ZodObject<{
25
25
  }, z.core.$strip>;
26
26
  type PriceTag = z.infer<typeof PriceTag>;
27
27
 
28
- declare const RegisterCompanyForm: z.ZodObject<{
29
- regNo: z.ZodString;
30
- userProvisions: z.ZodNumber;
31
- slogan: z.ZodString;
32
- email: z.ZodEmail;
33
- phoneNumber: z.ZodString;
34
- logo: z.ZodObject<{
35
- lastModified: z.ZodNullable<z.ZodNumber>;
36
- uid: z.ZodOptional<z.ZodString>;
37
- uploadDate: z.ZodOptional<z.ZodNumber>;
38
- sizeInBytes: z.ZodNumber;
39
- name: z.ZodString;
40
- path: z.ZodString;
41
- extension: z.ZodString;
42
- description: z.ZodOptional<z.ZodString>;
43
- mime: z.ZodString;
44
- alias: z.ZodEnum<{
45
- pdf: "pdf";
46
- word: "word";
47
- excel: "excel";
48
- img: "img";
49
- txt: "txt";
50
- unknown: "unknown";
51
- }>;
52
- }, z.core.$strip>;
53
- receipt: z.ZodObject<{
54
- lastModified: z.ZodNullable<z.ZodNumber>;
55
- uid: z.ZodOptional<z.ZodString>;
56
- uploadDate: z.ZodOptional<z.ZodNumber>;
57
- sizeInBytes: z.ZodNumber;
58
- name: z.ZodString;
59
- path: z.ZodString;
60
- extension: z.ZodString;
61
- description: z.ZodOptional<z.ZodString>;
62
- mime: z.ZodString;
63
- alias: z.ZodEnum<{
64
- pdf: "pdf";
65
- word: "word";
66
- excel: "excel";
67
- img: "img";
68
- txt: "txt";
69
- unknown: "unknown";
70
- }>;
71
- }, z.core.$strip>;
72
- _claims: z.ZodString;
73
- }, z.core.$strip>;
74
- type RegisterCompanyForm = z.infer<typeof RegisterCompanyForm>;
75
- declare const CompanyRegistrationClaims: z.ZodObject<{
76
- createdAt: z.ZodReadonly<z.ZodInt>;
77
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
78
- sender: z.ZodObject<{
79
- name: z.ZodRecord<z.ZodEnum<{
80
- first: "first";
81
- last: "last";
82
- }>, z.ZodString>;
83
- photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
84
- email: z.ZodEmail;
85
- phoneNumber: z.ZodOptional<z.ZodString>;
86
- uid: z.ZodString;
87
- }, z.core.$strip>;
88
- pricingRate: z.ZodObject<{
89
- flatFee: z.ZodNumber;
90
- feePerUser: z.ZodNumber;
91
- lastModified: z.ZodInt;
92
- }, z.core.$strip>;
93
- }, z.core.$strip>;
94
- type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
95
28
  declare const CompanyUser: z.ZodObject<{
96
29
  createdAt: z.ZodReadonly<z.ZodInt>;
97
30
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -112,7 +45,7 @@ declare const CompanyUser: z.ZodObject<{
112
45
  cshr: "cshr";
113
46
  admin: "admin";
114
47
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
115
- totalAppts: z.ZodInt;
48
+ appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
116
49
  lastActive: z.ZodInt;
117
50
  name: z.ZodRecord<z.ZodEnum<{
118
51
  first: "first";
@@ -145,6 +78,15 @@ declare const CompanyDetails: z.ZodObject<{
145
78
  }, z.core.$strip>;
146
79
  lastModified: z.ZodNullable<z.ZodInt>;
147
80
  }, z.core.$strip>;
81
+ receipts: z.ZodArray<z.ZodObject<{
82
+ createdAt: z.ZodReadonly<z.ZodInt>;
83
+ item: z.ZodString;
84
+ cost: z.ZodNumber;
85
+ }, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
86
+ createdAt: z.ZodReadonly<z.ZodInt>;
87
+ item: z.ZodString;
88
+ cost: z.ZodNumber;
89
+ }, z.core.$strip>>>>;
148
90
  state: z.ZodObject<{
149
91
  availableBalance: z.ZodNumber;
150
92
  totalUploads: z.ZodNumber;
@@ -269,7 +211,7 @@ declare const CompanyDetails: z.ZodObject<{
269
211
  cshr: "cshr";
270
212
  admin: "admin";
271
213
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
272
- totalAppts: z.ZodInt;
214
+ appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
273
215
  lastActive: z.ZodInt;
274
216
  name: z.ZodRecord<z.ZodEnum<{
275
217
  first: "first";
@@ -282,8 +224,20 @@ declare const CompanyDetails: z.ZodObject<{
282
224
  partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
283
225
  addedAt: z.ZodInt;
284
226
  }, z.core.$strip>>>;
285
- blackList: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
286
- addedAt: z.ZodInt;
227
+ updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
228
+ $REMOVE: z.ZodOptional<z.ZodObject<{
229
+ addedAt: z.ZodInt;
230
+ }, z.core.$strip>>;
231
+ $CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
232
+ newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
233
+ doc: "doc";
234
+ physAsst: "physAsst";
235
+ rcpst: "rcpst";
236
+ cshr: "cshr";
237
+ admin: "admin";
238
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
239
+ addedAt: z.ZodInt;
240
+ }, z.core.$strip>>;
287
241
  }, z.core.$strip>>;
288
242
  lastModified: z.ZodNullable<z.ZodInt>;
289
243
  }, z.core.$strip>, z.ZodTransform<{
@@ -296,7 +250,7 @@ declare const CompanyDetails: z.ZodObject<{
296
250
  lastModified: number | null;
297
251
  };
298
252
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
299
- totalAppts: number;
253
+ appointmentCounter: Record<"ongoing" | "completed", number>;
300
254
  lastActive: number;
301
255
  name: Record<"first" | "last", string>;
302
256
  email: string;
@@ -307,8 +261,14 @@ declare const CompanyDetails: z.ZodObject<{
307
261
  partnerMap: Record<string, Record<string, {
308
262
  addedAt: number;
309
263
  }>>;
310
- blackList: Record<string, {
311
- addedAt: number;
264
+ updateQueue: Record<string, {
265
+ $REMOVE?: {
266
+ addedAt: number;
267
+ } | undefined;
268
+ $CHANGE_ROLES?: {
269
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
270
+ addedAt: number;
271
+ } | undefined;
312
272
  }>;
313
273
  lastModified: number | null;
314
274
  }, {
@@ -321,7 +281,7 @@ declare const CompanyDetails: z.ZodObject<{
321
281
  lastModified: number | null;
322
282
  };
323
283
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
324
- totalAppts: number;
284
+ appointmentCounter: Record<"ongoing" | "completed", number>;
325
285
  lastActive: number;
326
286
  name: Record<"first" | "last", string>;
327
287
  email: string;
@@ -332,8 +292,14 @@ declare const CompanyDetails: z.ZodObject<{
332
292
  partnerMap: Record<string, Record<string, {
333
293
  addedAt: number;
334
294
  }>>;
335
- blackList: Record<string, {
336
- addedAt: number;
295
+ updateQueue: Record<string, {
296
+ $REMOVE?: {
297
+ addedAt: number;
298
+ } | undefined;
299
+ $CHANGE_ROLES?: {
300
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
301
+ addedAt: number;
302
+ } | undefined;
337
303
  }>;
338
304
  lastModified: number | null;
339
305
  }>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
@@ -357,7 +323,7 @@ declare const CompanyDetails: z.ZodObject<{
357
323
  cshr: "cshr";
358
324
  admin: "admin";
359
325
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
360
- totalAppts: z.ZodInt;
326
+ appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
361
327
  lastActive: z.ZodInt;
362
328
  name: z.ZodRecord<z.ZodEnum<{
363
329
  first: "first";
@@ -370,8 +336,20 @@ declare const CompanyDetails: z.ZodObject<{
370
336
  partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
371
337
  addedAt: z.ZodInt;
372
338
  }, z.core.$strip>>>;
373
- blackList: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
374
- addedAt: z.ZodInt;
339
+ updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
340
+ $REMOVE: z.ZodOptional<z.ZodObject<{
341
+ addedAt: z.ZodInt;
342
+ }, z.core.$strip>>;
343
+ $CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
344
+ newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
345
+ doc: "doc";
346
+ physAsst: "physAsst";
347
+ rcpst: "rcpst";
348
+ cshr: "cshr";
349
+ admin: "admin";
350
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
351
+ addedAt: z.ZodInt;
352
+ }, z.core.$strip>>;
375
353
  }, z.core.$strip>>;
376
354
  lastModified: z.ZodNullable<z.ZodInt>;
377
355
  }, z.core.$strip>, z.ZodTransform<{
@@ -384,7 +362,7 @@ declare const CompanyDetails: z.ZodObject<{
384
362
  lastModified: number | null;
385
363
  };
386
364
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
387
- totalAppts: number;
365
+ appointmentCounter: Record<"ongoing" | "completed", number>;
388
366
  lastActive: number;
389
367
  name: Record<"first" | "last", string>;
390
368
  email: string;
@@ -395,8 +373,14 @@ declare const CompanyDetails: z.ZodObject<{
395
373
  partnerMap: Record<string, Record<string, {
396
374
  addedAt: number;
397
375
  }>>;
398
- blackList: Record<string, {
399
- addedAt: number;
376
+ updateQueue: Record<string, {
377
+ $REMOVE?: {
378
+ addedAt: number;
379
+ } | undefined;
380
+ $CHANGE_ROLES?: {
381
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
382
+ addedAt: number;
383
+ } | undefined;
400
384
  }>;
401
385
  lastModified: number | null;
402
386
  }, {
@@ -409,7 +393,7 @@ declare const CompanyDetails: z.ZodObject<{
409
393
  lastModified: number | null;
410
394
  };
411
395
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
412
- totalAppts: number;
396
+ appointmentCounter: Record<"ongoing" | "completed", number>;
413
397
  lastActive: number;
414
398
  name: Record<"first" | "last", string>;
415
399
  email: string;
@@ -420,8 +404,14 @@ declare const CompanyDetails: z.ZodObject<{
420
404
  partnerMap: Record<string, Record<string, {
421
405
  addedAt: number;
422
406
  }>>;
423
- blackList: Record<string, {
424
- addedAt: number;
407
+ updateQueue: Record<string, {
408
+ $REMOVE?: {
409
+ addedAt: number;
410
+ } | undefined;
411
+ $CHANGE_ROLES?: {
412
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
413
+ addedAt: number;
414
+ } | undefined;
425
415
  }>;
426
416
  lastModified: number | null;
427
417
  }>>>>;
@@ -450,6 +440,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
450
440
  }, z.core.$strip>;
451
441
  lastModified: z.ZodNullable<z.ZodInt>;
452
442
  }, z.core.$strip>;
443
+ receipts: z.ZodArray<z.ZodObject<{
444
+ createdAt: z.ZodReadonly<z.ZodInt>;
445
+ item: z.ZodString;
446
+ cost: z.ZodNumber;
447
+ }, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
448
+ createdAt: z.ZodReadonly<z.ZodInt>;
449
+ item: z.ZodString;
450
+ cost: z.ZodNumber;
451
+ }, z.core.$strip>>>>;
453
452
  state: z.ZodObject<{
454
453
  availableBalance: z.ZodNumber;
455
454
  totalUploads: z.ZodNumber;
@@ -574,7 +573,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
574
573
  cshr: "cshr";
575
574
  admin: "admin";
576
575
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
577
- totalAppts: z.ZodInt;
576
+ appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
578
577
  lastActive: z.ZodInt;
579
578
  name: z.ZodRecord<z.ZodEnum<{
580
579
  first: "first";
@@ -587,8 +586,20 @@ declare const PartialCompanyDetails: z.ZodObject<{
587
586
  partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
588
587
  addedAt: z.ZodInt;
589
588
  }, z.core.$strip>>>;
590
- blackList: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
591
- addedAt: z.ZodInt;
589
+ updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
590
+ $REMOVE: z.ZodOptional<z.ZodObject<{
591
+ addedAt: z.ZodInt;
592
+ }, z.core.$strip>>;
593
+ $CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
594
+ newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
595
+ doc: "doc";
596
+ physAsst: "physAsst";
597
+ rcpst: "rcpst";
598
+ cshr: "cshr";
599
+ admin: "admin";
600
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
601
+ addedAt: z.ZodInt;
602
+ }, z.core.$strip>>;
592
603
  }, z.core.$strip>>;
593
604
  lastModified: z.ZodNullable<z.ZodInt>;
594
605
  }, z.core.$strip>, z.ZodTransform<{
@@ -601,7 +612,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
601
612
  lastModified: number | null;
602
613
  };
603
614
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
604
- totalAppts: number;
615
+ appointmentCounter: Record<"ongoing" | "completed", number>;
605
616
  lastActive: number;
606
617
  name: Record<"first" | "last", string>;
607
618
  email: string;
@@ -612,8 +623,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
612
623
  partnerMap: Record<string, Record<string, {
613
624
  addedAt: number;
614
625
  }>>;
615
- blackList: Record<string, {
616
- addedAt: number;
626
+ updateQueue: Record<string, {
627
+ $REMOVE?: {
628
+ addedAt: number;
629
+ } | undefined;
630
+ $CHANGE_ROLES?: {
631
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
632
+ addedAt: number;
633
+ } | undefined;
617
634
  }>;
618
635
  lastModified: number | null;
619
636
  }, {
@@ -626,7 +643,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
626
643
  lastModified: number | null;
627
644
  };
628
645
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
629
- totalAppts: number;
646
+ appointmentCounter: Record<"ongoing" | "completed", number>;
630
647
  lastActive: number;
631
648
  name: Record<"first" | "last", string>;
632
649
  email: string;
@@ -637,8 +654,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
637
654
  partnerMap: Record<string, Record<string, {
638
655
  addedAt: number;
639
656
  }>>;
640
- blackList: Record<string, {
641
- addedAt: number;
657
+ updateQueue: Record<string, {
658
+ $REMOVE?: {
659
+ addedAt: number;
660
+ } | undefined;
661
+ $CHANGE_ROLES?: {
662
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
663
+ addedAt: number;
664
+ } | undefined;
642
665
  }>;
643
666
  lastModified: number | null;
644
667
  }>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
@@ -662,7 +685,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
662
685
  cshr: "cshr";
663
686
  admin: "admin";
664
687
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
665
- totalAppts: z.ZodInt;
688
+ appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
666
689
  lastActive: z.ZodInt;
667
690
  name: z.ZodRecord<z.ZodEnum<{
668
691
  first: "first";
@@ -675,8 +698,20 @@ declare const PartialCompanyDetails: z.ZodObject<{
675
698
  partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
676
699
  addedAt: z.ZodInt;
677
700
  }, z.core.$strip>>>;
678
- blackList: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
679
- addedAt: z.ZodInt;
701
+ updateQueue: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodObject<{
702
+ $REMOVE: z.ZodOptional<z.ZodObject<{
703
+ addedAt: z.ZodInt;
704
+ }, z.core.$strip>>;
705
+ $CHANGE_ROLES: z.ZodOptional<z.ZodObject<{
706
+ newRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
707
+ doc: "doc";
708
+ physAsst: "physAsst";
709
+ rcpst: "rcpst";
710
+ cshr: "cshr";
711
+ admin: "admin";
712
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
713
+ addedAt: z.ZodInt;
714
+ }, z.core.$strip>>;
680
715
  }, z.core.$strip>>;
681
716
  lastModified: z.ZodNullable<z.ZodInt>;
682
717
  }, z.core.$strip>, z.ZodTransform<{
@@ -689,7 +724,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
689
724
  lastModified: number | null;
690
725
  };
691
726
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
692
- totalAppts: number;
727
+ appointmentCounter: Record<"ongoing" | "completed", number>;
693
728
  lastActive: number;
694
729
  name: Record<"first" | "last", string>;
695
730
  email: string;
@@ -700,8 +735,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
700
735
  partnerMap: Record<string, Record<string, {
701
736
  addedAt: number;
702
737
  }>>;
703
- blackList: Record<string, {
704
- addedAt: number;
738
+ updateQueue: Record<string, {
739
+ $REMOVE?: {
740
+ addedAt: number;
741
+ } | undefined;
742
+ $CHANGE_ROLES?: {
743
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
744
+ addedAt: number;
745
+ } | undefined;
705
746
  }>;
706
747
  lastModified: number | null;
707
748
  }, {
@@ -714,7 +755,7 @@ declare const PartialCompanyDetails: z.ZodObject<{
714
755
  lastModified: number | null;
715
756
  };
716
757
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
717
- totalAppts: number;
758
+ appointmentCounter: Record<"ongoing" | "completed", number>;
718
759
  lastActive: number;
719
760
  name: Record<"first" | "last", string>;
720
761
  email: string;
@@ -725,8 +766,14 @@ declare const PartialCompanyDetails: z.ZodObject<{
725
766
  partnerMap: Record<string, Record<string, {
726
767
  addedAt: number;
727
768
  }>>;
728
- blackList: Record<string, {
729
- addedAt: number;
769
+ updateQueue: Record<string, {
770
+ $REMOVE?: {
771
+ addedAt: number;
772
+ } | undefined;
773
+ $CHANGE_ROLES?: {
774
+ newRoles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
775
+ addedAt: number;
776
+ } | undefined;
730
777
  }>;
731
778
  lastModified: number | null;
732
779
  }>>>>;
@@ -765,11 +812,21 @@ declare const employeeRoles: z.ZodEnum<{
765
812
  cshr: "cshr";
766
813
  }>;
767
814
  type EmployeeRole = z.infer<typeof employeeRoles>;
815
+ declare const healthcareProviderRoles: z.ZodEnum<{
816
+ doc: "doc";
817
+ physAsst: "physAsst";
818
+ }>;
819
+ type HealthcareProviderRole = z.infer<typeof healthcareProviderRoles>;
768
820
  declare const appointmentDistAlgs: z.ZodEnum<{
769
821
  RR: "RR";
770
822
  LOR: "LOR";
771
823
  }>;
772
824
  type AppointmentDistAlg = z.infer<typeof appointmentDistAlgs>;
825
+ declare const companyServiceSelectors: z.ZodEnum<{
826
+ scheduler: "scheduler";
827
+ doctor: "doctor";
828
+ }>;
829
+ type CompanyServiceSelector = z.infer<typeof companyServiceSelectors>;
773
830
 
774
831
  /**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
775
832
  declare const findConflictingPartners: (...partners: CompanyUser[]) => {
@@ -781,7 +838,7 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
781
838
  lastModified: number | null;
782
839
  };
783
840
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
784
- totalAppts: number;
841
+ appointmentCounter: Record<"ongoing" | "completed", number>;
785
842
  lastActive: number;
786
843
  name: Record<"first" | "last", string>;
787
844
  email: string;
@@ -792,4 +849,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
792
849
  /**@returns the roles that are compatible with the selected role. */
793
850
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
794
851
 
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 };
852
+ export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InvoiceNo, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, StandardTime, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles };
package/dist/main.js CHANGED
@@ -54,7 +54,6 @@ var PriceTag = z2.object({
54
54
  import {
55
55
  Address,
56
56
  currencies,
57
- FileDetails,
58
57
  PhoneNumber,
59
58
  UserModel
60
59
  } from "@wavy/util";
@@ -74,24 +73,14 @@ var companyPartnerRoles = companyUserRoles.extract([
74
73
  "physAsst"
75
74
  ]);
76
75
  var employeeRoles = companyUserRoles.exclude(["admin"]);
76
+ var healthcareProviderRoles = companyUserRoles.extract([
77
+ "physAsst",
78
+ "doc"
79
+ ]);
77
80
  var appointmentDistAlgs = z3.enum(["RR", "LOR"]);
81
+ var companyServiceSelectors = z3.enum(["scheduler", "doctor"]);
78
82
 
79
83
  // src/schemas/Company.ts
80
- var RegisterCompanyForm = z4.object({
81
- regNo: z4.string(),
82
- userProvisions: z4.number(),
83
- slogan: z4.string(),
84
- email: z4.email(),
85
- phoneNumber: PhoneNumber,
86
- logo: FileDetails,
87
- receipt: FileDetails,
88
- _claims: z4.string()
89
- });
90
- var CompanyRegistrationClaims = z4.object({
91
- sender: UserModel,
92
- pricingRate: PricingRate.shape.companyRegistration,
93
- ...TimeLog.shape
94
- });
95
84
  var CompanyUser = z4.object({
96
85
  ...UserModel.shape,
97
86
  uid: UuidV7,
@@ -107,13 +96,15 @@ var CompanyUser = z4.object({
107
96
  }
108
97
  return newRoles.sort();
109
98
  }).refine((roles) => {
110
- const compatibleRoles = getCompatibleRoles(roles[0]);
111
99
  return roles.every(
112
- (role, i) => i === 0 || compatibleRoles.includes(role)
100
+ (role, i) => i === 0 || getCompatibleRoles(roles[0]).includes(role)
113
101
  );
114
102
  }, "A user is not allowed to have conflicting roles."),
115
103
  /** This should reset at the end of every cycle. */
116
- totalAppts: z4.int().min(0),
104
+ appointmentCounter: z4.record(
105
+ z4.literal(["ongoing", "completed"]),
106
+ z4.int().min(0)
107
+ ),
117
108
  lastActive: Timestamp,
118
109
  ...TimeLog.shape
119
110
  }).superRefine((data, ctx) => {
@@ -126,7 +117,7 @@ var CompanyUser = z4.object({
126
117
  );
127
118
  }
128
119
  });
129
- var IdentityDetails = z4.object({
120
+ var Identity = z4.object({
130
121
  displayName: z4.string().min(3).max(20),
131
122
  logo: z4.string().max(2500).nullish(),
132
123
  contact: z4.object({
@@ -142,7 +133,7 @@ var IdentityDetails = z4.object({
142
133
  }),
143
134
  lastModified: Timestamp.nullable()
144
135
  });
145
- var StateDetails = z4.object({
136
+ var CompanyState = z4.object({
146
137
  // This can only be changed by the server/app admin
147
138
  availableBalance: z4.number(),
148
139
  /**
@@ -158,7 +149,7 @@ var StateDetails = z4.object({
158
149
  tktNoCounter: z4.int().min(1),
159
150
  lastModified: Timestamp.nullable()
160
151
  });
161
- var PreferenceDetails = z4.object({
152
+ var CompanyPreferences = z4.object({
162
153
  /** The amount of user provisions made for this company */
163
154
  userProvisions: z4.number().max(150, { error: "The total user provisions can't exceed 150" }).refine(
164
155
  (p) => !(p > 1 && p < 10),
@@ -171,12 +162,12 @@ var PreferenceDetails = z4.object({
171
162
  apptDistAlg: appointmentDistAlgs.default("RR"),
172
163
  lastModified: Timestamp.nullable()
173
164
  });
174
- var BillingDetails = z4.object({
165
+ var Billing = z4.object({
175
166
  preferences: z4.object({
176
167
  /** Forces service selectors to use the list of service(s) that you've created. */
177
168
  useCreatedServices: z4.boolean(),
178
169
  /** The user that's allowed to record the client's services. */
179
- serviceSelector: z4.enum(["scheduler", "doctor"]),
170
+ serviceSelector: companyServiceSelectors,
180
171
  /** A record of the payments made must be attached before creating the
181
172
  * appointment
182
173
  * @note
@@ -210,7 +201,7 @@ var BillingDetails = z4.object({
210
201
  ctx.addIssue("At least (1) service must be added to the services list.");
211
202
  }
212
203
  });
213
- var StaffDetails = z4.object({
204
+ var Staff = z4.object({
214
205
  members: z4.record(CompanyUser.shape.uid, CompanyUser).superRefine((data, ctx) => {
215
206
  const emails = [];
216
207
  for (const [uid, user] of Object.entries(data)) {
@@ -234,29 +225,34 @@ var StaffDetails = z4.object({
234
225
  partnerMap: z4.record(
235
226
  CompanyUser.shape.uid,
236
227
  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
228
  ),
250
- blackList: z4.record(
229
+ updateQueue: z4.record(
251
230
  CompanyUser.shape.uid,
252
- z4.object({ addedAt: Timestamp })
231
+ z4.object({
232
+ $REMOVE: z4.object({ addedAt: Timestamp }),
233
+ $CHANGE_ROLES: z4.object({
234
+ newRoles: CompanyUser.shape.roles,
235
+ addedAt: Timestamp
236
+ })
237
+ }).partial()
253
238
  ),
254
239
  lastModified: Timestamp.nullable()
255
240
  }).transform((d) => {
256
241
  const copy = structuredClone(d);
257
- for (const uid of Object.keys(copy.blackList)) {
258
- if (uid in copy.members) continue;
259
- delete copy.blackList[uid];
242
+ for (const uid of Object.keys(copy.updateQueue)) {
243
+ if (uid in copy.members) {
244
+ const userUpdates = copy.updateQueue[uid];
245
+ if ("$REMOVE" in userUpdates) {
246
+ copy.updateQueue[uid] = { $REMOVE: userUpdates.$REMOVE };
247
+ } else if (userUpdates.$CHANGE_ROLES && userUpdates.$CHANGE_ROLES.newRoles.length === copy.members[uid].roles.length && userUpdates.$CHANGE_ROLES.newRoles.every(
248
+ (role) => copy.members[uid].roles.includes(role)
249
+ )) {
250
+ delete copy.updateQueue[uid].$CHANGE_ROLES;
251
+ }
252
+ if (Object.keys(userUpdates).length < 1) delete copy.updateQueue[uid];
253
+ } else {
254
+ delete copy.updateQueue[uid];
255
+ }
260
256
  }
261
257
  for (const [docUid, assts] of Object.entries(copy.partnerMap)) {
262
258
  if (docUid in d.members) {
@@ -290,14 +286,16 @@ var StaffDetails = z4.object({
290
286
  }
291
287
  }
292
288
  });
289
+ var Receipts = z4.array(PriceTag.omit({ uid: true, lastModified: true }));
293
290
  var createCompanyDetails = (options) => {
294
291
  return z4.object({
295
292
  uid: UuidV7,
296
- identity: IdentityDetails,
297
- state: options.partial ? StateDetails.nullish() : StateDetails,
298
- preferences: options.partial ? PreferenceDetails.nullish() : PreferenceDetails,
299
- billing: options.partial ? BillingDetails.nullish() : BillingDetails,
300
- staff: options.partial ? StaffDetails.nullish() : StaffDetails,
293
+ identity: Identity,
294
+ receipts: options.partial ? Receipts.nullish() : Receipts,
295
+ state: options.partial ? CompanyState.nullish() : CompanyState,
296
+ preferences: options.partial ? CompanyPreferences.nullish() : CompanyPreferences,
297
+ billing: options.partial ? Billing.nullish() : Billing,
298
+ staff: options.partial ? Staff.nullish() : Staff,
301
299
  createdAt: options.partial ? Timestamp.nullish() : Timestamp
302
300
  });
303
301
  };
@@ -336,14 +334,12 @@ var getCompatibleRoles = (role) => {
336
334
  };
337
335
  export {
338
336
  CompanyDetails,
339
- CompanyRegistrationClaims,
340
337
  CompanyUser,
341
338
  InvoiceNo,
342
339
  PartialCompanyDetails,
343
340
  PriceAdjustment,
344
341
  PriceTag,
345
342
  PricingRate,
346
- RegisterCompanyForm,
347
343
  StandardTime,
348
344
  TimeLog,
349
345
  Timestamp,
@@ -351,8 +347,10 @@ export {
351
347
  UuidV7,
352
348
  appointmentDistAlgs,
353
349
  companyPartnerRoles,
350
+ companyServiceSelectors,
354
351
  companyUserRoles,
355
352
  employeeRoles,
356
353
  findConflictingPartners,
357
- getCompatibleRoles
354
+ getCompatibleRoles,
355
+ healthcareProviderRoles
358
356
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.38",
3
+ "version": "0.0.40",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",