@bizmap/sdk 0.0.43 → 0.0.45
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 +163 -101
- package/dist/main.js +34 -49
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -79,6 +79,27 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
79
79
|
}, z.core.$strip>;
|
|
80
80
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
81
81
|
}, z.core.$strip>;
|
|
82
|
+
notifications: z.ZodArray<z.ZodObject<{
|
|
83
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
84
|
+
payload: z.ZodString;
|
|
85
|
+
seen: z.ZodBoolean;
|
|
86
|
+
src: z.ZodObject<{
|
|
87
|
+
name: z.ZodString;
|
|
88
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
89
|
+
}, z.core.$strip>;
|
|
90
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
91
|
+
createdAt: z.ZodInt;
|
|
92
|
+
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
93
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
94
|
+
payload: z.ZodString;
|
|
95
|
+
seen: z.ZodBoolean;
|
|
96
|
+
src: z.ZodObject<{
|
|
97
|
+
name: z.ZodString;
|
|
98
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
101
|
+
createdAt: z.ZodInt;
|
|
102
|
+
}, z.core.$strip>>>>;
|
|
82
103
|
receipts: z.ZodArray<z.ZodObject<{
|
|
83
104
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
84
105
|
item: z.ZodString;
|
|
@@ -89,29 +110,59 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
89
110
|
cost: z.ZodNumber;
|
|
90
111
|
}, z.core.$strip>>>>;
|
|
91
112
|
state: z.ZodObject<{
|
|
92
|
-
availableBalance: z.
|
|
93
|
-
|
|
113
|
+
availableBalance: z.ZodObject<{
|
|
114
|
+
value: z.ZodNumber;
|
|
115
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
116
|
+
}, z.core.$strip>;
|
|
94
117
|
invoiceNoCounter: z.ZodInt;
|
|
95
118
|
tktNoCounter: z.ZodInt;
|
|
96
|
-
|
|
119
|
+
tier: z.ZodObject<{
|
|
120
|
+
value: z.ZodDefault<z.ZodEnum<{
|
|
121
|
+
free: "free";
|
|
122
|
+
pro: "pro";
|
|
123
|
+
premium: "premium";
|
|
124
|
+
gold: "gold";
|
|
125
|
+
}>>;
|
|
126
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
97
129
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
98
130
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
99
|
-
availableBalance: z.
|
|
100
|
-
|
|
131
|
+
availableBalance: z.ZodObject<{
|
|
132
|
+
value: z.ZodNumber;
|
|
133
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
134
|
+
}, z.core.$strip>;
|
|
101
135
|
invoiceNoCounter: z.ZodInt;
|
|
102
136
|
tktNoCounter: z.ZodInt;
|
|
103
|
-
|
|
137
|
+
tier: z.ZodObject<{
|
|
138
|
+
value: z.ZodDefault<z.ZodEnum<{
|
|
139
|
+
free: "free";
|
|
140
|
+
pro: "pro";
|
|
141
|
+
premium: "premium";
|
|
142
|
+
gold: "gold";
|
|
143
|
+
}>>;
|
|
144
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
145
|
+
}, z.core.$strip>;
|
|
146
|
+
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
104
147
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
105
148
|
}, z.core.$strip>>>;
|
|
106
149
|
preferences: z.ZodObject<{
|
|
107
|
-
|
|
150
|
+
serviceSelector: z.ZodEnum<{
|
|
151
|
+
scheduler: "scheduler";
|
|
152
|
+
doctor: "doctor";
|
|
153
|
+
}>;
|
|
154
|
+
enforcePaidAppts: z.ZodBoolean;
|
|
108
155
|
apptDistAlg: z.ZodDefault<z.ZodEnum<{
|
|
109
156
|
RR: "RR";
|
|
110
157
|
LOR: "LOR";
|
|
111
158
|
}>>;
|
|
112
159
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
113
160
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
114
|
-
|
|
161
|
+
serviceSelector: z.ZodEnum<{
|
|
162
|
+
scheduler: "scheduler";
|
|
163
|
+
doctor: "doctor";
|
|
164
|
+
}>;
|
|
165
|
+
enforcePaidAppts: z.ZodBoolean;
|
|
115
166
|
apptDistAlg: z.ZodDefault<z.ZodEnum<{
|
|
116
167
|
RR: "RR";
|
|
117
168
|
LOR: "LOR";
|
|
@@ -119,21 +170,6 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
119
170
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
120
171
|
}, z.core.$strip>>>;
|
|
121
172
|
billing: z.ZodObject<{
|
|
122
|
-
preferences: z.ZodObject<{
|
|
123
|
-
useCreatedServices: z.ZodBoolean;
|
|
124
|
-
serviceSelector: z.ZodEnum<{
|
|
125
|
-
scheduler: "scheduler";
|
|
126
|
-
doctor: "doctor";
|
|
127
|
-
}>;
|
|
128
|
-
enforcePaidAppts: z.ZodBoolean;
|
|
129
|
-
primaryCurrency: z.ZodEnum<{
|
|
130
|
-
JMD: "JMD";
|
|
131
|
-
}>;
|
|
132
|
-
acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
133
|
-
JMD: "JMD";
|
|
134
|
-
}>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
|
|
135
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
136
|
-
}, z.core.$strip>;
|
|
137
173
|
additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
138
174
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
139
175
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -148,29 +184,17 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
148
184
|
fixedAmount: z.ZodNumber;
|
|
149
185
|
percentage: z.ZodNumber;
|
|
150
186
|
}, z.core.$strip>>>;
|
|
151
|
-
services: z.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
187
|
+
services: z.ZodObject<{
|
|
188
|
+
deploy: z.ZodBoolean;
|
|
189
|
+
value: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
190
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
191
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
192
|
+
item: z.ZodString;
|
|
193
|
+
cost: z.ZodNumber;
|
|
194
|
+
}, z.core.$strip>>>;
|
|
195
|
+
}, z.core.$strip>;
|
|
157
196
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
158
197
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
159
|
-
preferences: z.ZodObject<{
|
|
160
|
-
useCreatedServices: z.ZodBoolean;
|
|
161
|
-
serviceSelector: z.ZodEnum<{
|
|
162
|
-
scheduler: "scheduler";
|
|
163
|
-
doctor: "doctor";
|
|
164
|
-
}>;
|
|
165
|
-
enforcePaidAppts: z.ZodBoolean;
|
|
166
|
-
primaryCurrency: z.ZodEnum<{
|
|
167
|
-
JMD: "JMD";
|
|
168
|
-
}>;
|
|
169
|
-
acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
170
|
-
JMD: "JMD";
|
|
171
|
-
}>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
|
|
172
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
173
|
-
}, z.core.$strip>;
|
|
174
198
|
additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
175
199
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
176
200
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -185,12 +209,15 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
185
209
|
fixedAmount: z.ZodNumber;
|
|
186
210
|
percentage: z.ZodNumber;
|
|
187
211
|
}, z.core.$strip>>>;
|
|
188
|
-
services: z.
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
212
|
+
services: z.ZodObject<{
|
|
213
|
+
deploy: z.ZodBoolean;
|
|
214
|
+
value: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
215
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
216
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
217
|
+
item: z.ZodString;
|
|
218
|
+
cost: z.ZodNumber;
|
|
219
|
+
}, z.core.$strip>>>;
|
|
220
|
+
}, z.core.$strip>;
|
|
194
221
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
195
222
|
}, z.core.$strip>>>;
|
|
196
223
|
staff: z.ZodPipe<z.ZodObject<{
|
|
@@ -449,6 +476,27 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
449
476
|
}, z.core.$strip>;
|
|
450
477
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
451
478
|
}, z.core.$strip>;
|
|
479
|
+
notifications: z.ZodArray<z.ZodObject<{
|
|
480
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
481
|
+
payload: z.ZodString;
|
|
482
|
+
seen: z.ZodBoolean;
|
|
483
|
+
src: z.ZodObject<{
|
|
484
|
+
name: z.ZodString;
|
|
485
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
486
|
+
}, z.core.$strip>;
|
|
487
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
488
|
+
createdAt: z.ZodInt;
|
|
489
|
+
}, z.core.$strip>> | z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
490
|
+
code: z.ZodLiteral<"COMPANY_INVITE" | "INVITE_RESPONSE" | "DEV_MESSAGE">;
|
|
491
|
+
payload: z.ZodString;
|
|
492
|
+
seen: z.ZodBoolean;
|
|
493
|
+
src: z.ZodObject<{
|
|
494
|
+
name: z.ZodString;
|
|
495
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
496
|
+
}, z.core.$strip>;
|
|
497
|
+
expiresAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
498
|
+
createdAt: z.ZodInt;
|
|
499
|
+
}, z.core.$strip>>>>;
|
|
452
500
|
receipts: z.ZodArray<z.ZodObject<{
|
|
453
501
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
454
502
|
item: z.ZodString;
|
|
@@ -459,29 +507,59 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
459
507
|
cost: z.ZodNumber;
|
|
460
508
|
}, z.core.$strip>>>>;
|
|
461
509
|
state: z.ZodObject<{
|
|
462
|
-
availableBalance: z.
|
|
463
|
-
|
|
510
|
+
availableBalance: z.ZodObject<{
|
|
511
|
+
value: z.ZodNumber;
|
|
512
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
513
|
+
}, z.core.$strip>;
|
|
464
514
|
invoiceNoCounter: z.ZodInt;
|
|
465
515
|
tktNoCounter: z.ZodInt;
|
|
466
|
-
|
|
516
|
+
tier: z.ZodObject<{
|
|
517
|
+
value: z.ZodDefault<z.ZodEnum<{
|
|
518
|
+
free: "free";
|
|
519
|
+
pro: "pro";
|
|
520
|
+
premium: "premium";
|
|
521
|
+
gold: "gold";
|
|
522
|
+
}>>;
|
|
523
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
524
|
+
}, z.core.$strip>;
|
|
525
|
+
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
467
526
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
468
527
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
469
|
-
availableBalance: z.
|
|
470
|
-
|
|
528
|
+
availableBalance: z.ZodObject<{
|
|
529
|
+
value: z.ZodNumber;
|
|
530
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
531
|
+
}, z.core.$strip>;
|
|
471
532
|
invoiceNoCounter: z.ZodInt;
|
|
472
533
|
tktNoCounter: z.ZodInt;
|
|
473
|
-
|
|
534
|
+
tier: z.ZodObject<{
|
|
535
|
+
value: z.ZodDefault<z.ZodEnum<{
|
|
536
|
+
free: "free";
|
|
537
|
+
pro: "pro";
|
|
538
|
+
premium: "premium";
|
|
539
|
+
gold: "gold";
|
|
540
|
+
}>>;
|
|
541
|
+
lastModified: z.ZodNullable<z.ZodInt>;
|
|
542
|
+
}, z.core.$strip>;
|
|
543
|
+
lastSavedAt: z.ZodNullable<z.ZodInt>;
|
|
474
544
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
475
545
|
}, z.core.$strip>>>;
|
|
476
546
|
preferences: z.ZodObject<{
|
|
477
|
-
|
|
547
|
+
serviceSelector: z.ZodEnum<{
|
|
548
|
+
scheduler: "scheduler";
|
|
549
|
+
doctor: "doctor";
|
|
550
|
+
}>;
|
|
551
|
+
enforcePaidAppts: z.ZodBoolean;
|
|
478
552
|
apptDistAlg: z.ZodDefault<z.ZodEnum<{
|
|
479
553
|
RR: "RR";
|
|
480
554
|
LOR: "LOR";
|
|
481
555
|
}>>;
|
|
482
556
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
483
557
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
484
|
-
|
|
558
|
+
serviceSelector: z.ZodEnum<{
|
|
559
|
+
scheduler: "scheduler";
|
|
560
|
+
doctor: "doctor";
|
|
561
|
+
}>;
|
|
562
|
+
enforcePaidAppts: z.ZodBoolean;
|
|
485
563
|
apptDistAlg: z.ZodDefault<z.ZodEnum<{
|
|
486
564
|
RR: "RR";
|
|
487
565
|
LOR: "LOR";
|
|
@@ -489,21 +567,6 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
489
567
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
490
568
|
}, z.core.$strip>>>;
|
|
491
569
|
billing: z.ZodObject<{
|
|
492
|
-
preferences: z.ZodObject<{
|
|
493
|
-
useCreatedServices: z.ZodBoolean;
|
|
494
|
-
serviceSelector: z.ZodEnum<{
|
|
495
|
-
scheduler: "scheduler";
|
|
496
|
-
doctor: "doctor";
|
|
497
|
-
}>;
|
|
498
|
-
enforcePaidAppts: z.ZodBoolean;
|
|
499
|
-
primaryCurrency: z.ZodEnum<{
|
|
500
|
-
JMD: "JMD";
|
|
501
|
-
}>;
|
|
502
|
-
acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
503
|
-
JMD: "JMD";
|
|
504
|
-
}>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
|
|
505
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
506
|
-
}, z.core.$strip>;
|
|
507
570
|
additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
508
571
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
509
572
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -518,29 +581,17 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
518
581
|
fixedAmount: z.ZodNumber;
|
|
519
582
|
percentage: z.ZodNumber;
|
|
520
583
|
}, z.core.$strip>>>;
|
|
521
|
-
services: z.
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
584
|
+
services: z.ZodObject<{
|
|
585
|
+
deploy: z.ZodBoolean;
|
|
586
|
+
value: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
587
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
588
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
589
|
+
item: z.ZodString;
|
|
590
|
+
cost: z.ZodNumber;
|
|
591
|
+
}, z.core.$strip>>>;
|
|
592
|
+
}, z.core.$strip>;
|
|
527
593
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
528
594
|
}, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
529
|
-
preferences: z.ZodObject<{
|
|
530
|
-
useCreatedServices: z.ZodBoolean;
|
|
531
|
-
serviceSelector: z.ZodEnum<{
|
|
532
|
-
scheduler: "scheduler";
|
|
533
|
-
doctor: "doctor";
|
|
534
|
-
}>;
|
|
535
|
-
enforcePaidAppts: z.ZodBoolean;
|
|
536
|
-
primaryCurrency: z.ZodEnum<{
|
|
537
|
-
JMD: "JMD";
|
|
538
|
-
}>;
|
|
539
|
-
acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
540
|
-
JMD: "JMD";
|
|
541
|
-
}>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
|
|
542
|
-
lastModified: z.ZodNullable<z.ZodInt>;
|
|
543
|
-
}, z.core.$strip>;
|
|
544
595
|
additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
545
596
|
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
546
597
|
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
@@ -555,12 +606,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
|
|
|
555
606
|
fixedAmount: z.ZodNumber;
|
|
556
607
|
percentage: z.ZodNumber;
|
|
557
608
|
}, z.core.$strip>>>;
|
|
558
|
-
services: z.
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
609
|
+
services: z.ZodObject<{
|
|
610
|
+
deploy: z.ZodBoolean;
|
|
611
|
+
value: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
612
|
+
createdAt: z.ZodReadonly<z.ZodInt>;
|
|
613
|
+
lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
614
|
+
item: z.ZodString;
|
|
615
|
+
cost: z.ZodNumber;
|
|
616
|
+
}, z.core.$strip>>>;
|
|
617
|
+
}, z.core.$strip>;
|
|
564
618
|
lastModified: z.ZodNullable<z.ZodInt>;
|
|
565
619
|
}, z.core.$strip>>>;
|
|
566
620
|
staff: z.ZodPipe<z.ZodObject<{
|
|
@@ -874,6 +928,14 @@ declare const companyServiceSelectors: z.ZodEnum<{
|
|
|
874
928
|
}>;
|
|
875
929
|
type CompanyServiceSelector = z.infer<typeof companyServiceSelectors>;
|
|
876
930
|
|
|
931
|
+
declare const tiers: z.ZodEnum<{
|
|
932
|
+
free: "free";
|
|
933
|
+
pro: "pro";
|
|
934
|
+
premium: "premium";
|
|
935
|
+
gold: "gold";
|
|
936
|
+
}>;
|
|
937
|
+
type Tier = z.infer<typeof tiers>;
|
|
938
|
+
|
|
877
939
|
/**@returns an array of the users that have conflicting roles or are incompatible with the other partners, or null if none was found. */
|
|
878
940
|
declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
879
941
|
createdAt: number;
|
|
@@ -896,4 +958,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
|
|
|
896
958
|
/**@returns the roles that are compatible with the selected role. */
|
|
897
959
|
declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
|
|
898
960
|
|
|
899
|
-
export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, type CompanyServiceSelector, CompanyUser, type CompanyUserRole, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, Jwt, Notification, PartialCompanyDetails, PriceAdjustment, PriceTag, PricingRate, StandardTime, TierList, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles, healthcareProviderRoles };
|
|
961
|
+
export { type AppointmentDistAlg, CompanyDetails, 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 };
|
package/dist/main.js
CHANGED
|
@@ -59,7 +59,6 @@ var PriceTag = z2.object({
|
|
|
59
59
|
// src/schemas/Company.ts
|
|
60
60
|
import {
|
|
61
61
|
Address,
|
|
62
|
-
currencies,
|
|
63
62
|
PhoneNumber,
|
|
64
63
|
UserModel
|
|
65
64
|
} from "@wavy/util";
|
|
@@ -142,27 +141,32 @@ var CompanyIdentity = z4.object({
|
|
|
142
141
|
});
|
|
143
142
|
var CompanyState = z4.object({
|
|
144
143
|
// This can only be changed by the server/app admin
|
|
145
|
-
availableBalance: z4.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
*/
|
|
150
|
-
totalUploads: z4.number(),
|
|
144
|
+
availableBalance: z4.object({
|
|
145
|
+
value: z4.number(),
|
|
146
|
+
lastModified: Timestamp.nullable()
|
|
147
|
+
}),
|
|
151
148
|
/** A counter for the company's invoice no.
|
|
152
149
|
* @note This should only be null when the cycle resets
|
|
153
150
|
*/
|
|
154
151
|
invoiceNoCounter: z4.int().min(1),
|
|
155
152
|
/** A counter for the company's ticket no. */
|
|
156
153
|
tktNoCounter: z4.int().min(1),
|
|
157
|
-
|
|
154
|
+
tier: z4.object({
|
|
155
|
+
value: tiers.default("free"),
|
|
156
|
+
lastModified: Timestamp.nullable()
|
|
157
|
+
}),
|
|
158
|
+
lastSavedAt: Timestamp.nullable(),
|
|
158
159
|
lastModified: Timestamp.nullable()
|
|
159
160
|
});
|
|
160
161
|
var CompanyPreferences = z4.object({
|
|
161
|
-
/** The
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
/** The user that's allowed to record the client's services. */
|
|
163
|
+
serviceSelector: companyServiceSelectors,
|
|
164
|
+
/** A record of the payments made must be attached before creating the
|
|
165
|
+
* appointment
|
|
166
|
+
* @note
|
|
167
|
+
* - only allowed when `serviceDecider === "scheduler"`
|
|
168
|
+
* */
|
|
169
|
+
enforcePaidAppts: z4.boolean(),
|
|
166
170
|
/**
|
|
167
171
|
* @property RR (Round Robin): Even distribution.
|
|
168
172
|
* @property LOR (Least Outstanding Requests): Distribute based on availability.
|
|
@@ -171,43 +175,17 @@ var CompanyPreferences = z4.object({
|
|
|
171
175
|
lastModified: Timestamp.nullable()
|
|
172
176
|
});
|
|
173
177
|
var Billing = z4.object({
|
|
174
|
-
preferences: z4.object({
|
|
175
|
-
/** Forces service selectors to use the list of service(s) that you've created. */
|
|
176
|
-
useCreatedServices: z4.boolean(),
|
|
177
|
-
/** The user that's allowed to record the client's services. */
|
|
178
|
-
serviceSelector: companyServiceSelectors,
|
|
179
|
-
/** A record of the payments made must be attached before creating the
|
|
180
|
-
* appointment
|
|
181
|
-
* @note
|
|
182
|
-
* - only allowed when `serviceDecider === "scheduler"`
|
|
183
|
-
* */
|
|
184
|
-
enforcePaidAppts: z4.boolean(),
|
|
185
|
-
primaryCurrency: currencies,
|
|
186
|
-
acceptedCurrencies: z4.array(currencies).transform((currencies2) => {
|
|
187
|
-
const newCurrencies = [];
|
|
188
|
-
for (const currency of currencies2) {
|
|
189
|
-
if (newCurrencies.includes(currency)) continue;
|
|
190
|
-
newCurrencies.push(currency);
|
|
191
|
-
}
|
|
192
|
-
return newCurrencies;
|
|
193
|
-
}),
|
|
194
|
-
lastModified: Timestamp.nullable()
|
|
195
|
-
}).superRefine((data, ctx) => {
|
|
196
|
-
if (data.enforcePaidAppts && data.serviceSelector !== "scheduler") {
|
|
197
|
-
ctx.addIssue(
|
|
198
|
-
"serviceDecider must be scheduler when enforcePaidAppts is true."
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
}),
|
|
202
178
|
additionalFees: z4.array(PriceAdjustment).default([]),
|
|
203
179
|
discounts: z4.array(PriceAdjustment).default([]),
|
|
204
|
-
services: z4.
|
|
180
|
+
services: z4.object({
|
|
181
|
+
/** Forces service selectors to use the list of service(s) that you've created. */
|
|
182
|
+
deploy: z4.boolean(),
|
|
183
|
+
value: z4.array(PriceTag.omit({ uid: true })).max(100).default([])
|
|
184
|
+
}).refine(
|
|
185
|
+
(data) => !data.deploy || data.deploy && data.value.length > 0,
|
|
186
|
+
"You must create at least (1) service in order to deploy your service list."
|
|
187
|
+
),
|
|
205
188
|
lastModified: Timestamp.nullable()
|
|
206
|
-
}).superRefine((billing, ctx) => {
|
|
207
|
-
const totalServices = billing?.services?.length ?? 0;
|
|
208
|
-
if (billing?.preferences?.useCreatedServices && totalServices < 1) {
|
|
209
|
-
ctx.addIssue("At least (1) service must be added to the services list.");
|
|
210
|
-
}
|
|
211
189
|
});
|
|
212
190
|
var Staff = z4.object({
|
|
213
191
|
members: z4.record(CompanyUser.shape.uid, CompanyUser).superRefine((data, ctx) => {
|
|
@@ -304,6 +282,7 @@ var createCompanyDetails = (options) => {
|
|
|
304
282
|
return z4.object({
|
|
305
283
|
uid: UuidV7,
|
|
306
284
|
identity: CompanyIdentity,
|
|
285
|
+
notifications: options.partial ? z4.array(Notification).nullish() : z4.array(Notification),
|
|
307
286
|
receipts: options.partial ? Receipts.nullish() : Receipts,
|
|
308
287
|
state: options.partial ? CompanyState.nullish() : CompanyState,
|
|
309
288
|
preferences: options.partial ? CompanyPreferences.nullish() : CompanyPreferences,
|
|
@@ -317,8 +296,9 @@ var PartialCompanyDetails = createCompanyDetails({ partial: true });
|
|
|
317
296
|
|
|
318
297
|
// src/schemas/Global.ts
|
|
319
298
|
import * as z5 from "zod";
|
|
299
|
+
import { tiers as tiers2 } from "src/main";
|
|
320
300
|
var TierList = z5.record(
|
|
321
|
-
|
|
301
|
+
tiers2,
|
|
322
302
|
z5.object({
|
|
323
303
|
cost: z5.number().min(0),
|
|
324
304
|
perks: z5.array(z5.string()).min(1)
|
|
@@ -362,6 +342,10 @@ var Notification = z5.object({
|
|
|
362
342
|
}
|
|
363
343
|
});
|
|
364
344
|
|
|
345
|
+
// src/enums/Global.ts
|
|
346
|
+
import * as z6 from "zod";
|
|
347
|
+
var tiers = z6.enum(["free", "pro", "premium", "gold"]);
|
|
348
|
+
|
|
365
349
|
// src/functions/helper-functions.ts
|
|
366
350
|
var findConflictingPartners = (...partners) => {
|
|
367
351
|
let hasSingleDoctor = false;
|
|
@@ -416,5 +400,6 @@ export {
|
|
|
416
400
|
employeeRoles,
|
|
417
401
|
findConflictingPartners,
|
|
418
402
|
getCompatibleRoles,
|
|
419
|
-
healthcareProviderRoles
|
|
403
|
+
healthcareProviderRoles,
|
|
404
|
+
tiers
|
|
420
405
|
};
|