@bizmap/sdk 0.0.101 → 0.0.103

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,18 +1084,24 @@ 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
- reason: z.ZodOptional<z.ZodObject<{
1100
+ reason: z.ZodObject<{
1095
1101
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1096
1102
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1097
1103
  value: z.ZodString;
1098
- }, z.core.$strip>>;
1104
+ }, z.core.$strip>;
1099
1105
  invoiceNo: z.ZodOptional<z.ZodString>;
1100
1106
  charges: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodUUID, z.ZodObject<{
1101
1107
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
@@ -1302,12 +1308,12 @@ 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;
1306
- reason: z.ZodOptional<z.ZodObject<{
1311
+ severity: z.ZodString;
1312
+ reason: z.ZodObject<{
1307
1313
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1308
1314
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1309
1315
  value: z.ZodString;
1310
- }, z.core.$strip>>;
1316
+ }, z.core.$strip>;
1311
1317
  invoiceNo: z.ZodOptional<z.ZodString>;
1312
1318
  charges: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodUUID, z.ZodObject<{
1313
1319
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
@@ -1481,12 +1487,12 @@ 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;
1485
- reason: z.ZodOptional<z.ZodObject<{
1490
+ severity: z.ZodString;
1491
+ reason: z.ZodObject<{
1486
1492
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1487
1493
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1488
1494
  value: z.ZodString;
1489
- }, z.core.$strip>>;
1495
+ }, z.core.$strip>;
1490
1496
  invoiceNo: z.ZodOptional<z.ZodString>;
1491
1497
  charges: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodUUID, z.ZodObject<{
1492
1498
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
@@ -1589,12 +1595,12 @@ 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;
1593
- appointmentReason: z.ZodOptional<z.ZodObject<{
1598
+ category: z.ZodString;
1599
+ appointmentReason: z.ZodObject<{
1594
1600
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1595
1601
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
1596
1602
  value: z.ZodString;
1597
- }, z.core.$strip>>;
1603
+ }, z.core.$strip>;
1598
1604
  charges: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodUUID, z.ZodObject<{
1599
1605
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1600
1606
  lastModified: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
@@ -1714,7 +1720,12 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1714
1720
  _id: string;
1715
1721
  src: string;
1716
1722
  tkt: number;
1717
- category: number;
1723
+ severity: string;
1724
+ reason: {
1725
+ createdAt: string;
1726
+ value: string;
1727
+ lastModified?: string | null | undefined;
1728
+ };
1718
1729
  timeline: {
1719
1730
  scheduler: {
1720
1731
  userUid: string;
@@ -1831,11 +1842,6 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1831
1842
  lastModified?: string | null | undefined;
1832
1843
  }[] | undefined;
1833
1844
  } | null | undefined;
1834
- reason?: {
1835
- createdAt: string;
1836
- value: string;
1837
- lastModified?: string | null | undefined;
1838
- } | undefined;
1839
1845
  invoiceNo?: string | undefined;
1840
1846
  charges?: Record<string, {
1841
1847
  createdAt: 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 */
@@ -822,7 +827,7 @@ var MiniAppointmentDetails = z21.object({
822
827
  reason: z21.object({
823
828
  value: Reason.shape.value,
824
829
  ...TimeLog.shape
825
- }).optional(),
830
+ }),
826
831
  /**
827
832
  * This gets resolved after the service provider attaches an invoice and posts the client
828
833
  * (resolving after posting the client is required for consistency - if it's added when the
@@ -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,8 @@ 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,
1062
+ reason: request.form.appointmentReason,
1057
1063
  discounts: Object.fromEntries(
1058
1064
  Object.entries(request.billing.discounts || {}).filter(
1059
1065
  ([_, disc]) => !disc.isOptional
@@ -1111,6 +1117,7 @@ function createNotifId(options) {
1111
1117
  export {
1112
1118
  AlphaNumeric,
1113
1119
  AppointmentDetails,
1120
+ AppointmentSeverity,
1114
1121
  ClientForm,
1115
1122
  ClientIdentity,
1116
1123
  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.103",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",