@bizmap/sdk 0.0.25 → 0.0.27

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
@@ -4,30 +4,30 @@ declare const PricingRate: z.ZodObject<{
4
4
  companyRegistration: z.ZodObject<{
5
5
  flatFee: z.ZodNumber;
6
6
  feePerUser: z.ZodNumber;
7
- lastModified: z.ZodNumber;
7
+ lastModified: z.ZodInt;
8
8
  }, z.core.$strip>;
9
9
  }, z.core.$strip>;
10
10
  type PricingRate = z.infer<typeof PricingRate>;
11
11
  declare const PriceAdjustment: z.ZodObject<{
12
- createdAt: z.ZodReadonly<z.ZodNumber>;
13
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
12
+ createdAt: z.ZodReadonly<z.ZodInt>;
13
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
14
14
  description: z.ZodOptional<z.ZodString>;
15
15
  fixedAmount: z.ZodNumber;
16
16
  percentage: z.ZodNumber;
17
17
  }, z.core.$strip>;
18
18
  type PriceAdjustment = z.infer<typeof PriceAdjustment>;
19
19
  declare const PriceTag: z.ZodObject<{
20
- createdAt: z.ZodReadonly<z.ZodNumber>;
21
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
22
- uid: z.ZodString;
20
+ createdAt: z.ZodReadonly<z.ZodInt>;
21
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
22
+ uid: z.ZodReadonly<z.ZodString>;
23
23
  item: z.ZodString;
24
24
  cost: z.ZodNumber;
25
25
  }, z.core.$strip>;
26
26
  type PriceTag = z.infer<typeof PriceTag>;
27
27
 
28
28
  declare const CompanyIdentity: z.ZodObject<{
29
- createdAt: z.ZodReadonly<z.ZodNumber>;
30
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
29
+ createdAt: z.ZodReadonly<z.ZodInt>;
30
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
31
31
  uid: z.ZodReadonly<z.ZodString>;
32
32
  displayName: z.ZodString;
33
33
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -49,15 +49,15 @@ declare const CompanyIdentity: z.ZodObject<{
49
49
  }, z.core.$strip>;
50
50
  type CompanyIdentity = z.infer<typeof CompanyIdentity>;
51
51
  declare const CompanyOpState: z.ZodObject<{
52
- createdAt: z.ZodReadonly<z.ZodNumber>;
53
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
52
+ createdAt: z.ZodReadonly<z.ZodInt>;
53
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
54
54
  uid: z.ZodReadonly<z.ZodString>;
55
55
  availableBalance: z.ZodNumber;
56
- invoiceNoRef: z.ZodString;
56
+ invoiceNoRef: z.ZodNullable<z.ZodString>;
57
57
  totalUploads: z.ZodNumber;
58
58
  preferences: z.ZodObject<{
59
- createdAt: z.ZodReadonly<z.ZodNumber>;
60
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
59
+ createdAt: z.ZodReadonly<z.ZodInt>;
60
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
61
61
  userProvisions: z.ZodNumber;
62
62
  apptDistAlg: z.ZodDefault<z.ZodEnum<{
63
63
  RR: "RR";
@@ -67,12 +67,12 @@ declare const CompanyOpState: z.ZodObject<{
67
67
  }, z.core.$strip>;
68
68
  type CompanyOpState = z.infer<typeof CompanyOpState>;
69
69
  declare const CompanyBillingModel: z.ZodObject<{
70
- createdAt: z.ZodReadonly<z.ZodNumber>;
71
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
70
+ createdAt: z.ZodReadonly<z.ZodInt>;
71
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
72
72
  uid: z.ZodReadonly<z.ZodString>;
73
73
  preferences: z.ZodObject<{
74
- createdAt: z.ZodReadonly<z.ZodNumber>;
75
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
74
+ createdAt: z.ZodReadonly<z.ZodInt>;
75
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
76
76
  allowInvoiceDist: z.ZodBoolean;
77
77
  useCreatedServices: z.ZodBoolean;
78
78
  serviceSelector: z.ZodEnum<{
@@ -83,27 +83,27 @@ declare const CompanyBillingModel: z.ZodObject<{
83
83
  primaryCurrency: z.ZodEnum<{
84
84
  JMD: "JMD";
85
85
  }>;
86
- acceptedCurrencies: z.ZodArray<z.ZodEnum<{
86
+ acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
87
87
  JMD: "JMD";
88
- }>>;
88
+ }>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
89
89
  }, z.core.$strip>;
90
90
  additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
91
- createdAt: z.ZodReadonly<z.ZodNumber>;
92
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
91
+ createdAt: z.ZodReadonly<z.ZodInt>;
92
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
93
93
  description: z.ZodOptional<z.ZodString>;
94
94
  fixedAmount: z.ZodNumber;
95
95
  percentage: z.ZodNumber;
96
96
  }, z.core.$strip>>>;
97
97
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
98
- createdAt: z.ZodReadonly<z.ZodNumber>;
99
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
98
+ createdAt: z.ZodReadonly<z.ZodInt>;
99
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
100
100
  description: z.ZodOptional<z.ZodString>;
101
101
  fixedAmount: z.ZodNumber;
102
102
  percentage: z.ZodNumber;
103
103
  }, z.core.$strip>>>;
104
104
  services: z.ZodDefault<z.ZodArray<z.ZodObject<{
105
- createdAt: z.ZodReadonly<z.ZodNumber>;
106
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
105
+ createdAt: z.ZodReadonly<z.ZodInt>;
106
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
107
107
  item: z.ZodString;
108
108
  cost: z.ZodNumber;
109
109
  }, z.core.$strip>>>;
@@ -157,8 +157,8 @@ declare const RegisterCompanyForm: z.ZodObject<{
157
157
  }, z.core.$strip>;
158
158
  type RegisterCompanyForm = z.infer<typeof RegisterCompanyForm>;
159
159
  declare const CompanyRegistrationClaims: z.ZodObject<{
160
- createdAt: z.ZodReadonly<z.ZodNumber>;
161
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
160
+ createdAt: z.ZodReadonly<z.ZodInt>;
161
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
162
162
  sender: z.ZodObject<{
163
163
  name: z.ZodRecord<z.ZodEnum<{
164
164
  first: "first";
@@ -172,13 +172,13 @@ declare const CompanyRegistrationClaims: z.ZodObject<{
172
172
  pricingRate: z.ZodObject<{
173
173
  flatFee: z.ZodNumber;
174
174
  feePerUser: z.ZodNumber;
175
- lastModified: z.ZodNumber;
175
+ lastModified: z.ZodInt;
176
176
  }, z.core.$strip>;
177
177
  }, z.core.$strip>;
178
178
  type CompanyRegistrationClaims = z.infer<typeof CompanyRegistrationClaims>;
179
179
  declare const CompanyUser: z.ZodObject<{
180
- createdAt: z.ZodReadonly<z.ZodNumber>;
181
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
180
+ createdAt: z.ZodReadonly<z.ZodInt>;
181
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
182
182
  uid: z.ZodReadonly<z.ZodString>;
183
183
  status: z.ZodEnum<{
184
184
  inviteSent: "inviteSent";
@@ -192,7 +192,7 @@ declare const CompanyUser: z.ZodObject<{
192
192
  cshr: "cshr";
193
193
  admin: "admin";
194
194
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
195
- lastActive: z.ZodNumber;
195
+ lastActive: z.ZodInt;
196
196
  name: z.ZodRecord<z.ZodEnum<{
197
197
  first: "first";
198
198
  last: "last";
@@ -203,10 +203,12 @@ declare const CompanyUser: z.ZodObject<{
203
203
  }, z.core.$strip>;
204
204
  type CompanyUser = z.infer<typeof CompanyUser>;
205
205
  declare const _staffDetails: z.ZodObject<{
206
+ createdAt: z.ZodReadonly<z.ZodInt>;
207
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
206
208
  uid: z.ZodReadonly<z.ZodString>;
207
209
  members: z.ZodArray<z.ZodObject<{
208
- createdAt: z.ZodReadonly<z.ZodNumber>;
209
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
210
+ createdAt: z.ZodReadonly<z.ZodInt>;
211
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
210
212
  uid: z.ZodReadonly<z.ZodString>;
211
213
  status: z.ZodEnum<{
212
214
  inviteSent: "inviteSent";
@@ -220,7 +222,7 @@ declare const _staffDetails: z.ZodObject<{
220
222
  cshr: "cshr";
221
223
  admin: "admin";
222
224
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
223
- lastActive: z.ZodNumber;
225
+ lastActive: z.ZodInt;
224
226
  name: z.ZodRecord<z.ZodEnum<{
225
227
  first: "first";
226
228
  last: "last";
@@ -234,10 +236,12 @@ declare const _staffDetails: z.ZodObject<{
234
236
  }, z.core.$strip>;
235
237
  /** The unpacked Staff Details */
236
238
  declare const StaffDetails: z.ZodPipe<z.ZodObject<{
239
+ createdAt: z.ZodReadonly<z.ZodInt>;
240
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
237
241
  uid: z.ZodReadonly<z.ZodString>;
238
242
  members: z.ZodArray<z.ZodObject<{
239
- createdAt: z.ZodReadonly<z.ZodNumber>;
240
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
243
+ createdAt: z.ZodReadonly<z.ZodInt>;
244
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
241
245
  uid: z.ZodReadonly<z.ZodString>;
242
246
  status: z.ZodEnum<{
243
247
  inviteSent: "inviteSent";
@@ -251,7 +255,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
251
255
  cshr: "cshr";
252
256
  admin: "admin";
253
257
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
254
- lastActive: z.ZodNumber;
258
+ lastActive: z.ZodInt;
255
259
  name: z.ZodRecord<z.ZodEnum<{
256
260
  first: "first";
257
261
  last: "last";
@@ -263,6 +267,7 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
263
267
  partnerMap: z.ZodRecord<z.ZodReadonly<z.ZodString>, z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>>;
264
268
  blackList: z.ZodPipe<z.ZodArray<z.ZodReadonly<z.ZodString>>, z.ZodTransform<string[], string[]>>;
265
269
  }, z.core.$strip>, z.ZodTransform<{
270
+ createdAt: number;
266
271
  uid: string;
267
272
  members: {
268
273
  createdAt: number;
@@ -278,7 +283,9 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
278
283
  }[];
279
284
  partnerMap: Record<string, string[]>;
280
285
  blackList: string[];
286
+ lastModified?: number | null | undefined;
281
287
  }, {
288
+ createdAt: number;
282
289
  uid: string;
283
290
  members: {
284
291
  createdAt: number;
@@ -294,13 +301,14 @@ declare const StaffDetails: z.ZodPipe<z.ZodObject<{
294
301
  }[];
295
302
  partnerMap: Record<string, string[]>;
296
303
  blackList: string[];
304
+ lastModified?: number | null | undefined;
297
305
  }>>;
298
306
  type StaffDetails = z.infer<typeof _staffDetails>;
299
307
  declare const CompanyDetails: z.ZodObject<{
300
308
  uid: z.ZodReadonly<z.ZodString>;
301
309
  identity: z.ZodObject<{
302
- createdAt: z.ZodReadonly<z.ZodNumber>;
303
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
310
+ createdAt: z.ZodReadonly<z.ZodInt>;
311
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
304
312
  address: z.ZodObject<{
305
313
  streetAddress: z.ZodString;
306
314
  city: z.ZodOptional<z.ZodString>;
@@ -320,14 +328,14 @@ declare const CompanyDetails: z.ZodObject<{
320
328
  }, z.core.$strip>;
321
329
  }, z.core.$strip>;
322
330
  opState: z.ZodObject<{
323
- createdAt: z.ZodReadonly<z.ZodNumber>;
324
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
325
- invoiceNoRef: z.ZodString;
331
+ createdAt: z.ZodReadonly<z.ZodInt>;
332
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
326
333
  availableBalance: z.ZodNumber;
334
+ invoiceNoRef: z.ZodNullable<z.ZodString>;
327
335
  totalUploads: z.ZodNumber;
328
336
  preferences: z.ZodObject<{
329
- createdAt: z.ZodReadonly<z.ZodNumber>;
330
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
337
+ createdAt: z.ZodReadonly<z.ZodInt>;
338
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
331
339
  userProvisions: z.ZodNumber;
332
340
  apptDistAlg: z.ZodDefault<z.ZodEnum<{
333
341
  RR: "RR";
@@ -336,11 +344,11 @@ declare const CompanyDetails: z.ZodObject<{
336
344
  }, z.core.$strip>;
337
345
  }, z.core.$strip>;
338
346
  billing: z.ZodObject<{
339
- createdAt: z.ZodReadonly<z.ZodNumber>;
340
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
347
+ createdAt: z.ZodReadonly<z.ZodInt>;
348
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
341
349
  preferences: z.ZodObject<{
342
- createdAt: z.ZodReadonly<z.ZodNumber>;
343
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
350
+ createdAt: z.ZodReadonly<z.ZodInt>;
351
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
344
352
  allowInvoiceDist: z.ZodBoolean;
345
353
  useCreatedServices: z.ZodBoolean;
346
354
  serviceSelector: z.ZodEnum<{
@@ -351,35 +359,37 @@ declare const CompanyDetails: z.ZodObject<{
351
359
  primaryCurrency: z.ZodEnum<{
352
360
  JMD: "JMD";
353
361
  }>;
354
- acceptedCurrencies: z.ZodArray<z.ZodEnum<{
362
+ acceptedCurrencies: z.ZodPipe<z.ZodArray<z.ZodEnum<{
355
363
  JMD: "JMD";
356
- }>>;
364
+ }>>, z.ZodTransform<"JMD"[], "JMD"[]>>;
357
365
  }, z.core.$strip>;
358
366
  additionalFees: z.ZodDefault<z.ZodArray<z.ZodObject<{
359
- createdAt: z.ZodReadonly<z.ZodNumber>;
360
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
367
+ createdAt: z.ZodReadonly<z.ZodInt>;
368
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
361
369
  description: z.ZodOptional<z.ZodString>;
362
370
  fixedAmount: z.ZodNumber;
363
371
  percentage: z.ZodNumber;
364
372
  }, z.core.$strip>>>;
365
373
  discounts: z.ZodDefault<z.ZodArray<z.ZodObject<{
366
- createdAt: z.ZodReadonly<z.ZodNumber>;
367
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
374
+ createdAt: z.ZodReadonly<z.ZodInt>;
375
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
368
376
  description: z.ZodOptional<z.ZodString>;
369
377
  fixedAmount: z.ZodNumber;
370
378
  percentage: z.ZodNumber;
371
379
  }, z.core.$strip>>>;
372
380
  services: z.ZodDefault<z.ZodArray<z.ZodObject<{
373
- createdAt: z.ZodReadonly<z.ZodNumber>;
374
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
381
+ createdAt: z.ZodReadonly<z.ZodInt>;
382
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
375
383
  item: z.ZodString;
376
384
  cost: z.ZodNumber;
377
385
  }, z.core.$strip>>>;
378
386
  }, z.core.$strip>;
379
387
  staffDetails: z.ZodObject<{
388
+ createdAt: z.ZodReadonly<z.ZodInt>;
389
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
380
390
  members: z.ZodArray<z.ZodObject<{
381
- createdAt: z.ZodReadonly<z.ZodNumber>;
382
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
391
+ createdAt: z.ZodReadonly<z.ZodInt>;
392
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
383
393
  uid: z.ZodReadonly<z.ZodString>;
384
394
  status: z.ZodEnum<{
385
395
  inviteSent: "inviteSent";
@@ -393,7 +403,7 @@ declare const CompanyDetails: z.ZodObject<{
393
403
  cshr: "cshr";
394
404
  admin: "admin";
395
405
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "admin")[]>>;
396
- lastActive: z.ZodNumber;
406
+ lastActive: z.ZodInt;
397
407
  name: z.ZodRecord<z.ZodEnum<{
398
408
  first: "first";
399
409
  last: "last";
@@ -408,14 +418,16 @@ declare const CompanyDetails: z.ZodObject<{
408
418
  }, z.core.$strip>;
409
419
  type CompanyDetails = z.infer<typeof CompanyDetails>;
410
420
 
421
+ declare const InvoiceNo: z.ZodString;
422
+ declare const UuidV4: z.ZodReadonly<z.ZodString>;
423
+ declare const UuidV7: z.ZodReadonly<z.ZodString>;
424
+ declare const StandardTime: z.ZodString;
425
+ declare const Timestamp: z.ZodInt;
411
426
  declare const TimeLog: z.ZodObject<{
412
- createdAt: z.ZodReadonly<z.ZodNumber>;
413
- lastModified: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
427
+ createdAt: z.ZodReadonly<z.ZodInt>;
428
+ lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
414
429
  }, z.core.$strip>;
415
430
  type TimeLog = z.infer<typeof TimeLog>;
416
- declare const InvoiceNo: z.ZodString;
417
- declare const UuidV7: z.ZodReadonly<z.ZodString>;
418
- declare const Time: z.ZodString;
419
431
 
420
432
  declare const companyUserRoles: z.ZodEnum<{
421
433
  doc: "doc";
@@ -459,4 +471,4 @@ declare const findConflictingPartners: (...partners: CompanyUser[]) => {
459
471
  /**@returns the roles that are compatible with the selected role. */
460
472
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
461
473
 
462
- export { type AppointmentDistAlg, CompanyBillingModel, CompanyDetails, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, InvoiceNo, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, Time, TimeLog, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
474
+ export { type AppointmentDistAlg, CompanyBillingModel, CompanyDetails, CompanyIdentity, CompanyOpState, type CompanyPartnerRole, CompanyRegistrationClaims, CompanyUser, type CompanyUserRole, type EmployeeRole, InvoiceNo, PriceAdjustment, PriceTag, PricingRate, RegisterCompanyForm, StaffDetails, StandardTime, TimeLog, Timestamp, UuidV4, UuidV7, appointmentDistAlgs, companyPartnerRoles, companyUserRoles, employeeRoles, findConflictingPartners, getCompatibleRoles };
package/dist/main.js CHANGED
@@ -4,38 +4,43 @@ import * as z2 from "zod";
4
4
  // src/schemas/utils.ts
5
5
  import { validate, version } from "uuid";
6
6
  import * as z from "zod";
7
- var TimeLog = z.object({
8
- createdAt: z.number().readonly(),
9
- lastModified: z.number().nullish()
10
- });
11
7
  var InvoiceNo = z.string().regex(
12
8
  /^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
13
9
  'An invoice no. must match the pattern "yyyy-mm-dd-9999999".'
14
10
  );
11
+ var UuidV4 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 4, "Invalid uuid.");
15
12
  var UuidV7 = z.string().readonly().refine((uid) => validate(uid) && version(uid) === 7, "Invalid uuid.");
16
- var Time = z.string().regex(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, {
17
- error: "A time must match the pattern hh:mm A."
13
+ var StandardTime = z.string().regex(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, {
14
+ error: "A standard time must match the pattern hh:mm A."
15
+ });
16
+ var Timestamp = z.int().refine(
17
+ (t) => t.toString().length === 13,
18
+ "A timestamp must have (13) digits."
19
+ ).positive();
20
+ var TimeLog = z.object({
21
+ createdAt: Timestamp.readonly(),
22
+ lastModified: Timestamp.nullish()
18
23
  });
19
24
 
20
25
  // src/schemas/Billing.ts
21
26
  var PricingRate = z2.object({
22
27
  companyRegistration: z2.object({
23
- flatFee: z2.number(),
24
- feePerUser: z2.number(),
25
- lastModified: z2.number()
28
+ flatFee: z2.number().positive(),
29
+ feePerUser: z2.number().positive(),
30
+ lastModified: Timestamp
26
31
  })
27
32
  });
28
33
  var PriceAdjustment = z2.object({
29
- description: z2.string().trim().optional(),
30
- fixedAmount: z2.number(),
31
- percentage: z2.number(),
34
+ description: z2.string().trim().min(3, "A description must have atleast (3) characters.").max(25, "A description can't have more that (25) characters.").optional(),
35
+ fixedAmount: z2.number().positive().max(1e6, "The max fixed amount is $1,000,000.00"),
36
+ percentage: z2.number().positive().max(1e3, "The max percentage is 1,000%"),
32
37
  ...TimeLog.shape
33
38
  });
34
39
  var PriceTag = z2.object({
35
- uid: z2.string(),
40
+ uid: UuidV4,
36
41
  /**The name of the item that's being priced */
37
42
  item: z2.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."),
38
- cost: z2.number().min(1, "The minimum allowed cost is $1.00"),
43
+ cost: z2.number().min(1, "The minimum allowed cost is $1.00").max(1e9, "The max allowed cost is $1,000,000,000.00.").positive(),
39
44
  ...TimeLog.shape
40
45
  });
41
46
 
@@ -69,18 +74,18 @@ var appointmentDistAlgs = z3.enum(["RR", "LOR"]);
69
74
  var CompanyIdentity = z4.object({
70
75
  uid: UuidV7,
71
76
  // The company's uid
72
- displayName: z4.string(),
73
- logo: z4.string().nullish(),
77
+ displayName: z4.string().min(3).max(20),
78
+ logo: z4.string().max(2500).nullish(),
74
79
  contact: z4.object({
75
- email: z4.email(),
80
+ email: z4.email().max(25),
76
81
  phoneNumber: PhoneNumber.optional()
77
82
  }),
78
83
  address: Address,
79
84
  legal: z4.object({
80
- regNo: z4.string().readonly(),
85
+ regNo: z4.string().max(20).readonly(),
81
86
  // The company's registration number
82
- trn: z4.string().nullish(),
83
- gctRegNo: z4.string().nullish()
87
+ trn: z4.string().regex(/[0-9]{3}-[0-9]{3}-[0-9]{3}/).nullish(),
88
+ gctRegNo: z4.string().max(15).nullish()
84
89
  }),
85
90
  ...TimeLog.shape
86
91
  });
@@ -90,7 +95,7 @@ var CompanyOpState = z4.object({
90
95
  // This can only be changed by the server/app admin
91
96
  availableBalance: z4.number(),
92
97
  /** A counter for the company's invoice numbers. */
93
- invoiceNoRef: InvoiceNo,
98
+ invoiceNoRef: InvoiceNo.nullable(),
94
99
  /**
95
100
  * The total amount of uploads made by an admin.
96
101
  * @note - This should be refreshed daily.
@@ -128,7 +133,14 @@ var CompanyBillingModel = z4.object({
128
133
  * */
129
134
  enforcePaidAppts: z4.boolean(),
130
135
  primaryCurrency: currencies,
131
- acceptedCurrencies: z4.array(currencies),
136
+ acceptedCurrencies: z4.array(currencies).transform((currencies2) => {
137
+ const newCurrencies = [];
138
+ for (const currency of currencies2) {
139
+ if (newCurrencies.includes(currency)) continue;
140
+ newCurrencies.push(currency);
141
+ }
142
+ return newCurrencies;
143
+ }),
132
144
  ...TimeLog.shape
133
145
  }).superRefine((data, ctx) => {
134
146
  if (data.enforcePaidAppts && data.serviceSelector !== "scheduler") {
@@ -178,7 +190,7 @@ var CompanyUser = z4.object({
178
190
  (role, i) => i === 0 || compatibleRoles.includes(role)
179
191
  );
180
192
  }, "A user is not allowed to have conflicting roles."),
181
- lastActive: z4.number(),
193
+ lastActive: Timestamp,
182
194
  ...TimeLog.shape
183
195
  });
184
196
  var _staffDetails = z4.object({
@@ -239,8 +251,8 @@ var _staffDetails = z4.object({
239
251
  }
240
252
  }
241
253
  return newList.sort();
242
- })
243
- // ...TimeLog.shape,
254
+ }),
255
+ ...TimeLog.shape
244
256
  });
245
257
  var StaffDetails = _staffDetails.transform((d) => {
246
258
  let blackListWithExisitingUsers = [];
@@ -332,8 +344,10 @@ export {
332
344
  PricingRate,
333
345
  RegisterCompanyForm,
334
346
  StaffDetails,
335
- Time,
347
+ StandardTime,
336
348
  TimeLog,
349
+ Timestamp,
350
+ UuidV4,
337
351
  UuidV7,
338
352
  appointmentDistAlgs,
339
353
  companyPartnerRoles,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",