@bizmap/sdk 0.0.101 → 0.0.102

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
@@ -1084,11 +1084,17 @@ declare const ClientForm: z.ZodObject<{
1084
1084
  }, z.core.$strip>;
1085
1085
  type ClientForm = z.infer<typeof ClientForm>;
1086
1086
 
1087
+ declare const AppointmentSeverity: z.ZodObject<{
1088
+ 1: z.ZodLiteral<"Emergency">;
1089
+ 2: z.ZodLiteral<"Important">;
1090
+ 3: z.ZodLiteral<"Average">;
1091
+ }, z.core.$strip>;
1092
+ type AppointmentSeverity = z.infer<typeof AppointmentSeverity>;
1087
1093
  declare const MiniAppointmentDetails: z.ZodObject<{
1088
1094
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1089
1095
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1090
1096
  _id: z.ZodUUID;
1091
- category: z.ZodInt;
1097
+ severity: z.ZodString;
1092
1098
  src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1093
1099
  tkt: z.ZodReadonly<z.ZodInt>;
1094
1100
  reason: z.ZodOptional<z.ZodObject<{
@@ -1302,7 +1308,7 @@ declare const AppointmentDetails: z.ZodObject<{
1302
1308
  }, z.core.$strip>>>;
1303
1309
  src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1304
1310
  tkt: z.ZodReadonly<z.ZodInt>;
1305
- category: z.ZodInt;
1311
+ severity: z.ZodString;
1306
1312
  reason: z.ZodOptional<z.ZodObject<{
1307
1313
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1308
1314
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
@@ -1481,7 +1487,7 @@ declare const MutableAppointmentDetails: z.ZodObject<{
1481
1487
  }, z.core.$strip>>>;
1482
1488
  src: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
1483
1489
  tkt: z.ZodReadonly<z.ZodInt>;
1484
- category: z.ZodInt;
1490
+ severity: z.ZodString;
1485
1491
  reason: z.ZodOptional<z.ZodObject<{
1486
1492
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1487
1493
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
@@ -1589,7 +1595,7 @@ declare const ScheduleAppointmentForm: z.ZodObject<{
1589
1595
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1590
1596
  clientId: z.ZodUUID;
1591
1597
  serviceProviderId: z.ZodUnion<[z.ZodUUID, z.ZodLiteral<"next">]>;
1592
- category: z.ZodInt;
1598
+ category: z.ZodString;
1593
1599
  appointmentReason: z.ZodOptional<z.ZodObject<{
1594
1600
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1595
1601
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
@@ -1714,7 +1720,7 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1714
1720
  _id: string;
1715
1721
  src: string;
1716
1722
  tkt: number;
1717
- category: number;
1723
+ severity: string;
1718
1724
  timeline: {
1719
1725
  scheduler: {
1720
1726
  userUid: string;
@@ -1931,4 +1937,4 @@ declare function createNotifId(options?: {
1931
1937
  to: string;
1932
1938
  }): string;
1933
1939
 
1934
- export { type AcceptedCurrency, AlphaNumeric, AppointmentDetails, type AppointmentDistAlg, ClientForm, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, type Industry, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, PaymentDetails, type PaymentMethod, PriceMod, PriceModList, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, Trn, UserDetails, Version, Vitals, acceptedCurrencies, adminRoles, appointmentDistAlgs, calcBalance, calcPriceMod, companyPartnerRoles, companyServiceSelectors, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, industries, normalizeCompanyId, normalizeNidKey, parseClientName, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
1940
+ export { type AcceptedCurrency, AlphaNumeric, AppointmentDetails, type AppointmentDistAlg, AppointmentSeverity, ClientForm, ClientIdentity, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyInviteList, CompanyNotifications, type CompanyPartnerRole, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, CompanyUser, type CompanyUserRole, CompanyUserSession, type CompanyUserStatus, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, type Industry, InviteResponse, InvoiceNo, MedicalDetails, Medicine, MiniAppointmentDetails, MiniCompanyUser, MutableAppointmentDetails, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, Notification, PaymentDetails, type PaymentMethod, PriceMod, PriceModList, PriceTag, Reason, Receipts, ScheduleAppointmentForm, StandardTime, TicketNo, type Tier, TierList, TimeLog, Timestamp, Trn, UserDetails, Version, Vitals, acceptedCurrencies, adminRoles, appointmentDistAlgs, calcBalance, calcPriceMod, companyPartnerRoles, companyServiceSelectors, companyUserRoles, companyUserStatus, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, industries, normalizeCompanyId, normalizeNidKey, parseClientName, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
package/dist/main.js CHANGED
@@ -778,7 +778,7 @@ var MedicalDetails = z20.object({
778
778
  import { sumOf as sumOf2 } from "@wavy/fn";
779
779
  import * as z21 from "zod";
780
780
 
781
- // src/functions/calculations.ts
781
+ // src/functions/calc.ts
782
782
  import { sumOf } from "@wavy/fn";
783
783
  function calcBalance(components, options) {
784
784
  const subtotal = sumOf(
@@ -809,11 +809,16 @@ var TimelineActivity = z21.object({
809
809
  postedAt: Timestamp.nullish(),
810
810
  userUid: CompanyUser.shape._id.nonoptional()
811
811
  });
812
+ var AppointmentSeverity = z21.object({
813
+ 1: z21.literal("Emergency"),
814
+ 2: z21.literal("Important"),
815
+ 3: z21.literal("Average")
816
+ });
812
817
  var MiniAppointmentDetails = z21.object({
813
818
  /** A random uid that identifies the document. */
814
819
  _id: z21.uuidv4(),
815
820
  // This helps to identify the urgency of the appointment
816
- category: z21.int().min(1).max(3),
821
+ severity: z21.string().refine((data) => AppointmentSeverity.keyof().safeParse(data).success),
817
822
  /** The company's uid */
818
823
  src: CompanyState.shape._id,
819
824
  /** The ticket number */
@@ -903,7 +908,7 @@ var MutableAppointmentDetails = AppointmentDetails.safeExtend(
903
908
  var ScheduleAppointmentForm = z21.object({
904
909
  clientId: ClientIdentity.shape._id,
905
910
  serviceProviderId: CompanyUser.shape._id.or(z21.literal("next")),
906
- category: AppointmentDetails.shape.category,
911
+ category: AppointmentDetails.shape.severity,
907
912
  appointmentReason: AppointmentDetails.shape.reason,
908
913
  charges: AppointmentDetails.shape.charges.optional(),
909
914
  prepayments: AppointmentDetails.shape.prepayments.optional(),
@@ -1053,7 +1058,7 @@ async function scheduleAppointment(request) {
1053
1058
  _id: v4(),
1054
1059
  src: stateCopy._id,
1055
1060
  tkt: request.state.tktNoCounter,
1056
- category: request.form.category,
1061
+ severity: request.form.category,
1057
1062
  discounts: Object.fromEntries(
1058
1063
  Object.entries(request.billing.discounts || {}).filter(
1059
1064
  ([_, disc]) => !disc.isOptional
@@ -1111,6 +1116,7 @@ function createNotifId(options) {
1111
1116
  export {
1112
1117
  AlphaNumeric,
1113
1118
  AppointmentDetails,
1119
+ AppointmentSeverity,
1114
1120
  ClientForm,
1115
1121
  ClientIdentity,
1116
1122
  CompanyBilling,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.101",
3
+ "version": "0.0.102",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",