@bizmap/sdk 0.0.52 → 0.0.53

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 +227 -74
  2. package/dist/main.js +85 -52
  3. package/package.json +3 -2
package/dist/main.d.ts CHANGED
@@ -44,19 +44,20 @@ declare const tiers: z.ZodEnum<{
44
44
  }>;
45
45
  type Tier = z.infer<typeof tiers>;
46
46
 
47
- declare const PricingRate: z.ZodObject<{
48
- companyRegistration: z.ZodObject<{
49
- flatFee: z.ZodNumber;
50
- feePerUser: z.ZodNumber;
51
- lastModified: z.ZodInt;
52
- }, z.core.$strip>;
53
- }, z.core.$strip>;
54
- type PricingRate = z.infer<typeof PricingRate>;
55
47
  declare const PriceAdjustment: z.ZodObject<{
56
48
  createdAt: z.ZodReadonly<z.ZodInt>;
57
49
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
58
50
  description: z.ZodOptional<z.ZodString>;
59
- fixedAmount: z.ZodNumber;
51
+ fixedAmount: z.ZodObject<{
52
+ value: z.ZodNumber;
53
+ currency: z.ZodEnum<{
54
+ JMD: "JMD";
55
+ USD: "USD";
56
+ EUR: "EUR";
57
+ GBP: "GBP";
58
+ CAD: "CAD";
59
+ }>;
60
+ }, z.core.$strip>;
60
61
  percentage: z.ZodNumber;
61
62
  }, z.core.$strip>;
62
63
  type PriceAdjustment = z.infer<typeof PriceAdjustment>;
@@ -66,6 +67,13 @@ declare const PriceTag: z.ZodObject<{
66
67
  uid: z.ZodReadonly<z.ZodString>;
67
68
  item: z.ZodString;
68
69
  cost: z.ZodNumber;
70
+ currency: z.ZodEnum<{
71
+ JMD: "JMD";
72
+ USD: "USD";
73
+ EUR: "EUR";
74
+ GBP: "GBP";
75
+ CAD: "CAD";
76
+ }>;
69
77
  }, z.core.$strip>;
70
78
  type PriceTag = z.infer<typeof PriceTag>;
71
79
 
@@ -91,9 +99,9 @@ declare const CompanyUser: z.ZodObject<{
91
99
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
92
100
  isBusy: z.ZodBoolean;
93
101
  appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
94
- lastActive: z.ZodInt;
95
- inviteSent: z.ZodInt;
96
- inviteAccepted: z.ZodInt;
102
+ lastActive: z.ZodNullable<z.ZodInt>;
103
+ inviteSent: z.ZodNullable<z.ZodInt>;
104
+ inviteAccepted: z.ZodNullable<z.ZodInt>;
97
105
  name: z.ZodRecord<z.ZodEnum<{
98
106
  first: "first";
99
107
  last: "last";
@@ -106,12 +114,13 @@ type CompanyUser = z.infer<typeof CompanyUser>;
106
114
  /** (email) -> user config */
107
115
  declare const CompanyInviteList: z.ZodRecord<z.ZodEmail, z.ZodObject<{
108
116
  createdAt: z.ZodInt;
109
- roles: z.ZodArray<z.ZodEnum<{
117
+ roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
110
118
  doc: "doc";
111
119
  physAsst: "physAsst";
112
120
  rcpst: "rcpst";
113
121
  cshr: "cshr";
114
- }>>;
122
+ admin: "admin";
123
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
115
124
  }, z.core.$strip>>;
116
125
  type CompanyInviteList = z.infer<typeof CompanyInviteList>;
117
126
  declare const CompanyDetails: z.ZodObject<{
@@ -168,27 +177,49 @@ declare const CompanyDetails: z.ZodObject<{
168
177
  }, z.core.$strip>>>>;
169
178
  receipts: z.ZodArray<z.ZodObject<{
170
179
  createdAt: z.ZodReadonly<z.ZodInt>;
180
+ currency: z.ZodEnum<{
181
+ JMD: "JMD";
182
+ USD: "USD";
183
+ EUR: "EUR";
184
+ GBP: "GBP";
185
+ CAD: "CAD";
186
+ }>;
171
187
  item: z.ZodString;
172
188
  cost: z.ZodNumber;
173
189
  }, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
174
190
  createdAt: z.ZodReadonly<z.ZodInt>;
191
+ currency: z.ZodEnum<{
192
+ JMD: "JMD";
193
+ USD: "USD";
194
+ EUR: "EUR";
195
+ GBP: "GBP";
196
+ CAD: "CAD";
197
+ }>;
175
198
  item: z.ZodString;
176
199
  cost: z.ZodNumber;
177
200
  }, z.core.$strip>>>>;
178
201
  state: z.ZodObject<{
179
- availableBalance: z.ZodObject<{
202
+ credits: z.ZodObject<{
180
203
  current: z.ZodNumber;
181
204
  lastModified: z.ZodNullable<z.ZodInt>;
182
205
  }, z.core.$strip>;
206
+ storageInBytes: z.ZodRecord<z.ZodLiteral<"used" | "max">, z.ZodObject<{
207
+ current: z.ZodNumber;
208
+ lastModified: z.ZodNullable<z.ZodInt>;
209
+ }, z.core.$strip>>;
183
210
  invoiceNoCounter: z.ZodInt;
184
211
  tktNoCounter: z.ZodInt;
185
212
  lastSavedAt: z.ZodNullable<z.ZodInt>;
186
213
  lastModified: z.ZodNullable<z.ZodInt>;
187
214
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
188
- availableBalance: z.ZodObject<{
215
+ credits: z.ZodObject<{
189
216
  current: z.ZodNumber;
190
217
  lastModified: z.ZodNullable<z.ZodInt>;
191
218
  }, z.core.$strip>;
219
+ storageInBytes: z.ZodRecord<z.ZodLiteral<"used" | "max">, z.ZodObject<{
220
+ current: z.ZodNumber;
221
+ lastModified: z.ZodNullable<z.ZodInt>;
222
+ }, z.core.$strip>>;
192
223
  invoiceNoCounter: z.ZodInt;
193
224
  tktNoCounter: z.ZodInt;
194
225
  lastSavedAt: z.ZodNullable<z.ZodInt>;
@@ -222,24 +253,49 @@ declare const CompanyDetails: z.ZodObject<{
222
253
  createdAt: z.ZodReadonly<z.ZodInt>;
223
254
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
224
255
  description: z.ZodOptional<z.ZodString>;
225
- fixedAmount: z.ZodNumber;
256
+ fixedAmount: z.ZodObject<{
257
+ value: z.ZodNumber;
258
+ currency: z.ZodEnum<{
259
+ JMD: "JMD";
260
+ USD: "USD";
261
+ EUR: "EUR";
262
+ GBP: "GBP";
263
+ CAD: "CAD";
264
+ }>;
265
+ }, z.core.$strip>;
226
266
  percentage: z.ZodNumber;
227
267
  }, z.core.$strip>>>;
228
268
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
229
269
  createdAt: z.ZodReadonly<z.ZodInt>;
230
270
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
231
271
  description: z.ZodOptional<z.ZodString>;
232
- fixedAmount: z.ZodNumber;
272
+ fixedAmount: z.ZodObject<{
273
+ value: z.ZodNumber;
274
+ currency: z.ZodEnum<{
275
+ JMD: "JMD";
276
+ USD: "USD";
277
+ EUR: "EUR";
278
+ GBP: "GBP";
279
+ CAD: "CAD";
280
+ }>;
281
+ }, z.core.$strip>;
233
282
  percentage: z.ZodNumber;
234
283
  }, z.core.$strip>>>;
235
284
  services: z.ZodObject<{
236
285
  deployed: z.ZodBoolean;
237
- value: z.ZodDefault<z.ZodArray<z.ZodObject<{
286
+ value: z.ZodRecord<z.ZodString, z.ZodObject<{
238
287
  createdAt: z.ZodReadonly<z.ZodInt>;
239
288
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
289
+ currency: z.ZodEnum<{
290
+ JMD: "JMD";
291
+ USD: "USD";
292
+ EUR: "EUR";
293
+ GBP: "GBP";
294
+ CAD: "CAD";
295
+ }>;
240
296
  item: z.ZodString;
241
297
  cost: z.ZodNumber;
242
- }, z.core.$strip>>>;
298
+ }, z.core.$strip>>;
243
299
  }, z.core.$strip>;
244
300
  lastModified: z.ZodNullable<z.ZodInt>;
245
301
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -247,24 +303,49 @@ declare const CompanyDetails: z.ZodObject<{
247
303
  createdAt: z.ZodReadonly<z.ZodInt>;
248
304
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
249
305
  description: z.ZodOptional<z.ZodString>;
250
- fixedAmount: z.ZodNumber;
306
+ fixedAmount: z.ZodObject<{
307
+ value: z.ZodNumber;
308
+ currency: z.ZodEnum<{
309
+ JMD: "JMD";
310
+ USD: "USD";
311
+ EUR: "EUR";
312
+ GBP: "GBP";
313
+ CAD: "CAD";
314
+ }>;
315
+ }, z.core.$strip>;
251
316
  percentage: z.ZodNumber;
252
317
  }, z.core.$strip>>>;
253
318
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
254
319
  createdAt: z.ZodReadonly<z.ZodInt>;
255
320
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
256
321
  description: z.ZodOptional<z.ZodString>;
257
- fixedAmount: z.ZodNumber;
322
+ fixedAmount: z.ZodObject<{
323
+ value: z.ZodNumber;
324
+ currency: z.ZodEnum<{
325
+ JMD: "JMD";
326
+ USD: "USD";
327
+ EUR: "EUR";
328
+ GBP: "GBP";
329
+ CAD: "CAD";
330
+ }>;
331
+ }, z.core.$strip>;
258
332
  percentage: z.ZodNumber;
259
333
  }, z.core.$strip>>>;
260
334
  services: z.ZodObject<{
261
335
  deployed: z.ZodBoolean;
262
- value: z.ZodDefault<z.ZodArray<z.ZodObject<{
336
+ value: z.ZodRecord<z.ZodString, z.ZodObject<{
263
337
  createdAt: z.ZodReadonly<z.ZodInt>;
264
338
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
339
+ currency: z.ZodEnum<{
340
+ JMD: "JMD";
341
+ USD: "USD";
342
+ EUR: "EUR";
343
+ GBP: "GBP";
344
+ CAD: "CAD";
345
+ }>;
265
346
  item: z.ZodString;
266
347
  cost: z.ZodNumber;
267
- }, z.core.$strip>>>;
348
+ }, z.core.$strip>>;
268
349
  }, z.core.$strip>;
269
350
  lastModified: z.ZodNullable<z.ZodInt>;
270
351
  }, z.core.$strip>>>;
@@ -291,9 +372,9 @@ declare const CompanyDetails: z.ZodObject<{
291
372
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
292
373
  isBusy: z.ZodBoolean;
293
374
  appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
294
- lastActive: z.ZodInt;
295
- inviteSent: z.ZodInt;
296
- inviteAccepted: z.ZodInt;
375
+ lastActive: z.ZodNullable<z.ZodInt>;
376
+ inviteSent: z.ZodNullable<z.ZodInt>;
377
+ inviteAccepted: z.ZodNullable<z.ZodInt>;
297
378
  name: z.ZodRecord<z.ZodEnum<{
298
379
  first: "first";
299
380
  last: "last";
@@ -333,9 +414,9 @@ declare const CompanyDetails: z.ZodObject<{
333
414
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
334
415
  isBusy: boolean;
335
416
  appointmentCounter: Record<"ongoing" | "completed", number>;
336
- lastActive: number;
337
- inviteSent: number;
338
- inviteAccepted: number;
417
+ lastActive: number | null;
418
+ inviteSent: number | null;
419
+ inviteAccepted: number | null;
339
420
  name: Record<"first" | "last", string>;
340
421
  email: string;
341
422
  lastModified?: number | null | undefined;
@@ -367,9 +448,9 @@ declare const CompanyDetails: z.ZodObject<{
367
448
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
368
449
  isBusy: boolean;
369
450
  appointmentCounter: Record<"ongoing" | "completed", number>;
370
- lastActive: number;
371
- inviteSent: number;
372
- inviteAccepted: number;
451
+ lastActive: number | null;
452
+ inviteSent: number | null;
453
+ inviteAccepted: number | null;
373
454
  name: Record<"first" | "last", string>;
374
455
  email: string;
375
456
  lastModified?: number | null | undefined;
@@ -412,9 +493,9 @@ declare const CompanyDetails: z.ZodObject<{
412
493
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
413
494
  isBusy: z.ZodBoolean;
414
495
  appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
415
- lastActive: z.ZodInt;
416
- inviteSent: z.ZodInt;
417
- inviteAccepted: z.ZodInt;
496
+ lastActive: z.ZodNullable<z.ZodInt>;
497
+ inviteSent: z.ZodNullable<z.ZodInt>;
498
+ inviteAccepted: z.ZodNullable<z.ZodInt>;
418
499
  name: z.ZodRecord<z.ZodEnum<{
419
500
  first: "first";
420
501
  last: "last";
@@ -454,9 +535,9 @@ declare const CompanyDetails: z.ZodObject<{
454
535
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
455
536
  isBusy: boolean;
456
537
  appointmentCounter: Record<"ongoing" | "completed", number>;
457
- lastActive: number;
458
- inviteSent: number;
459
- inviteAccepted: number;
538
+ lastActive: number | null;
539
+ inviteSent: number | null;
540
+ inviteAccepted: number | null;
460
541
  name: Record<"first" | "last", string>;
461
542
  email: string;
462
543
  lastModified?: number | null | undefined;
@@ -488,9 +569,9 @@ declare const CompanyDetails: z.ZodObject<{
488
569
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
489
570
  isBusy: boolean;
490
571
  appointmentCounter: Record<"ongoing" | "completed", number>;
491
- lastActive: number;
492
- inviteSent: number;
493
- inviteAccepted: number;
572
+ lastActive: number | null;
573
+ inviteSent: number | null;
574
+ inviteAccepted: number | null;
494
575
  name: Record<"first" | "last", string>;
495
576
  email: string;
496
577
  lastModified?: number | null | undefined;
@@ -568,27 +649,49 @@ declare const PartialCompanyDetails: z.ZodObject<{
568
649
  }, z.core.$strip>>>>;
569
650
  receipts: z.ZodArray<z.ZodObject<{
570
651
  createdAt: z.ZodReadonly<z.ZodInt>;
652
+ currency: z.ZodEnum<{
653
+ JMD: "JMD";
654
+ USD: "USD";
655
+ EUR: "EUR";
656
+ GBP: "GBP";
657
+ CAD: "CAD";
658
+ }>;
571
659
  item: z.ZodString;
572
660
  cost: z.ZodNumber;
573
661
  }, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
574
662
  createdAt: z.ZodReadonly<z.ZodInt>;
663
+ currency: z.ZodEnum<{
664
+ JMD: "JMD";
665
+ USD: "USD";
666
+ EUR: "EUR";
667
+ GBP: "GBP";
668
+ CAD: "CAD";
669
+ }>;
575
670
  item: z.ZodString;
576
671
  cost: z.ZodNumber;
577
672
  }, z.core.$strip>>>>;
578
673
  state: z.ZodObject<{
579
- availableBalance: z.ZodObject<{
674
+ credits: z.ZodObject<{
580
675
  current: z.ZodNumber;
581
676
  lastModified: z.ZodNullable<z.ZodInt>;
582
677
  }, z.core.$strip>;
678
+ storageInBytes: z.ZodRecord<z.ZodLiteral<"used" | "max">, z.ZodObject<{
679
+ current: z.ZodNumber;
680
+ lastModified: z.ZodNullable<z.ZodInt>;
681
+ }, z.core.$strip>>;
583
682
  invoiceNoCounter: z.ZodInt;
584
683
  tktNoCounter: z.ZodInt;
585
684
  lastSavedAt: z.ZodNullable<z.ZodInt>;
586
685
  lastModified: z.ZodNullable<z.ZodInt>;
587
686
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
588
- availableBalance: z.ZodObject<{
687
+ credits: z.ZodObject<{
589
688
  current: z.ZodNumber;
590
689
  lastModified: z.ZodNullable<z.ZodInt>;
591
690
  }, z.core.$strip>;
691
+ storageInBytes: z.ZodRecord<z.ZodLiteral<"used" | "max">, z.ZodObject<{
692
+ current: z.ZodNumber;
693
+ lastModified: z.ZodNullable<z.ZodInt>;
694
+ }, z.core.$strip>>;
592
695
  invoiceNoCounter: z.ZodInt;
593
696
  tktNoCounter: z.ZodInt;
594
697
  lastSavedAt: z.ZodNullable<z.ZodInt>;
@@ -622,24 +725,49 @@ declare const PartialCompanyDetails: z.ZodObject<{
622
725
  createdAt: z.ZodReadonly<z.ZodInt>;
623
726
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
624
727
  description: z.ZodOptional<z.ZodString>;
625
- fixedAmount: z.ZodNumber;
728
+ fixedAmount: z.ZodObject<{
729
+ value: z.ZodNumber;
730
+ currency: z.ZodEnum<{
731
+ JMD: "JMD";
732
+ USD: "USD";
733
+ EUR: "EUR";
734
+ GBP: "GBP";
735
+ CAD: "CAD";
736
+ }>;
737
+ }, z.core.$strip>;
626
738
  percentage: z.ZodNumber;
627
739
  }, z.core.$strip>>>;
628
740
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
629
741
  createdAt: z.ZodReadonly<z.ZodInt>;
630
742
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
631
743
  description: z.ZodOptional<z.ZodString>;
632
- fixedAmount: z.ZodNumber;
744
+ fixedAmount: z.ZodObject<{
745
+ value: z.ZodNumber;
746
+ currency: z.ZodEnum<{
747
+ JMD: "JMD";
748
+ USD: "USD";
749
+ EUR: "EUR";
750
+ GBP: "GBP";
751
+ CAD: "CAD";
752
+ }>;
753
+ }, z.core.$strip>;
633
754
  percentage: z.ZodNumber;
634
755
  }, z.core.$strip>>>;
635
756
  services: z.ZodObject<{
636
757
  deployed: z.ZodBoolean;
637
- value: z.ZodDefault<z.ZodArray<z.ZodObject<{
758
+ value: z.ZodRecord<z.ZodString, z.ZodObject<{
638
759
  createdAt: z.ZodReadonly<z.ZodInt>;
639
760
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
761
+ currency: z.ZodEnum<{
762
+ JMD: "JMD";
763
+ USD: "USD";
764
+ EUR: "EUR";
765
+ GBP: "GBP";
766
+ CAD: "CAD";
767
+ }>;
640
768
  item: z.ZodString;
641
769
  cost: z.ZodNumber;
642
- }, z.core.$strip>>>;
770
+ }, z.core.$strip>>;
643
771
  }, z.core.$strip>;
644
772
  lastModified: z.ZodNullable<z.ZodInt>;
645
773
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -647,24 +775,49 @@ declare const PartialCompanyDetails: z.ZodObject<{
647
775
  createdAt: z.ZodReadonly<z.ZodInt>;
648
776
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
649
777
  description: z.ZodOptional<z.ZodString>;
650
- fixedAmount: z.ZodNumber;
778
+ fixedAmount: z.ZodObject<{
779
+ value: z.ZodNumber;
780
+ currency: z.ZodEnum<{
781
+ JMD: "JMD";
782
+ USD: "USD";
783
+ EUR: "EUR";
784
+ GBP: "GBP";
785
+ CAD: "CAD";
786
+ }>;
787
+ }, z.core.$strip>;
651
788
  percentage: z.ZodNumber;
652
789
  }, z.core.$strip>>>;
653
790
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
654
791
  createdAt: z.ZodReadonly<z.ZodInt>;
655
792
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
656
793
  description: z.ZodOptional<z.ZodString>;
657
- fixedAmount: z.ZodNumber;
794
+ fixedAmount: z.ZodObject<{
795
+ value: z.ZodNumber;
796
+ currency: z.ZodEnum<{
797
+ JMD: "JMD";
798
+ USD: "USD";
799
+ EUR: "EUR";
800
+ GBP: "GBP";
801
+ CAD: "CAD";
802
+ }>;
803
+ }, z.core.$strip>;
658
804
  percentage: z.ZodNumber;
659
805
  }, z.core.$strip>>>;
660
806
  services: z.ZodObject<{
661
807
  deployed: z.ZodBoolean;
662
- value: z.ZodDefault<z.ZodArray<z.ZodObject<{
808
+ value: z.ZodRecord<z.ZodString, z.ZodObject<{
663
809
  createdAt: z.ZodReadonly<z.ZodInt>;
664
810
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
811
+ currency: z.ZodEnum<{
812
+ JMD: "JMD";
813
+ USD: "USD";
814
+ EUR: "EUR";
815
+ GBP: "GBP";
816
+ CAD: "CAD";
817
+ }>;
665
818
  item: z.ZodString;
666
819
  cost: z.ZodNumber;
667
- }, z.core.$strip>>>;
820
+ }, z.core.$strip>>;
668
821
  }, z.core.$strip>;
669
822
  lastModified: z.ZodNullable<z.ZodInt>;
670
823
  }, z.core.$strip>>>;
@@ -691,9 +844,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
691
844
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
692
845
  isBusy: z.ZodBoolean;
693
846
  appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
694
- lastActive: z.ZodInt;
695
- inviteSent: z.ZodInt;
696
- inviteAccepted: z.ZodInt;
847
+ lastActive: z.ZodNullable<z.ZodInt>;
848
+ inviteSent: z.ZodNullable<z.ZodInt>;
849
+ inviteAccepted: z.ZodNullable<z.ZodInt>;
697
850
  name: z.ZodRecord<z.ZodEnum<{
698
851
  first: "first";
699
852
  last: "last";
@@ -733,9 +886,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
733
886
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
734
887
  isBusy: boolean;
735
888
  appointmentCounter: Record<"ongoing" | "completed", number>;
736
- lastActive: number;
737
- inviteSent: number;
738
- inviteAccepted: number;
889
+ lastActive: number | null;
890
+ inviteSent: number | null;
891
+ inviteAccepted: number | null;
739
892
  name: Record<"first" | "last", string>;
740
893
  email: string;
741
894
  lastModified?: number | null | undefined;
@@ -767,9 +920,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
767
920
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
768
921
  isBusy: boolean;
769
922
  appointmentCounter: Record<"ongoing" | "completed", number>;
770
- lastActive: number;
771
- inviteSent: number;
772
- inviteAccepted: number;
923
+ lastActive: number | null;
924
+ inviteSent: number | null;
925
+ inviteAccepted: number | null;
773
926
  name: Record<"first" | "last", string>;
774
927
  email: string;
775
928
  lastModified?: number | null | undefined;
@@ -812,9 +965,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
812
965
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
813
966
  isBusy: z.ZodBoolean;
814
967
  appointmentCounter: z.ZodRecord<z.ZodLiteral<"ongoing" | "completed">, z.ZodInt>;
815
- lastActive: z.ZodInt;
816
- inviteSent: z.ZodInt;
817
- inviteAccepted: z.ZodInt;
968
+ lastActive: z.ZodNullable<z.ZodInt>;
969
+ inviteSent: z.ZodNullable<z.ZodInt>;
970
+ inviteAccepted: z.ZodNullable<z.ZodInt>;
818
971
  name: z.ZodRecord<z.ZodEnum<{
819
972
  first: "first";
820
973
  last: "last";
@@ -854,9 +1007,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
854
1007
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
855
1008
  isBusy: boolean;
856
1009
  appointmentCounter: Record<"ongoing" | "completed", number>;
857
- lastActive: number;
858
- inviteSent: number;
859
- inviteAccepted: number;
1010
+ lastActive: number | null;
1011
+ inviteSent: number | null;
1012
+ inviteAccepted: number | null;
860
1013
  name: Record<"first" | "last", string>;
861
1014
  email: string;
862
1015
  lastModified?: number | null | undefined;
@@ -888,9 +1041,9 @@ declare const PartialCompanyDetails: z.ZodObject<{
888
1041
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
889
1042
  isBusy: boolean;
890
1043
  appointmentCounter: Record<"ongoing" | "completed", number>;
891
- lastActive: number;
892
- inviteSent: number;
893
- inviteAccepted: number;
1044
+ lastActive: number | null;
1045
+ inviteSent: number | null;
1046
+ inviteAccepted: number | null;
894
1047
  name: Record<"first" | "last", string>;
895
1048
  email: string;
896
1049
  lastModified?: number | null | undefined;
@@ -967,9 +1120,9 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
967
1120
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
968
1121
  isBusy: boolean;
969
1122
  appointmentCounter: Record<"ongoing" | "completed", number>;
970
- lastActive: number;
971
- inviteSent: number;
972
- inviteAccepted: number;
1123
+ lastActive: number | null;
1124
+ inviteSent: number | null;
1125
+ inviteAccepted: number | null;
973
1126
  name: Record<"first" | "last", string>;
974
1127
  email: string;
975
1128
  lastModified?: number | null | undefined;
@@ -979,4 +1132,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
979
1132
  /**@returns the roles that are compatible with the selected role. */
980
1133
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
981
1134
 
982
- export { type AppointmentDistAlg, CompanyDetails, CompanyInviteList, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, Jwt, Notification, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, StandardTime, type Tier, TierList, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles, tiers };
1135
+ export { type AppointmentDistAlg, CompanyDetails, CompanyInviteList, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, Jwt, Notification, PartialCompanyDetails, PriceAdjustment, PriceTag, StandardTime, type Tier, TierList, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles, tiers };
package/dist/main.js CHANGED
@@ -24,6 +24,7 @@ import * as z2 from "zod";
24
24
  var tiers = z2.enum(["free", "pro", "premium", "gold"]);
25
25
 
26
26
  // src/schemas/Billing.ts
27
+ import { currencies } from "@wavy/util";
27
28
  import * as z4 from "zod";
28
29
 
29
30
  // src/schemas/utils.ts
@@ -60,16 +61,12 @@ var TimeLog = z3.object({
60
61
  });
61
62
 
62
63
  // src/schemas/Billing.ts
63
- var PricingRate = z4.object({
64
- companyRegistration: z4.object({
65
- flatFee: z4.number().min(0),
66
- feePerUser: z4.number().min(0),
67
- lastModified: Timestamp
68
- })
69
- });
70
64
  var PriceAdjustment = z4.object({
71
65
  description: z4.string().trim().min(3, "A description must have atleast (3) characters.").max(25, "A description can't have more that (25) characters.").optional(),
72
- fixedAmount: z4.number().min(0).max(1e6, "The max fixed amount is $1,000,000.00"),
66
+ fixedAmount: z4.object({
67
+ value: z4.number().min(0).max(1e6, "The max fixed amount is $1,000,000.00"),
68
+ currency: currencies
69
+ }),
73
70
  percentage: z4.number().min(0).max(1e3, "The max percentage is 1,000%"),
74
71
  ...TimeLog.shape
75
72
  });
@@ -78,6 +75,7 @@ var PriceTag = z4.object({
78
75
  /**The name of the item that's being priced */
79
76
  item: z4.string().trim().min(3, "The price item must be atleast (3) characters long.").max(50, "The price item can't be more than (50) characters long."),
80
77
  cost: z4.number().min(1, "The minimum allowed cost is $1.00").max(1e9, "The max allowed cost is $1,000,000,000.00."),
78
+ currency: currencies,
81
79
  ...TimeLog.shape
82
80
  });
83
81
 
@@ -85,6 +83,37 @@ var PriceTag = z4.object({
85
83
  import { Address, PhoneNumber, UserModel } from "@wavy/util";
86
84
  import * as z6 from "zod";
87
85
 
86
+ // src/functions/helper-functions.ts
87
+ var findConflictingPartners = (...partners) => {
88
+ let hasSingleDoctor = false;
89
+ const conflicts = [];
90
+ if (!partners) return partners;
91
+ for (const partner of partners) {
92
+ if (!partner.roles || partner.roles.some(
93
+ (r) => !companyPartnerRoles.options.includes(r)
94
+ ) || !CompanyUser.shape.roles.safeParse(partner.roles).success) {
95
+ conflicts.push(partner);
96
+ continue;
97
+ }
98
+ if (partner.roles.includes("doc") && !hasSingleDoctor) {
99
+ hasSingleDoctor = true;
100
+ } else if (partner.roles.includes("doc")) {
101
+ conflicts.push(partner);
102
+ continue;
103
+ }
104
+ }
105
+ return conflicts.length === 0 ? null : conflicts;
106
+ };
107
+ var getCompatibleRoles = (role) => {
108
+ if (role === "physAsst") {
109
+ return companyUserRoles.exclude(["admin", "doc", role]).options;
110
+ }
111
+ if (role === "admin" || role === "doc") {
112
+ return companyUserRoles.exclude(["physAsst", role]).options;
113
+ }
114
+ return companyUserRoles.exclude([role]).options;
115
+ };
116
+
88
117
  // src/schemas/Global.ts
89
118
  import * as z5 from "zod";
90
119
  var TierList = z5.record(
@@ -143,37 +172,6 @@ var Notification = z5.object({
143
172
  }
144
173
  });
145
174
 
146
- // src/functions/helper-functions.ts
147
- var findConflictingPartners = (...partners) => {
148
- let hasSingleDoctor = false;
149
- const conflicts = [];
150
- if (!partners) return partners;
151
- for (const partner of partners) {
152
- if (!partner.roles || partner.roles.some(
153
- (r) => !companyPartnerRoles.options.includes(r)
154
- ) || !CompanyUser.shape.roles.safeParse(partner.roles).success) {
155
- conflicts.push(partner);
156
- continue;
157
- }
158
- if (partner.roles.includes("doc") && !hasSingleDoctor) {
159
- hasSingleDoctor = true;
160
- } else if (partner.roles.includes("doc")) {
161
- conflicts.push(partner);
162
- continue;
163
- }
164
- }
165
- return conflicts.length === 0 ? null : conflicts;
166
- };
167
- var getCompatibleRoles = (role) => {
168
- if (role === "physAsst") {
169
- return companyUserRoles.exclude(["admin", "doc", role]).options;
170
- }
171
- if (role === "admin" || role === "doc") {
172
- return companyUserRoles.exclude(["physAsst", role]).options;
173
- }
174
- return companyUserRoles.exclude([role]).options;
175
- };
176
-
177
175
  // src/schemas/Company.ts
178
176
  var CompanyUser = z6.object({
179
177
  ...UserModel.shape,
@@ -200,9 +198,9 @@ var CompanyUser = z6.object({
200
198
  z6.literal(["ongoing", "completed"]),
201
199
  z6.int().min(0)
202
200
  ),
203
- lastActive: Timestamp,
204
- inviteSent: Timestamp,
205
- inviteAccepted: Timestamp,
201
+ lastActive: Timestamp.nullable(),
202
+ inviteSent: Timestamp.nullable(),
203
+ inviteAccepted: Timestamp.nullable(),
206
204
  ...TimeLog.shape
207
205
  }).superRefine((data, ctx) => {
208
206
  if (!data.availability.isAvailable && data.status !== "active") {
@@ -213,10 +211,18 @@ var CompanyUser = z6.object({
213
211
  'Only users with the "doc" or "physAsst" role can be marked as unavailable.'
214
212
  );
215
213
  }
214
+ if (data.status === "inviteSent" && !data.inviteSent) {
215
+ ctx.addIssue(
216
+ 'A user with the status "inviteSent" must also have a timestamp for the time that the invite was sent.'
217
+ );
218
+ }
216
219
  });
217
220
  var CompanyInviteList = z6.record(
218
221
  CompanyUser.shape.email,
219
- z6.object({ createdAt: Timestamp, roles: z6.array(employeeRoles) })
222
+ z6.object({ createdAt: Timestamp, roles: CompanyUser.shape.roles })
223
+ ).refine(
224
+ (data) => Object.keys(data).length > 0,
225
+ "Insufficient amount of members invited."
220
226
  );
221
227
  var CompanyIdentity = z6.object({
222
228
  displayName: z6.string().min(3).max(25),
@@ -240,11 +246,20 @@ var CompanyIdentity = z6.object({
240
246
  lastModified: Timestamp.nullable()
241
247
  });
242
248
  var CompanyState = z6.object({
243
- // This can only be changed by the server/app admin
244
- availableBalance: z6.object({
249
+ credits: z6.object({
245
250
  current: z6.number(),
246
251
  lastModified: Timestamp.nullable()
247
252
  }),
253
+ storageInBytes: z6.record(
254
+ z6.literal(["used", "max"]),
255
+ z6.object({
256
+ current: z6.number(),
257
+ lastModified: Timestamp.nullable()
258
+ })
259
+ ).refine(
260
+ (data) => data.used.current <= data.max.current,
261
+ "The total storage used cannot exceed the max allowed storage."
262
+ ),
248
263
  /** A counter for the company's invoice no.
249
264
  * @note This should only be null when the cycle resets
250
265
  */
@@ -269,18 +284,37 @@ var CompanyPreferences = z6.object({
269
284
  */
270
285
  apptDistAlg: appointmentDistAlgs.default("RR"),
271
286
  lastModified: Timestamp.nullable()
272
- });
287
+ }).refine(
288
+ (data) => !data.enforcePaidAppts || data.enforcePaidAppts && data.serviceSelector === "scheduler",
289
+ 'Enforcing paid appointments is only allowed when the service selector is the "scheduler".'
290
+ );
273
291
  var Billing = z6.object({
274
292
  additionalFees: z6.array(PriceAdjustment).default([]),
275
293
  discounts: z6.array(PriceAdjustment).default([]),
276
294
  services: z6.object({
277
295
  /** Forces service selectors to use the list of service(s) that you've created. */
278
296
  deployed: z6.boolean(),
279
- value: z6.array(PriceTag.omit({ uid: true })).max(100).default([])
280
- }).refine(
281
- (data) => !data.deployed || data.deployed && data.value.length > 0,
282
- "You must create at least (1) service in order to deploy your service list."
283
- ),
297
+ value: z6.record(z6.string(), PriceTag.omit({ uid: true }))
298
+ }).superRefine((data, ctx) => {
299
+ const services = Object.entries(data.value);
300
+ if (services.length > 150) {
301
+ ctx.addIssue(
302
+ "Creating more services than the max allowed services (150) is prohibited."
303
+ );
304
+ }
305
+ if (data.deployed && services.length < 1) {
306
+ ctx.addIssue(
307
+ "You must create at least (1) service in order to deploy your service list."
308
+ );
309
+ }
310
+ for (const [key, value] of services) {
311
+ if (key !== value.createdAt.toString()) {
312
+ ctx.addIssue(
313
+ `The key for every service must be the same its correlating "createdAt" timestamp.`
314
+ );
315
+ }
316
+ }
317
+ }),
284
318
  lastModified: Timestamp.nullable()
285
319
  });
286
320
  var Staff = z6.object({
@@ -404,7 +438,6 @@ export {
404
438
  PartialCompanyDetails,
405
439
  PriceAdjustment,
406
440
  PriceTag,
407
- PricingRate,
408
441
  StandardTime,
409
442
  TierList,
410
443
  TimeLog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",
@@ -16,11 +16,12 @@
16
16
  "author": "",
17
17
  "license": "MIT",
18
18
  "peerDependencies": {
19
+ "@wavy/util": "^0.0.11",
19
20
  "zod": "^4.2.1"
20
21
  },
21
22
  "description": "",
22
23
  "devDependencies": {
23
- "@wavy/util": "^0.0.9",
24
+ "@wavy/util": "^0.0.11",
24
25
  "tsup": "^8.5.0",
25
26
  "typescript": "^5.9.2",
26
27
  "zod": "^4.2.1"