@bizmap/sdk 0.0.122 → 0.0.124

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
@@ -634,6 +634,35 @@ declare const CompanyIndustry: z.ZodObject<{
634
634
  }, z.core.$strip>;
635
635
  }, z.core.$strip>;
636
636
 
637
+ declare const CompanySession: z.ZodObject<{
638
+ createdAt: z.ZodReadonly<z.ZodISODateTime>;
639
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
640
+ _id: z.ZodUUID;
641
+ userId: z.ZodUUID;
642
+ companyId: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
643
+ deviceId: z.ZodString;
644
+ isAvailable: z.ZodObject<{
645
+ value: z.ZodBoolean;
646
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
647
+ }, z.core.$strip>;
648
+ isBusy: z.ZodObject<{
649
+ value: z.ZodBoolean;
650
+ lastModified: z.ZodOptional<z.ZodISODateTime>;
651
+ }, z.core.$strip>;
652
+ taskCounter: z.ZodRecord<z.ZodLiteral<"undone" | "done">, z.ZodInt>;
653
+ roles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
654
+ doc: "doc";
655
+ physAsst: "physAsst";
656
+ rcpst: "rcpst";
657
+ cshr: "cshr";
658
+ "a/r": "a/r";
659
+ ceo: "ceo";
660
+ }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "ceo")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "ceo")[]>>;
661
+ ttl: z.ZodNumber;
662
+ expiresAfter: z.ZodDate;
663
+ }, z.core.$strip>;
664
+ type CompanySession = z.infer<typeof CompanySession>;
665
+
637
666
  declare const TierList: z.ZodRecord<z.ZodEnum<{
638
667
  basic: "basic";
639
668
  pro: "pro";
@@ -879,13 +908,13 @@ declare const ClientForm: z.ZodObject<{
879
908
  }, z.core.$strip>;
880
909
  type ClientForm = z.infer<typeof ClientForm>;
881
910
 
882
- declare const TaskSeverity: z.ZodObject<{
911
+ declare const ServiceSeverity: z.ZodObject<{
883
912
  "1": z.ZodLiteral<"Emergency">;
884
913
  "2": z.ZodLiteral<"Important">;
885
914
  "3": z.ZodLiteral<"Average">;
886
915
  }, z.core.$strip>;
887
- type TaskSeverity = z.infer<typeof TaskSeverity>;
888
- declare const TaskDetails: z.ZodObject<{
916
+ type ServiceSeverity = z.infer<typeof ServiceSeverity>;
917
+ declare const ServiceDetails: z.ZodObject<{
889
918
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
890
919
  lastModified: z.ZodOptional<z.ZodISODateTime>;
891
920
  _id: z.ZodUUID;
@@ -1020,8 +1049,8 @@ declare const TaskDetails: z.ZodObject<{
1020
1049
  changes: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>;
1021
1050
  }, z.core.$strip>>>;
1022
1051
  }, z.core.$strip>;
1023
- type TaskDetails = z.infer<typeof TaskDetails>;
1024
- declare const MutableTaskDetails: z.ZodObject<{
1052
+ type ServiceDetails = z.infer<typeof ServiceDetails>;
1053
+ declare const MutableServiceDetails: z.ZodObject<{
1025
1054
  createdAt: z.ZodReadonly<z.ZodISODateTime>;
1026
1055
  lastModified: z.ZodOptional<z.ZodISODateTime>;
1027
1056
  _id: z.ZodUUID;
@@ -1157,10 +1186,10 @@ declare const MutableTaskDetails: z.ZodObject<{
1157
1186
  }, z.core.$strip>>>;
1158
1187
  _hash: z.ZodString;
1159
1188
  }, z.core.$strip>;
1160
- type MutableTaskDetails = z.infer<typeof MutableTaskDetails>;
1189
+ type MutableServiceDetails = z.infer<typeof MutableServiceDetails>;
1161
1190
 
1162
1191
  /** @disclaimer This doesn't handle currency conversion */
1163
- declare function calcBalance(components: Prettify<Partial<Pick<TaskDetails, "charges" | "discounts" | "additionalFees" | "prepayments" | "payments">>>, options?: {
1192
+ declare function calcBalance(components: Prettify<Partial<Pick<ServiceDetails, "charges" | "discounts" | "additionalFees" | "prepayments" | "payments">>>, options?: {
1164
1193
  logger?: boolean;
1165
1194
  }): number;
1166
1195
  declare const calcPriceMod: (mods: PriceModList | null | undefined, subtotal: number) => number;
@@ -1180,4 +1209,4 @@ declare function createNotifId(options?: {
1180
1209
  to: string;
1181
1210
  }): string;
1182
1211
 
1183
- export { type AcceptedCurrency, AlphaNumeric, COMPANY_USER_RELATIONSHIP, ClientDetails, ClientForm, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyIndustry, CompanyNotifications, CompanyPreferences, type CompanyServiceSelector, CompanyStaff, CompanyState, type CompanyUserRole, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, InviteResponse, InvoiceNo, MAX_COMPANY_PRICE_MODS, MedicalDetails, Medicine, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, MutableCompanyStaff, MutableTaskDetails, Notification, PaymentDetails, type PaymentMethod, PriceMod, PriceModList, PriceTag, Reason, Receipts, StandardTime, TaskDetails, type TaskDistAlg, TaskSeverity, TicketNo, type Tier, TierList, TimeLog, Timestamp, Trn, UserDetails, Vitals, acceptedCurrencies, adminRoles, calcBalance, calcPriceMod, companyServiceSelectors, companyUserRoles, createNotifId, employeeRoles, genders, getCompatibleRoles, getIncompatibleRoles, healthcareProviderRoles, normalizeCompanyId, normalizeNidKey, parseClientName, paymentMethods, taskDistAlgs, tiers, vitalKeys };
1212
+ export { type AcceptedCurrency, AlphaNumeric, COMPANY_USER_RELATIONSHIP, ClientDetails, ClientForm, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyIndustry, CompanyNotifications, CompanyPreferences, type CompanyServiceSelector, CompanySession, CompanyStaff, CompanyState, type CompanyUserRole, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, InviteResponse, InvoiceNo, MAX_COMPANY_PRICE_MODS, MedicalDetails, Medicine, MutableCompanyBilling, MutableCompanyDetails, MutableCompanyIdentity, MutableCompanyPreferences, MutableCompanyStaff, MutableServiceDetails, Notification, PaymentDetails, type PaymentMethod, PriceMod, PriceModList, PriceTag, Reason, Receipts, ServiceDetails, ServiceSeverity, StandardTime, type TaskDistAlg, TicketNo, type Tier, TierList, TimeLog, Timestamp, Trn, UserDetails, Vitals, acceptedCurrencies, adminRoles, calcBalance, calcPriceMod, companyServiceSelectors, companyUserRoles, createNotifId, employeeRoles, genders, getCompatibleRoles, getIncompatibleRoles, healthcareProviderRoles, normalizeCompanyId, normalizeNidKey, parseClientName, paymentMethods, taskDistAlgs, tiers, vitalKeys };
package/dist/main.js CHANGED
@@ -186,7 +186,7 @@ var MutableCompanyBilling = CompanyBilling.omit({
186
186
  import * as z9 from "zod";
187
187
  import { Address, PhoneNumber } from "@wavy/util";
188
188
 
189
- // src/schemas/company/utils/CompanyIndustry.ts
189
+ // src/schemas/company/core/CompanyIndustry.ts
190
190
  import * as z8 from "zod";
191
191
  var CompanyIndustry = z8.object({
192
192
  healthcare: z8.object({
@@ -198,7 +198,7 @@ var CompanyIndustry = z8.object({
198
198
  })
199
199
  });
200
200
 
201
- // src/schemas/company/utils/utils.ts
201
+ // src/schemas/company/core/utils.ts
202
202
  var getInvalidSectorError = (industry, sector) => `Invalid sector: "${sector}" isn't a sector under the "${industry}" industry.`;
203
203
  var COMPANY_USER_RELATIONSHIP = {
204
204
  doc: ["physAsst"],
@@ -409,7 +409,7 @@ var parseClientName = ({
409
409
  lastName
410
410
  }) => [firstName, middleName[0] + ".", lastName].join(" ");
411
411
 
412
- // src/schemas/company/utils/CompanySession.ts
412
+ // src/schemas/company/core/CompanySession.ts
413
413
  import * as z13 from "zod";
414
414
  var CompanySession = z13.object({
415
415
  _id: z13.uuidv4(),
@@ -438,7 +438,7 @@ var CompanyMemberRoles = z14.array(companyUserRoles).transform((roles) => distin
438
438
  (role) => getIncompatibleRoles(role).some((r) => roles.includes(r))
439
439
  );
440
440
  }, "A user is not allowed to have conflicting roles.");
441
- var CompanyStaff2 = z14.object({
441
+ var CompanyStaff = z14.object({
442
442
  _id: CompanyState.shape._id,
443
443
  members: z14.record(
444
444
  UserDetails.shape._id,
@@ -489,7 +489,7 @@ var CompanyStaff2 = z14.object({
489
489
  }
490
490
  }
491
491
  });
492
- var MutableCompanyStaff = CompanyStaff2.pick({
492
+ var MutableCompanyStaff = CompanyStaff.pick({
493
493
  updateQueue: true,
494
494
  partnerMap: true
495
495
  });
@@ -503,7 +503,7 @@ var CompanyDetails = z15.object({
503
503
  state: CompanyState.omit({ _id: true }),
504
504
  preferences: CompanyPreferences.omit({ _id: true }),
505
505
  billing: CompanyBilling.omit({ _id: true }),
506
- staff: CompanyStaff2.omit({ _id: true })
506
+ staff: CompanyStaff.omit({ _id: true })
507
507
  });
508
508
  var MutableCompanyDetails = z15.object({
509
509
  _id: CompanyDetails.shape._id,
@@ -626,7 +626,7 @@ var CompanyNotifications = z17.array(Notification).refine(
626
626
  "A company can't receive a company invite."
627
627
  );
628
628
 
629
- // src/schemas/company/utils/CreateCompanyForm.ts
629
+ // src/schemas/company/core/CreateCompanyForm.ts
630
630
  import * as z18 from "zod";
631
631
  var CreateCompanyForm = z18.object({
632
632
  alias: CompanyIdentity.shape.alias.optional(),
@@ -645,7 +645,7 @@ var CreateCompanyForm = z18.object({
645
645
  }
646
646
  });
647
647
 
648
- // src/schemas/task/components/Medical.ts
648
+ // src/schemas/company/core/service/components/Medical.ts
649
649
  import * as z19 from "zod";
650
650
  var Vitals = z19.record(
651
651
  vitalKeys,
@@ -680,20 +680,20 @@ var MedicalDetails = z19.object({
680
680
  ).optional()
681
681
  });
682
682
 
683
- // src/schemas/task/Task.ts
683
+ // src/schemas/company/core/service/ServiceDetails.ts
684
684
  import * as z20 from "zod";
685
- var TaskSeverity = z20.object({
685
+ var ServiceSeverity = z20.object({
686
686
  "1": z20.literal("Emergency"),
687
687
  "2": z20.literal("Important"),
688
688
  "3": z20.literal("Average")
689
689
  });
690
- var TaskDetails = z20.object({
690
+ var ServiceDetails = z20.object({
691
691
  /** A random uid that identifies the document. */
692
692
  _id: z20.uuidv4(),
693
693
  /** The amount of credits used to create the appointment */
694
694
  _cost: z20.number().readonly(),
695
695
  // This helps to identify the urgency of the appointment
696
- severity: z20.string().refine((data) => TaskSeverity.keyof().safeParse(data).success),
696
+ severity: z20.string().refine((data) => ServiceSeverity.keyof().safeParse(data).success),
697
697
  /** The company's uid */
698
698
  src: CompanyState.shape._id,
699
699
  /** The ticket number */
@@ -778,7 +778,7 @@ var TaskDetails = z20.object({
778
778
  // } satisfies Record<z.infer<typeof serviceProviders>, any>),
779
779
  ...TimeLog.shape
780
780
  });
781
- var MutableTaskDetails = TaskDetails.safeExtend(
781
+ var MutableServiceDetails = ServiceDetails.safeExtend(
782
782
  z20.object({
783
783
  /**
784
784
  * @description An encrypted copy of the last state of the appointment.
@@ -841,7 +841,8 @@ export {
841
841
  CompanyIndustry,
842
842
  CompanyNotifications,
843
843
  CompanyPreferences,
844
- CompanyStaff2 as CompanyStaff,
844
+ CompanySession,
845
+ CompanyStaff,
845
846
  CompanyState,
846
847
  CreateCompanyForm,
847
848
  CreditCurrency,
@@ -855,7 +856,7 @@ export {
855
856
  MutableCompanyIdentity,
856
857
  MutableCompanyPreferences,
857
858
  MutableCompanyStaff,
858
- MutableTaskDetails,
859
+ MutableServiceDetails,
859
860
  Notification,
860
861
  PaymentDetails,
861
862
  PriceMod,
@@ -863,9 +864,9 @@ export {
863
864
  PriceTag,
864
865
  Reason,
865
866
  Receipts,
867
+ ServiceDetails,
868
+ ServiceSeverity,
866
869
  StandardTime,
867
- TaskDetails,
868
- TaskSeverity,
869
870
  TicketNo,
870
871
  TierList,
871
872
  TimeLog,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.122",
3
+ "version": "0.0.124",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",