@bizmap/sdk 0.0.29 → 0.0.31

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
@@ -120,12 +120,259 @@ declare const CompanyUser: z.ZodObject<{
120
120
  type CompanyUser = z.infer<typeof CompanyUser>;
121
121
  declare const CompanyDetails: z.ZodObject<{
122
122
  uid: z.ZodReadonly<z.ZodString>;
123
+ identity: z.ZodObject<{
124
+ displayName: z.ZodString;
125
+ logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
126
+ contact: z.ZodObject<{
127
+ email: z.ZodEmail;
128
+ phoneNumber: z.ZodOptional<z.ZodString>;
129
+ }, z.core.$strip>;
130
+ address: z.ZodObject<{
131
+ streetAddress: z.ZodString;
132
+ city: z.ZodOptional<z.ZodString>;
133
+ parish: z.ZodString;
134
+ country: z.ZodString;
135
+ }, z.core.$strip>;
136
+ legal: z.ZodObject<{
137
+ regNo: z.ZodReadonly<z.ZodString>;
138
+ trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
139
+ gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
140
+ }, z.core.$strip>;
141
+ lastModified: z.ZodNullable<z.ZodInt>;
142
+ }, z.core.$strip>;
123
143
  state: z.ZodObject<{
124
144
  availableBalance: z.ZodNumber;
125
- invoiceNoRef: z.ZodNullable<z.ZodString>;
126
145
  totalUploads: z.ZodNumber;
146
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
147
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
127
148
  lastModified: z.ZodNullable<z.ZodInt>;
128
- }, z.core.$strip>;
149
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
150
+ availableBalance: z.ZodNumber;
151
+ totalUploads: z.ZodNumber;
152
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
153
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
154
+ lastModified: z.ZodNullable<z.ZodInt>;
155
+ }, z.core.$strip>>>;
156
+ preferences: z.ZodObject<{
157
+ userProvisions: z.ZodNumber;
158
+ apptDistAlg: z.ZodDefault<z.ZodEnum<{
159
+ RR: "RR";
160
+ LOR: "LOR";
161
+ }>>;
162
+ lastModified: z.ZodNullable<z.ZodInt>;
163
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
164
+ userProvisions: z.ZodNumber;
165
+ apptDistAlg: z.ZodDefault<z.ZodEnum<{
166
+ RR: "RR";
167
+ LOR: "LOR";
168
+ }>>;
169
+ lastModified: z.ZodNullable<z.ZodInt>;
170
+ }, z.core.$strip>>>;
171
+ billing: z.ZodObject<{
172
+ preferences: z.ZodObject<{
173
+ allowInvoiceDist: z.ZodBoolean;
174
+ useCreatedServices: z.ZodBoolean;
175
+ serviceSelector: z.ZodEnum<{
176
+ scheduler: "scheduler";
177
+ doctor: "doctor";
178
+ }>;
179
+ enforcePaidAppts: z.ZodBoolean;
180
+ primaryCurrency: z.ZodEnum<{
181
+ JMD: "JMD";
182
+ }>;
183
+ acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
184
+ JMD: "JMD";
185
+ }>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
186
+ lastModified: z.ZodNullable<z.ZodInt>;
187
+ }, z.core.$strip>;
188
+ additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
189
+ createdAt: z.ZodReadonly<z.ZodInt>;
190
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
191
+ description: z.ZodOptional<z.ZodString>;
192
+ fixedAmount: z.ZodNumber;
193
+ percentage: z.ZodNumber;
194
+ }, z.core.$strip>>>;
195
+ discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
196
+ createdAt: z.ZodReadonly<z.ZodInt>;
197
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
198
+ description: z.ZodOptional<z.ZodString>;
199
+ fixedAmount: z.ZodNumber;
200
+ percentage: z.ZodNumber;
201
+ }, z.core.$strip>>>;
202
+ services: z.ZodDefault<z.ZodArray<z.ZodObject<{
203
+ createdAt: z.ZodReadonly<z.ZodInt>;
204
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
205
+ item: z.ZodString;
206
+ cost: z.ZodNumber;
207
+ }, z.core.$strip>>>;
208
+ lastModified: z.ZodNullable<z.ZodInt>;
209
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
210
+ preferences: z.ZodObject<{
211
+ allowInvoiceDist: z.ZodBoolean;
212
+ useCreatedServices: z.ZodBoolean;
213
+ serviceSelector: z.ZodEnum<{
214
+ scheduler: "scheduler";
215
+ doctor: "doctor";
216
+ }>;
217
+ enforcePaidAppts: z.ZodBoolean;
218
+ primaryCurrency: z.ZodEnum<{
219
+ JMD: "JMD";
220
+ }>;
221
+ acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
222
+ JMD: "JMD";
223
+ }>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
224
+ lastModified: z.ZodNullable<z.ZodInt>;
225
+ }, z.core.$strip>;
226
+ additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
227
+ createdAt: z.ZodReadonly<z.ZodInt>;
228
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
229
+ description: z.ZodOptional<z.ZodString>;
230
+ fixedAmount: z.ZodNumber;
231
+ percentage: z.ZodNumber;
232
+ }, z.core.$strip>>>;
233
+ discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
234
+ createdAt: z.ZodReadonly<z.ZodInt>;
235
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
236
+ description: z.ZodOptional<z.ZodString>;
237
+ fixedAmount: z.ZodNumber;
238
+ percentage: z.ZodNumber;
239
+ }, z.core.$strip>>>;
240
+ services: z.ZodDefault<z.ZodArray<z.ZodObject<{
241
+ createdAt: z.ZodReadonly<z.ZodInt>;
242
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
243
+ item: z.ZodString;
244
+ cost: z.ZodNumber;
245
+ }, z.core.$strip>>>;
246
+ lastModified: z.ZodNullable<z.ZodInt>;
247
+ }, z.core.$strip>>>;
248
+ staffDetails: z.ZodPipe<z.ZodObject<{
249
+ members: z.ZodArray<z.ZodObject<{
250
+ createdAt: z.ZodReadonly<z.ZodInt>;
251
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
252
+ uid: z.ZodReadonly<z.ZodString>;
253
+ status: z.ZodEnum<{
254
+ inviteSent: "inviteSent";
255
+ active: "active";
256
+ inactive: "inactive";
257
+ }>;
258
+ roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
259
+ doc: "doc";
260
+ physAsst: "physAsst";
261
+ rcpst: "rcpst";
262
+ cshr: "cshr";
263
+ admin: "admin";
264
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
265
+ lastActive: z.ZodInt;
266
+ name: z.ZodRecord<z.ZodEnum<{
267
+ first: "first";
268
+ last: "last";
269
+ }>, z.ZodString>;
270
+ photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ email: z.ZodEmail;
272
+ phoneNumber: z.ZodOptional<z.ZodString>;
273
+ }, z.core.$strip>>;
274
+ partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
275
+ blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
276
+ lastModified: z.ZodNullable<z.ZodInt>;
277
+ }, z.core.$strip>, z.ZodTransform<{
278
+ members: {
279
+ createdAt: number;
280
+ uid: string;
281
+ status: "inviteSent" | "active" | "inactive";
282
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
283
+ lastActive: number;
284
+ name: Record<"first" | "last", string>;
285
+ email: string;
286
+ lastModified?: number | null | undefined;
287
+ photoUrl?: string | null | undefined;
288
+ phoneNumber?: string | undefined;
289
+ }[];
290
+ partnerMap: Record<string, string[]>;
291
+ blackList: string[];
292
+ lastModified: number | null;
293
+ }, {
294
+ members: {
295
+ createdAt: number;
296
+ uid: string;
297
+ status: "inviteSent" | "active" | "inactive";
298
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
299
+ lastActive: number;
300
+ name: Record<"first" | "last", string>;
301
+ email: string;
302
+ lastModified?: number | null | undefined;
303
+ photoUrl?: string | null | undefined;
304
+ phoneNumber?: string | undefined;
305
+ }[];
306
+ partnerMap: Record<string, string[]>;
307
+ blackList: string[];
308
+ lastModified: number | null;
309
+ }>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
310
+ members: z.ZodArray<z.ZodObject<{
311
+ createdAt: z.ZodReadonly<z.ZodInt>;
312
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
313
+ uid: z.ZodReadonly<z.ZodString>;
314
+ status: z.ZodEnum<{
315
+ inviteSent: "inviteSent";
316
+ active: "active";
317
+ inactive: "inactive";
318
+ }>;
319
+ roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
320
+ doc: "doc";
321
+ physAsst: "physAsst";
322
+ rcpst: "rcpst";
323
+ cshr: "cshr";
324
+ admin: "admin";
325
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
326
+ lastActive: z.ZodInt;
327
+ name: z.ZodRecord<z.ZodEnum<{
328
+ first: "first";
329
+ last: "last";
330
+ }>, z.ZodString>;
331
+ photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
+ email: z.ZodEmail;
333
+ phoneNumber: z.ZodOptional<z.ZodString>;
334
+ }, z.core.$strip>>;
335
+ partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
336
+ blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
337
+ lastModified: z.ZodNullable<z.ZodInt>;
338
+ }, z.core.$strip>, z.ZodTransform<{
339
+ members: {
340
+ createdAt: number;
341
+ uid: string;
342
+ status: "inviteSent" | "active" | "inactive";
343
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
344
+ lastActive: number;
345
+ name: Record<"first" | "last", string>;
346
+ email: string;
347
+ lastModified?: number | null | undefined;
348
+ photoUrl?: string | null | undefined;
349
+ phoneNumber?: string | undefined;
350
+ }[];
351
+ partnerMap: Record<string, string[]>;
352
+ blackList: string[];
353
+ lastModified: number | null;
354
+ }, {
355
+ members: {
356
+ createdAt: number;
357
+ uid: string;
358
+ status: "inviteSent" | "active" | "inactive";
359
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
360
+ lastActive: number;
361
+ name: Record<"first" | "last", string>;
362
+ email: string;
363
+ lastModified?: number | null | undefined;
364
+ photoUrl?: string | null | undefined;
365
+ phoneNumber?: string | undefined;
366
+ }[];
367
+ partnerMap: Record<string, string[]>;
368
+ blackList: string[];
369
+ lastModified: number | null;
370
+ }>>>>;
371
+ createdAt: z.ZodInt | z.ZodOptional<z.ZodNullable<z.ZodInt>>;
372
+ }, z.core.$strip>;
373
+ type CompanyDetails = z.infer<typeof CompanyDetails>;
374
+ declare const PartialCompanyDetails: z.ZodObject<{
375
+ uid: z.ZodReadonly<z.ZodString>;
129
376
  identity: z.ZodObject<{
130
377
  displayName: z.ZodString;
131
378
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -146,6 +393,19 @@ declare const CompanyDetails: z.ZodObject<{
146
393
  }, z.core.$strip>;
147
394
  lastModified: z.ZodNullable<z.ZodInt>;
148
395
  }, z.core.$strip>;
396
+ state: z.ZodObject<{
397
+ availableBalance: z.ZodNumber;
398
+ totalUploads: z.ZodNumber;
399
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
400
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
401
+ lastModified: z.ZodNullable<z.ZodInt>;
402
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
403
+ availableBalance: z.ZodNumber;
404
+ totalUploads: z.ZodNumber;
405
+ lastInvoiceNo: z.ZodNullable<z.ZodString>;
406
+ lastTktNo: z.ZodNullable<z.ZodNumber>;
407
+ lastModified: z.ZodNullable<z.ZodInt>;
408
+ }, z.core.$strip>>>;
149
409
  preferences: z.ZodObject<{
150
410
  userProvisions: z.ZodNumber;
151
411
  apptDistAlg: z.ZodDefault<z.ZodEnum<{
@@ -153,7 +413,14 @@ declare const CompanyDetails: z.ZodObject<{
153
413
  LOR: "LOR";
154
414
  }>>;
155
415
  lastModified: z.ZodNullable<z.ZodInt>;
156
- }, z.core.$strip>;
416
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
417
+ userProvisions: z.ZodNumber;
418
+ apptDistAlg: z.ZodDefault<z.ZodEnum<{
419
+ RR: "RR";
420
+ LOR: "LOR";
421
+ }>>;
422
+ lastModified: z.ZodNullable<z.ZodInt>;
423
+ }, z.core.$strip>>>;
157
424
  billing: z.ZodObject<{
158
425
  preferences: z.ZodObject<{
159
426
  allowInvoiceDist: z.ZodBoolean;
@@ -192,7 +459,45 @@ declare const CompanyDetails: z.ZodObject<{
192
459
  cost: z.ZodNumber;
193
460
  }, z.core.$strip>>>;
194
461
  lastModified: z.ZodNullable<z.ZodInt>;
195
- }, z.core.$strip>;
462
+ }, z.core.$strip> | z.ZodOptional<z.ZodNullable<z.ZodObject<{
463
+ preferences: z.ZodObject<{
464
+ allowInvoiceDist: z.ZodBoolean;
465
+ useCreatedServices: z.ZodBoolean;
466
+ serviceSelector: z.ZodEnum<{
467
+ scheduler: "scheduler";
468
+ doctor: "doctor";
469
+ }>;
470
+ enforcePaidAppts: z.ZodBoolean;
471
+ primaryCurrency: z.ZodEnum<{
472
+ JMD: "JMD";
473
+ }>;
474
+ acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
475
+ JMD: "JMD";
476
+ }>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
477
+ lastModified: z.ZodNullable<z.ZodInt>;
478
+ }, z.core.$strip>;
479
+ additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
480
+ createdAt: z.ZodReadonly<z.ZodInt>;
481
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
482
+ description: z.ZodOptional<z.ZodString>;
483
+ fixedAmount: z.ZodNumber;
484
+ percentage: z.ZodNumber;
485
+ }, z.core.$strip>>>;
486
+ discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
487
+ createdAt: z.ZodReadonly<z.ZodInt>;
488
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
489
+ description: z.ZodOptional<z.ZodString>;
490
+ fixedAmount: z.ZodNumber;
491
+ percentage: z.ZodNumber;
492
+ }, z.core.$strip>>>;
493
+ services: z.ZodDefault<z.ZodArray<z.ZodObject<{
494
+ createdAt: z.ZodReadonly<z.ZodInt>;
495
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
496
+ item: z.ZodString;
497
+ cost: z.ZodNumber;
498
+ }, z.core.$strip>>>;
499
+ lastModified: z.ZodNullable<z.ZodInt>;
500
+ }, z.core.$strip>>>;
196
501
  staffDetails: z.ZodPipe<z.ZodObject<{
197
502
  members: z.ZodArray<z.ZodObject<{
198
503
  createdAt: z.ZodReadonly<z.ZodInt>;
@@ -254,10 +559,71 @@ declare const CompanyDetails: z.ZodObject<{
254
559
  partnerMap: Record<string, string[]>;
255
560
  blackList: string[];
256
561
  lastModified: number | null;
257
- }>>;
258
- createdAt: z.ZodInt;
562
+ }>> | z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodObject<{
563
+ members: z.ZodArray<z.ZodObject<{
564
+ createdAt: z.ZodReadonly<z.ZodInt>;
565
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
566
+ uid: z.ZodReadonly<z.ZodString>;
567
+ status: z.ZodEnum<{
568
+ inviteSent: "inviteSent";
569
+ active: "active";
570
+ inactive: "inactive";
571
+ }>;
572
+ roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
573
+ doc: "doc";
574
+ physAsst: "physAsst";
575
+ rcpst: "rcpst";
576
+ cshr: "cshr";
577
+ admin: "admin";
578
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
579
+ lastActive: z.ZodInt;
580
+ name: z.ZodRecord<z.ZodEnum<{
581
+ first: "first";
582
+ last: "last";
583
+ }>, z.ZodString>;
584
+ photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
585
+ email: z.ZodEmail;
586
+ phoneNumber: z.ZodOptional<z.ZodString>;
587
+ }, z.core.$strip>>;
588
+ partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
589
+ blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
590
+ lastModified: z.ZodNullable<z.ZodInt>;
591
+ }, z.core.$strip>, z.ZodTransform<{
592
+ members: {
593
+ createdAt: number;
594
+ uid: string;
595
+ status: "inviteSent" | "active" | "inactive";
596
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
597
+ lastActive: number;
598
+ name: Record<"first" | "last", string>;
599
+ email: string;
600
+ lastModified?: number | null | undefined;
601
+ photoUrl?: string | null | undefined;
602
+ phoneNumber?: string | undefined;
603
+ }[];
604
+ partnerMap: Record<string, string[]>;
605
+ blackList: string[];
606
+ lastModified: number | null;
607
+ }, {
608
+ members: {
609
+ createdAt: number;
610
+ uid: string;
611
+ status: "inviteSent" | "active" | "inactive";
612
+ roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[];
613
+ lastActive: number;
614
+ name: Record<"first" | "last", string>;
615
+ email: string;
616
+ lastModified?: number | null | undefined;
617
+ photoUrl?: string | null | undefined;
618
+ phoneNumber?: string | undefined;
619
+ }[];
620
+ partnerMap: Record<string, string[]>;
621
+ blackList: string[];
622
+ lastModified: number | null;
623
+ }>>>>;
624
+ createdAt: z.ZodInt | z.ZodOptional<z.ZodNullable<z.ZodInt>>;
259
625
  }, z.core.$strip>;
260
- type CompanyDetails = z.infer<typeof CompanyDetails>;
626
+ type PartialCompanyDetails = z.infer<typeof PartialCompanyDetails>;
261
627
 
262
628
  declare const InvoiceNo: z.ZodString;
263
629
  declare const UuidV4: z.ZodReadonly<z.ZodString>;
@@ -312,4 +678,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
312
678
  /**@returns the roles that are compatible with the selected role. */
313
679
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
314
680
 
315
- export { type AppointmentDistAlg, CompanyDetails, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, InvoiceNo, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StandardTime, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
681
+ 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 };
package/dist/main.js CHANGED
@@ -8,8 +8,14 @@ var InvoiceNo = z.string().regex(
8
8
  /^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
9
9
  'An invoice no. must match the pattern "yyyy-mm-dd-9999999".'
10
10
  );
11
- var UuidV4 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 4, "Invalid uuid.");
12
- var UuidV7 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 7, "Invalid uuid.");
11
+ var UuidV4 = z.string().readonly().refine(
12
+ (uid) => validate(uid) && version(uid) === 4,
13
+ "Expected a v4 uuid but received an invalid uuid."
14
+ );
15
+ var UuidV7 = z.string().readonly().refine(
16
+ (uid) => validate(uid) && version(uid) === 7,
17
+ "Expected a v7 uuid but received an invalid uuid."
18
+ );
13
19
  var StandardTime = z.string().regex(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, {
14
20
  error: "A standard time must match the pattern hh:mm A."
15
21
  });
@@ -124,13 +130,19 @@ var CompanyIdentity = z4.object({
124
130
  var CompanyState = z4.object({
125
131
  // This can only be changed by the server/app admin
126
132
  availableBalance: z4.number(),
127
- /** A counter for the company's invoice numbers. */
128
- invoiceNoRef: InvoiceNo.nullable(),
129
133
  /**
130
134
  * The total amount of uploads made by an admin.
131
135
  * @note - This should be refreshed daily.
132
136
  */
133
137
  totalUploads: z4.number(),
138
+ /** A counter for the company's invoice no.
139
+ * @note This should only be null when the cycle resets
140
+ */
141
+ lastInvoiceNo: InvoiceNo.nullable(),
142
+ /** A counter for the company's ticket no.
143
+ * @note This should only be null when the cycle resets
144
+ */
145
+ lastTktNo: z4.number().positive().nullable(),
134
146
  lastModified: Timestamp.nullable()
135
147
  });
136
148
  var CompanyPreferences = z4.object({
@@ -287,15 +299,19 @@ var StaffDetails = z4.object({
287
299
  }
288
300
  }
289
301
  });
290
- var CompanyDetails = z4.object({
291
- uid: UuidV7,
292
- state: CompanyState,
293
- identity: CompanyIdentity,
294
- preferences: CompanyPreferences,
295
- billing: CompanyBillingModel,
296
- staffDetails: StaffDetails,
297
- createdAt: Timestamp
298
- });
302
+ var createCompanyDetails = (options) => {
303
+ return z4.object({
304
+ uid: UuidV7,
305
+ identity: CompanyIdentity,
306
+ state: options.partial ? CompanyState.nullish() : CompanyState,
307
+ preferences: options.partial ? CompanyPreferences.nullish() : CompanyPreferences,
308
+ billing: options.partial ? CompanyBillingModel.nullish() : CompanyBillingModel,
309
+ staffDetails: options.partial ? StaffDetails.nullish() : StaffDetails,
310
+ createdAt: options.partial ? Timestamp.nullish() : Timestamp
311
+ });
312
+ };
313
+ var CompanyDetails = createCompanyDetails({ partial: false });
314
+ var PartialCompanyDetails = createCompanyDetails({ partial: true });
299
315
 
300
316
  // src/functions/helper-functions.ts
301
317
  var findConflictingPartners = (...partners) => {
@@ -332,6 +348,7 @@ export {
332
348
  CompanyRegistrationClaims,
333
349
  CompanyUser,
334
350
  InvoiceNo,
351
+ PartialCompanyDetails,
335
352
  PriceAdjustment,
336
353
  PriceTag,
337
354
  PricingRate,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",