@bizmap/sdk 0.0.68 → 0.0.69

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
@@ -71,7 +71,7 @@ declare const serviceProviders: z.ZodEnum<{
71
71
  }>;
72
72
 
73
73
  declare const CompanyDetails: z.ZodObject<{
74
- _id: z.ZodUUID;
74
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
75
75
  identity: z.ZodObject<{
76
76
  type: z.ZodReadonly<z.ZodEnum<{
77
77
  MEDICAL: "MEDICAL";
@@ -83,11 +83,12 @@ declare const CompanyDetails: z.ZodObject<{
83
83
  parish: z.ZodString;
84
84
  country: z.ZodString;
85
85
  }, z.core.$strip>;
86
- displayName: z.ZodString;
86
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
87
87
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
88
88
  contact: z.ZodObject<{
89
89
  email: z.ZodEmail;
90
90
  phoneNumber: z.ZodOptional<z.ZodString>;
91
+ emailVerified: z.ZodBoolean;
91
92
  }, z.core.$strip>;
92
93
  tier: z.ZodObject<{
93
94
  current: z.ZodEnum<{
@@ -98,11 +99,12 @@ declare const CompanyDetails: z.ZodObject<{
98
99
  }>;
99
100
  lastModified: z.ZodNullable<z.ZodInt>;
100
101
  }, z.core.$strip>;
101
- legal: z.ZodObject<{
102
+ isVerified: z.ZodBoolean;
103
+ legal: z.ZodOptional<z.ZodObject<{
102
104
  regNo: z.ZodReadonly<z.ZodString>;
103
105
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
106
  gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
- }, z.core.$strip>;
107
+ }, z.core.$strip>>;
106
108
  }, z.core.$strip>;
107
109
  notifications: z.ZodArray<z.ZodObject<{
108
110
  _id: z.ZodString;
@@ -283,7 +285,7 @@ declare const CompanyDetails: z.ZodObject<{
283
285
  }, z.core.$strip>;
284
286
  type CompanyDetails = z.infer<typeof CompanyDetails>;
285
287
  declare const MutableCompanyDetails: z.ZodObject<{
286
- _id: z.ZodUUID;
288
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
287
289
  identity: z.ZodOptional<z.ZodObject<{
288
290
  address: z.ZodOptional<z.ZodObject<{
289
291
  streetAddress: z.ZodString;
@@ -291,19 +293,21 @@ declare const MutableCompanyDetails: z.ZodObject<{
291
293
  parish: z.ZodString;
292
294
  country: z.ZodString;
293
295
  }, z.core.$strip>>;
296
+ alias: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
294
297
  logo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
295
298
  contact: z.ZodOptional<z.ZodObject<{
296
299
  email: z.ZodEmail;
297
300
  phoneNumber: z.ZodOptional<z.ZodString>;
301
+ emailVerified: z.ZodBoolean;
298
302
  }, z.core.$strip>>;
299
- legal: z.ZodOptional<z.ZodObject<{
303
+ legal: z.ZodOptional<z.ZodOptional<z.ZodObject<{
300
304
  regNo: z.ZodReadonly<z.ZodString>;
301
305
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
302
306
  gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
303
- }, z.core.$strip>>;
307
+ }, z.core.$strip>>>;
304
308
  }, z.core.$strip>>;
305
309
  preferences: z.ZodOptional<z.ZodObject<{
306
- _id: z.ZodOptional<z.ZodUUID>;
310
+ _id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
307
311
  serviceSelector: z.ZodOptional<z.ZodEnum<{
308
312
  scheduler: "scheduler";
309
313
  doctor: "doctor";
@@ -315,7 +319,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
315
319
  }>>>;
316
320
  }, z.core.$strip>>;
317
321
  billing: z.ZodOptional<z.ZodObject<{
318
- _id: z.ZodOptional<z.ZodUUID>;
322
+ _id: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
319
323
  additionalFees: z.ZodOptional<z.ZodRecord<z.ZodUUID, z.ZodObject<{
320
324
  createdAt: z.ZodReadonly<z.ZodInt>;
321
325
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -408,7 +412,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
408
412
  type MutableCompanyDetails = z.infer<typeof MutableCompanyDetails>;
409
413
 
410
414
  declare const CompanyBilling: z.ZodObject<{
411
- _id: z.ZodUUID;
415
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
412
416
  additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
413
417
  createdAt: z.ZodReadonly<z.ZodInt>;
414
418
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -480,7 +484,7 @@ declare const CompanyBilling: z.ZodObject<{
480
484
  }, z.core.$strip>;
481
485
  type CompanyBilling = z.infer<typeof CompanyBilling>;
482
486
  declare const MutableCompanyBilling: z.ZodObject<{
483
- _id: z.ZodUUID;
487
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
484
488
  additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
485
489
  createdAt: z.ZodReadonly<z.ZodInt>;
486
490
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -552,8 +556,8 @@ declare const MutableCompanyBilling: z.ZodObject<{
552
556
  type MutableCompanyBilling = z.infer<typeof MutableCompanyBilling>;
553
557
 
554
558
  declare const CompanyIdentity: z.ZodObject<{
555
- _id: z.ZodUUID;
556
- displayName: z.ZodString;
559
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
560
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
557
561
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
558
562
  type: z.ZodReadonly<z.ZodEnum<{
559
563
  MEDICAL: "MEDICAL";
@@ -567,6 +571,7 @@ declare const CompanyIdentity: z.ZodObject<{
567
571
  contact: z.ZodObject<{
568
572
  email: z.ZodEmail;
569
573
  phoneNumber: z.ZodOptional<z.ZodString>;
574
+ emailVerified: z.ZodBoolean;
570
575
  }, z.core.$strip>;
571
576
  tier: z.ZodObject<{
572
577
  current: z.ZodEnum<{
@@ -577,11 +582,12 @@ declare const CompanyIdentity: z.ZodObject<{
577
582
  }>;
578
583
  lastModified: z.ZodNullable<z.ZodInt>;
579
584
  }, z.core.$strip>;
580
- legal: z.ZodObject<{
585
+ isVerified: z.ZodBoolean;
586
+ legal: z.ZodOptional<z.ZodObject<{
581
587
  regNo: z.ZodReadonly<z.ZodString>;
582
588
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
583
589
  gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
584
- }, z.core.$strip>;
590
+ }, z.core.$strip>>;
585
591
  lastModified: z.ZodNullable<z.ZodInt>;
586
592
  }, z.core.$strip>;
587
593
  type CompanyIdentity = z.infer<typeof CompanyIdentity>;
@@ -592,16 +598,18 @@ declare const MutableCompanyIdentity: z.ZodObject<{
592
598
  parish: z.ZodString;
593
599
  country: z.ZodString;
594
600
  }, z.core.$strip>;
601
+ alias: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
595
602
  logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
596
603
  contact: z.ZodObject<{
597
604
  email: z.ZodEmail;
598
605
  phoneNumber: z.ZodOptional<z.ZodString>;
606
+ emailVerified: z.ZodBoolean;
599
607
  }, z.core.$strip>;
600
- legal: z.ZodObject<{
608
+ legal: z.ZodOptional<z.ZodObject<{
601
609
  regNo: z.ZodReadonly<z.ZodString>;
602
610
  trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
603
611
  gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
604
- }, z.core.$strip>;
612
+ }, z.core.$strip>>;
605
613
  }, z.core.$strip>;
606
614
  type MutableCompanyIdentity = z.infer<typeof MutableCompanyIdentity>;
607
615
 
@@ -621,7 +629,7 @@ declare const CompanyNotifications: z.ZodArray<z.ZodObject<{
621
629
  type CompanyNotifications = z.infer<typeof CompanyNotifications>;
622
630
 
623
631
  declare const CompanyPreferences: z.ZodObject<{
624
- _id: z.ZodUUID;
632
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
625
633
  serviceSelector: z.ZodEnum<{
626
634
  scheduler: "scheduler";
627
635
  doctor: "doctor";
@@ -635,7 +643,7 @@ declare const CompanyPreferences: z.ZodObject<{
635
643
  }, z.core.$strip>;
636
644
  type CompanyPreferences = z.infer<typeof CompanyPreferences>;
637
645
  declare const MutableCompanyPreferences: z.ZodObject<{
638
- _id: z.ZodUUID;
646
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
639
647
  serviceSelector: z.ZodEnum<{
640
648
  scheduler: "scheduler";
641
649
  doctor: "doctor";
@@ -674,7 +682,7 @@ declare const CompanyStaff: z.ZodObject<{
674
682
  isAvailableLastModified: z.ZodNullable<z.ZodInt>;
675
683
  isBusyLastModified: z.ZodNullable<z.ZodInt>;
676
684
  }, z.core.$strip>>;
677
- _id: z.ZodUUID;
685
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
678
686
  partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
679
687
  addedAt: z.ZodInt;
680
688
  }, z.core.$strip>>>;
@@ -703,7 +711,7 @@ type CompanyStaff = z.infer<typeof CompanyStaff>;
703
711
 
704
712
  /** Can only be modifiede by the server */
705
713
  declare const CompanyState: z.ZodObject<{
706
- _id: z.ZodUUID;
714
+ _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
707
715
  credits: z.ZodObject<{
708
716
  current: z.ZodNumber;
709
717
  lastModified: z.ZodNullable<z.ZodInt>;
@@ -995,7 +1003,7 @@ declare const MiniAppointmentDetails: z.ZodObject<{
995
1003
  createdAt: z.ZodReadonly<z.ZodInt>;
996
1004
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
997
1005
  _id: z.ZodUUID;
998
- src: z.ZodUUID;
1006
+ src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
999
1007
  tkt: z.ZodReadonly<z.ZodInt>;
1000
1008
  reason: z.ZodOptional<z.ZodObject<{
1001
1009
  createdAt: z.ZodReadonly<z.ZodInt>;
@@ -1228,7 +1236,7 @@ declare const AppointmentDetails: z.ZodObject<{
1228
1236
  content: z.ZodString;
1229
1237
  }, z.core.$strip>>>;
1230
1238
  }, z.core.$strip>>>;
1231
- src: z.ZodUUID;
1239
+ src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1232
1240
  timeline: z.ZodObject<{
1233
1241
  scheduler: z.ZodObject<{
1234
1242
  postedAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -1394,7 +1402,7 @@ declare const MutableAppointmentDetails: z.ZodObject<{
1394
1402
  content: z.ZodString;
1395
1403
  }, z.core.$strip>>>;
1396
1404
  }, z.core.$strip>>>;
1397
- src: z.ZodUUID;
1405
+ src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1398
1406
  timeline: z.ZodObject<{
1399
1407
  scheduler: z.ZodObject<{
1400
1408
  postedAt: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
@@ -1778,10 +1786,11 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
1778
1786
  * @returns {CompanyUserRole[]} The roles that are compatible with the selected role.
1779
1787
  * */
1780
1788
  declare const getCompatibleRoles: (role: CompanyUserRole) => CompanyUserRole[];
1789
+ declare const parseCompanyName: (name: string) => string;
1781
1790
 
1782
1791
  declare function createNotifId(options?: {
1783
1792
  from: string;
1784
1793
  to: string;
1785
1794
  }): string;
1786
1795
 
1787
- export { AppointmentDetails, type AppointmentDistAlg, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CreditCurrency, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Vitals, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, getCompatibleRoles, healthcareProviderRoles, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
1796
+ export { AppointmentDetails, type AppointmentDistAlg, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CreditCurrency, type EmployeeRole, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Vitals, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, getCompatibleRoles, healthcareProviderRoles, parseCompanyName, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
package/dist/main.js CHANGED
@@ -108,7 +108,13 @@ import * as z8 from "zod";
108
108
  // src/schemas/company/components/State.ts
109
109
  import * as z7 from "zod";
110
110
  var CompanyState = z7.object({
111
- _id: z7.uuidv4(),
111
+ _id: z7.string().toLowerCase().trim().min(3).max(63).regex(/[a-z1-9\-]/).transform((data) => data.replace(/-+/g, "-").replace(/\s+/g, "")).superRefine((data, ctx) => {
112
+ if (!/[a-z]/.test(data[0]) || !/[a-z]/.test(data[data.length - 1])) {
113
+ ctx.addIssue(
114
+ "The first and last character of a company's name must be a letter."
115
+ );
116
+ }
117
+ }),
112
118
  credits: z7.object({
113
119
  current: z7.number(),
114
120
  lastModified: Timestamp.nullable()
@@ -180,32 +186,44 @@ import * as z9 from "zod";
180
186
  import { Address, PhoneNumber } from "@wavy/util";
181
187
  var CompanyIdentity = z9.object({
182
188
  _id: CompanyState.shape._id,
183
- displayName: z9.string().min(3).max(25),
189
+ alias: z9.string().trim().min(3).max(63).regex(/[a-z1-9 ]/gi).transform(
190
+ (data) => data.replace(/[^a-z1-9 ]/gi, "").replace(/\s+/g, " ")
191
+ ),
184
192
  logo: z9.string().max(150).nullish(),
185
193
  type: companyTypes.readonly(),
186
194
  address: Address,
187
195
  contact: z9.object({
188
196
  email: z9.email().max(25),
189
- phoneNumber: PhoneNumber.optional()
197
+ phoneNumber: PhoneNumber.optional(),
198
+ emailVerified: z9.boolean()
190
199
  }),
191
200
  // Can only be changed by the server
192
201
  tier: z9.object({
193
202
  current: tiers,
194
203
  lastModified: Timestamp.nullable()
195
204
  }),
205
+ isVerified: z9.boolean(),
196
206
  legal: z9.object({
197
207
  regNo: z9.string().max(20).readonly(),
198
208
  // The company's registration number
199
209
  trn: z9.string().regex(/[0-9]{3}-[0-9]{3}-[0-9]{3}/).nullish(),
200
210
  gctRegNo: z9.string().max(15).nullish()
201
- }),
211
+ }).optional(),
202
212
  lastModified: Timestamp.nullable()
213
+ }).superRefine((data, ctx) => {
214
+ const hasLegalInfo = "legal" in data;
215
+ if (data.isVerified && !hasLegalInfo) {
216
+ ctx.addIssue("Verified companies must have the legal field defined.");
217
+ } else if (!data.isVerified && hasLegalInfo) {
218
+ ctx.addIssue("Unverified companies can't have the legal field defined.");
219
+ }
203
220
  });
204
221
  var MutableCompanyIdentity = CompanyIdentity.pick({
205
222
  address: true,
206
223
  contact: true,
207
224
  logo: true,
208
- legal: true
225
+ legal: true,
226
+ alias: true
209
227
  });
210
228
 
211
229
  // src/schemas/company/components/Notifications.ts
@@ -409,6 +427,7 @@ var getCompatibleRoles = (role) => {
409
427
  }
410
428
  return companyUserRoles.exclude([role]).options;
411
429
  };
430
+ var parseCompanyName = (name) => name.replace(/-/g, " ");
412
431
 
413
432
  // src/schemas/company/components/User.ts
414
433
  var MiniCompanyUser2 = z14.object({
@@ -954,6 +973,7 @@ export {
954
973
  findNextAvailableStaff,
955
974
  getCompatibleRoles,
956
975
  healthcareProviderRoles,
976
+ parseCompanyName,
957
977
  paymentMethods,
958
978
  scheduleAppointment,
959
979
  serviceProviders,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",