@bizmap/sdk 0.0.44 → 0.0.46

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 CHANGED
@@ -72,6 +72,15 @@ declare const CompanyDetails: z.ZodObject<{
72
72
  parish: z.ZodString;
73
73
  country: z.ZodString;
74
74
  }, z.core.$strip>;
75
+ tier: z.ZodObject<{
76
+ current: z.ZodDefault<z.ZodEnum<{
77
+ free: "free";
78
+ pro: "pro";
79
+ premium: "premium";
80
+ gold: "gold";
81
+ }>>;
82
+ lastModified: z.ZodNullable<z.ZodInt>;
83
+ }, z.core.$strip>;
75
84
  legal: z.ZodObject<{
76
85
  regNo: z.ZodReadonly<z.ZodString>;
77
86
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -111,43 +120,24 @@ declare const CompanyDetails: z.ZodObject<{
111
120
  }, z.core.$strip>>>>;
112
121
  state: z.ZodObject<{
113
122
  availableBalance: z.ZodObject<{
114
- value: z.ZodNumber;
123
+ current: z.ZodNumber;
115
124
  lastModified: z.ZodNullable<z.ZodInt>;
116
125
  }, z.core.$strip>;
117
126
  invoiceNoCounter: z.ZodInt;
118
127
  tktNoCounter: z.ZodInt;
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
128
  lastSavedAt: z.ZodNullable<z.ZodInt>;
129
129
  lastModified: z.ZodNullable<z.ZodInt>;
130
130
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
131
131
  availableBalance: z.ZodObject<{
132
- value: z.ZodNumber;
132
+ current: z.ZodNumber;
133
133
  lastModified: z.ZodNullable<z.ZodInt>;
134
134
  }, z.core.$strip>;
135
135
  invoiceNoCounter: z.ZodInt;
136
136
  tktNoCounter: z.ZodInt;
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
137
  lastSavedAt: z.ZodNullable<z.ZodInt>;
147
138
  lastModified: z.ZodNullable<z.ZodInt>;
148
139
  }, z.core.$strip>>>;
149
140
  preferences: z.ZodObject<{
150
- useCreatedServices: z.ZodBoolean;
151
141
  serviceSelector: z.ZodEnum<{
152
142
  scheduler: "scheduler";
153
143
  doctor: "doctor";
@@ -159,7 +149,6 @@ declare const CompanyDetails: z.ZodObject<{
159
149
  }>>;
160
150
  lastModified: z.ZodNullable<z.ZodInt>;
161
151
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
162
- useCreatedServices: z.ZodBoolean;
163
152
  serviceSelector: z.ZodEnum<{
164
153
  scheduler: "scheduler";
165
154
  doctor: "doctor";
@@ -186,12 +175,15 @@ declare const CompanyDetails: z.ZodObject<{
186
175
  fixedAmount: z.ZodNumber;
187
176
  percentage: z.ZodNumber;
188
177
  }, z.core.$strip>>>;
189
- services: 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>>>;
178
+ services: z.ZodObject<{
179
+ deploy: z.ZodBoolean;
180
+ value: z.ZodDefault<z.ZodArray<z.ZodObject<{
181
+ createdAt: z.ZodReadonly<z.ZodInt>;
182
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
183
+ item: z.ZodString;
184
+ cost: z.ZodNumber;
185
+ }, z.core.$strip>>>;
186
+ }, z.core.$strip>;
195
187
  lastModified: z.ZodNullable<z.ZodInt>;
196
188
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
197
189
  additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -208,12 +200,15 @@ declare const CompanyDetails: z.ZodObject<{
208
200
  fixedAmount: z.ZodNumber;
209
201
  percentage: z.ZodNumber;
210
202
  }, z.core.$strip>>>;
211
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
212
- createdAt: z.ZodReadonly<z.ZodInt>;
213
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
214
- item: z.ZodString;
215
- cost: z.ZodNumber;
216
- }, z.core.$strip>>>;
203
+ services: z.ZodObject<{
204
+ deploy: z.ZodBoolean;
205
+ value: z.ZodDefault<z.ZodArray<z.ZodObject<{
206
+ createdAt: z.ZodReadonly<z.ZodInt>;
207
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
208
+ item: z.ZodString;
209
+ cost: z.ZodNumber;
210
+ }, z.core.$strip>>>;
211
+ }, z.core.$strip>;
217
212
  lastModified: z.ZodNullable<z.ZodInt>;
218
213
  }, z.core.$strip>>>;
219
214
  staff: z.ZodPipe<z.ZodObject<{
@@ -465,6 +460,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
465
460
  parish: z.ZodString;
466
461
  country: z.ZodString;
467
462
  }, z.core.$strip>;
463
+ tier: z.ZodObject<{
464
+ current: z.ZodDefault<z.ZodEnum<{
465
+ free: "free";
466
+ pro: "pro";
467
+ premium: "premium";
468
+ gold: "gold";
469
+ }>>;
470
+ lastModified: z.ZodNullable<z.ZodInt>;
471
+ }, z.core.$strip>;
468
472
  legal: z.ZodObject<{
469
473
  regNo: z.ZodReadonly<z.ZodString>;
470
474
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -504,43 +508,24 @@ declare const PartialCompanyDetails: z.ZodObject<{
504
508
  }, z.core.$strip>>>>;
505
509
  state: z.ZodObject<{
506
510
  availableBalance: z.ZodObject<{
507
- value: z.ZodNumber;
511
+ current: z.ZodNumber;
508
512
  lastModified: z.ZodNullable<z.ZodInt>;
509
513
  }, z.core.$strip>;
510
514
  invoiceNoCounter: z.ZodInt;
511
515
  tktNoCounter: z.ZodInt;
512
- tier: z.ZodObject<{
513
- value: z.ZodDefault<z.ZodEnum<{
514
- free: "free";
515
- pro: "pro";
516
- premium: "premium";
517
- gold: "gold";
518
- }>>;
519
- lastModified: z.ZodNullable<z.ZodInt>;
520
- }, z.core.$strip>;
521
516
  lastSavedAt: z.ZodNullable<z.ZodInt>;
522
517
  lastModified: z.ZodNullable<z.ZodInt>;
523
518
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
524
519
  availableBalance: z.ZodObject<{
525
- value: z.ZodNumber;
520
+ current: z.ZodNumber;
526
521
  lastModified: z.ZodNullable<z.ZodInt>;
527
522
  }, z.core.$strip>;
528
523
  invoiceNoCounter: z.ZodInt;
529
524
  tktNoCounter: z.ZodInt;
530
- tier: z.ZodObject<{
531
- value: z.ZodDefault<z.ZodEnum<{
532
- free: "free";
533
- pro: "pro";
534
- premium: "premium";
535
- gold: "gold";
536
- }>>;
537
- lastModified: z.ZodNullable<z.ZodInt>;
538
- }, z.core.$strip>;
539
525
  lastSavedAt: z.ZodNullable<z.ZodInt>;
540
526
  lastModified: z.ZodNullable<z.ZodInt>;
541
527
  }, z.core.$strip>>>;
542
528
  preferences: z.ZodObject<{
543
- useCreatedServices: z.ZodBoolean;
544
529
  serviceSelector: z.ZodEnum<{
545
530
  scheduler: "scheduler";
546
531
  doctor: "doctor";
@@ -552,7 +537,6 @@ declare const PartialCompanyDetails: z.ZodObject<{
552
537
  }>>;
553
538
  lastModified: z.ZodNullable<z.ZodInt>;
554
539
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
555
- useCreatedServices: z.ZodBoolean;
556
540
  serviceSelector: z.ZodEnum<{
557
541
  scheduler: "scheduler";
558
542
  doctor: "doctor";
@@ -579,12 +563,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
579
563
  fixedAmount: z.ZodNumber;
580
564
  percentage: z.ZodNumber;
581
565
  }, z.core.$strip>>>;
582
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
583
- createdAt: z.ZodReadonly<z.ZodInt>;
584
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
585
- item: z.ZodString;
586
- cost: z.ZodNumber;
587
- }, z.core.$strip>>>;
566
+ services: z.ZodObject<{
567
+ deploy: z.ZodBoolean;
568
+ value: z.ZodDefault<z.ZodArray<z.ZodObject<{
569
+ createdAt: z.ZodReadonly<z.ZodInt>;
570
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
571
+ item: z.ZodString;
572
+ cost: z.ZodNumber;
573
+ }, z.core.$strip>>>;
574
+ }, z.core.$strip>;
588
575
  lastModified: z.ZodNullable<z.ZodInt>;
589
576
  }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
590
577
  additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
@@ -601,12 +588,15 @@ declare const PartialCompanyDetails: z.ZodObject<{
601
588
  fixedAmount: z.ZodNumber;
602
589
  percentage: z.ZodNumber;
603
590
  }, z.core.$strip>>>;
604
- services: z.ZodDefault<z.ZodArray<z.ZodObject<{
605
- createdAt: z.ZodReadonly<z.ZodInt>;
606
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
607
- item: z.ZodString;
608
- cost: z.ZodNumber;
609
- }, z.core.$strip>>>;
591
+ services: z.ZodObject<{
592
+ deploy: z.ZodBoolean;
593
+ value: z.ZodDefault<z.ZodArray<z.ZodObject<{
594
+ createdAt: z.ZodReadonly<z.ZodInt>;
595
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
596
+ item: z.ZodString;
597
+ cost: z.ZodNumber;
598
+ }, z.core.$strip>>>;
599
+ }, z.core.$strip>;
610
600
  lastModified: z.ZodNullable<z.ZodInt>;
611
601
  }, z.core.$strip>>>;
612
602
  staff: z.ZodPipe<z.ZodObject<{
package/dist/main.js CHANGED
@@ -124,13 +124,18 @@ var CompanyUser = z4.object({
124
124
  }
125
125
  });
126
126
  var CompanyIdentity = z4.object({
127
- displayName: z4.string().min(3).max(20),
127
+ displayName: z4.string().min(3).max(25),
128
128
  logo: z4.string().max(2500).nullish(),
129
129
  contact: z4.object({
130
130
  email: z4.email().max(25),
131
131
  phoneNumber: PhoneNumber.optional()
132
132
  }),
133
133
  address: Address,
134
+ // Can only be changed by the server
135
+ tier: z4.object({
136
+ current: tiers.default("free"),
137
+ lastModified: Timestamp.nullable()
138
+ }),
134
139
  legal: z4.object({
135
140
  regNo: z4.string().max(20).readonly(),
136
141
  // The company's registration number
@@ -142,7 +147,7 @@ var CompanyIdentity = z4.object({
142
147
  var CompanyState = z4.object({
143
148
  // This can only be changed by the server/app admin
144
149
  availableBalance: z4.object({
145
- value: z4.number(),
150
+ current: z4.number(),
146
151
  lastModified: Timestamp.nullable()
147
152
  }),
148
153
  /** A counter for the company's invoice no.
@@ -151,16 +156,10 @@ var CompanyState = z4.object({
151
156
  invoiceNoCounter: z4.int().min(1),
152
157
  /** A counter for the company's ticket no. */
153
158
  tktNoCounter: z4.int().min(1),
154
- tier: z4.object({
155
- value: tiers.default("free"),
156
- lastModified: Timestamp.nullable()
157
- }),
158
159
  lastSavedAt: Timestamp.nullable(),
159
160
  lastModified: Timestamp.nullable()
160
161
  });
161
162
  var CompanyPreferences = z4.object({
162
- /** Forces service selectors to use the list of service(s) that you've created. */
163
- useCreatedServices: z4.boolean(),
164
163
  /** The user that's allowed to record the client's services. */
165
164
  serviceSelector: companyServiceSelectors,
166
165
  /** A record of the payments made must be attached before creating the
@@ -169,15 +168,6 @@ var CompanyPreferences = z4.object({
169
168
  * - only allowed when `serviceDecider === "scheduler"`
170
169
  * */
171
170
  enforcePaidAppts: z4.boolean(),
172
- // primaryCurrency: currencies,
173
- // acceptedCurrencies: z.array(currencies).transform((currencies) => {
174
- // const newCurrencies: Currency[] = [];
175
- // for (const currency of currencies) {
176
- // if (newCurrencies.includes(currency)) continue;
177
- // newCurrencies.push(currency);
178
- // }
179
- // return newCurrencies;
180
- // }),
181
171
  /**
182
172
  * @property RR (Round Robin): Even distribution.
183
173
  * @property LOR (Least Outstanding Requests): Distribute based on availability.
@@ -186,39 +176,16 @@ var CompanyPreferences = z4.object({
186
176
  lastModified: Timestamp.nullable()
187
177
  });
188
178
  var Billing = z4.object({
189
- // preferences: z
190
- // .object({
191
- // /** Forces service selectors to use the list of service(s) that you've created. */
192
- // useCreatedServices: z.boolean(),
193
- // /** The user that's allowed to record the client's services. */
194
- // serviceSelector: companyServiceSelectors,
195
- // /** A record of the payments made must be attached before creating the
196
- // * appointment
197
- // * @note
198
- // * - only allowed when `serviceDecider === "scheduler"`
199
- // * */
200
- // enforcePaidAppts: z.boolean(),
201
- // primaryCurrency: currencies,
202
- // acceptedCurrencies: z.array(currencies).transform((currencies) => {
203
- // const newCurrencies: Currency[] = [];
204
- // for (const currency of currencies) {
205
- // if (newCurrencies.includes(currency)) continue;
206
- // newCurrencies.push(currency);
207
- // }
208
- // return newCurrencies;
209
- // }),
210
- // lastModified: Timestamp.nullable(),
211
- // })
212
- // .superRefine((data, ctx) => {
213
- // if (data.enforcePaidAppts && data.serviceSelector !== "scheduler") {
214
- // ctx.addIssue(
215
- // "serviceDecider must be scheduler when enforcePaidAppts is true.",
216
- // );
217
- // }
218
- // }),
219
179
  additionalFees: z4.array(PriceAdjustment).default([]),
220
180
  discounts: z4.array(PriceAdjustment).default([]),
221
- services: z4.array(PriceTag.omit({ uid: true })).max(100).default([]),
181
+ services: z4.object({
182
+ /** Forces service selectors to use the list of service(s) that you've created. */
183
+ deploy: z4.boolean(),
184
+ value: z4.array(PriceTag.omit({ uid: true })).max(100).default([])
185
+ }).refine(
186
+ (data) => !data.deploy || data.deploy && data.value.length > 0,
187
+ "You must create at least (1) service in order to deploy your service list."
188
+ ),
222
189
  lastModified: Timestamp.nullable()
223
190
  });
224
191
  var Staff = z4.object({
@@ -323,12 +290,6 @@ var createCompanyDetails = (options) => {
323
290
  billing: options.partial ? Billing.nullish() : Billing,
324
291
  staff: options.partial ? Staff.nullish() : Staff,
325
292
  createdAt: options.partial ? Timestamp.nullish() : Timestamp
326
- }).superRefine((data, ctx) => {
327
- if (data.billing && data.preferences && data.preferences?.useCreatedServices && (data.billing?.services.length || 0) < 1) {
328
- ctx.addIssue(
329
- "You must create At least (1) service in order to select the useCreatedServices option."
330
- );
331
- }
332
293
  });
333
294
  };
334
295
  var CompanyDetails = createCompanyDetails({ partial: false });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.44",
3
+ "version": "0.0.46",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",