@bizmap/sdk 0.0.88 → 0.0.90

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
@@ -991,6 +991,7 @@ declare const MedicalDetails: z.ZodObject<{
991
991
  type MedicalDetails = z.infer<typeof MedicalDetails>;
992
992
 
993
993
  declare const InvoiceNo: z.ZodString;
994
+ declare const Trn: z.ZodString;
994
995
  declare const StandardTime: z.ZodString;
995
996
  declare const Timestamp: z.ZodInt;
996
997
  declare const InviteResponse: z.ZodEnum<{
@@ -2011,4 +2012,4 @@ declare function createNotifId(options?: {
2011
2012
  to: string;
2012
2013
  }): string;
2013
2014
 
2014
- export { AppointmentDetails, type AppointmentDistAlg, ClientForm, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, type NidClass, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, UserDetails, Version, Vitals, adminRoles, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, nidClasses, normalizeCompanyId, normalizeNidClass, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
2015
+ export { AppointmentDetails, type AppointmentDistAlg, ClientForm, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyType, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, type NidClass, Notification, type PaymentMethod, PriceAdjustment, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, Trn, UserDetails, Version, Vitals, adminRoles, appointmentDistAlgs, companyPartnerRoles, companyServiceSelectors, companyTypes, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, nidClasses, normalizeCompanyId, normalizeNidClass, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
package/dist/main.js CHANGED
@@ -61,13 +61,20 @@ import * as z6 from "zod";
61
61
 
62
62
  // src/schemas/utils/core.ts
63
63
  import * as z5 from "zod";
64
- var InvoiceNo = z5.string().regex(
65
- /^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
66
- 'An invoice no. must match the pattern "yyyy-mm-dd-9999999".'
64
+ var InvoiceNo = z5.string().trim().refine(
65
+ (d) => d && d.replace(
66
+ /^[0-9]{4}-(01|(0[2-9])|(1[0-2]))-(30|31|([1-2][0-9])|0[1-9])-[0-9]{7}/,
67
+ ""
68
+ ).length === 0,
69
+ 'Invalid invoice no.: must match the pattern "yyyy-mm-dd-0000000"'
67
70
  );
68
- var StandardTime = z5.string().regex(
69
- /^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i,
70
- "A standard time must match the pattern hh:mm A."
71
+ var Trn = z5.string().trim().refine(
72
+ (data) => data && data.replace(/^[0-9]{3}-[0-9]{3}-[0-9]{3}/, "").length === 0,
73
+ 'Invalid trn: must match the pattern "000-000-000"'
74
+ );
75
+ var StandardTime = z5.string().trim().refine(
76
+ (d) => d && d.replace(/^(01|(0[2-9])|(1[0-2])):(([1-5][0-9])|0[0-9]) (am|pm)/i, "").length === 0,
77
+ 'Invalid standard time: must match the pattern "hh:mm A"'
71
78
  );
72
79
  var Timestamp = z5.int().refine(
73
80
  (t) => t.toString().length === 13,
@@ -713,10 +720,18 @@ var ClientIdentity = UserDetails.pick({
713
720
  sex: genders,
714
721
  isGlobal: z20.boolean(),
715
722
  origin: CompanyIdentity.shape._id,
723
+ // National id
716
724
  nid: z20.object({
717
725
  class: nidClasses,
718
726
  // Hash this value
719
- value: z20.string()
727
+ value: z20.string().max(20)
728
+ }).superRefine((data, ctx) => {
729
+ if (data.class === "trn") {
730
+ const parsedData = Trn.safeParse(data.value);
731
+ if (!parsedData.success) {
732
+ ctx.addIssue(parsedData.error.message);
733
+ }
734
+ }
720
735
  }).optional(),
721
736
  // Don't hash the attributes, they can be used to help accurately identify a client by whoever is searching for
722
737
  // the client
@@ -1059,6 +1074,7 @@ export {
1059
1074
  TierList,
1060
1075
  TimeLog,
1061
1076
  Timestamp,
1077
+ Trn,
1062
1078
  UserDetails,
1063
1079
  Version,
1064
1080
  Vitals,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.88",
3
+ "version": "0.0.90",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",