@bizmap/sdk 0.0.106 → 0.0.107

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
@@ -45,12 +45,6 @@ declare const industries: z.ZodEnum<{
45
45
  healthcare: "healthcare";
46
46
  }>;
47
47
  type Industry = z.infer<typeof industries>;
48
- declare const companyUserStatus: z.ZodEnum<{
49
- inviteSent: "inviteSent";
50
- active: "active";
51
- inactive: "inactive";
52
- }>;
53
- type CompanyUserStatus = z.infer<typeof companyUserStatus>;
54
48
 
55
49
  declare const tiers: z.ZodEnum<{
56
50
  basic: "basic";
@@ -239,15 +233,9 @@ declare const CompanyDetails: z.ZodObject<{
239
233
  lastModified: z.ZodNullable<z.ZodISODateTime>;
240
234
  version: z.ZodInt;
241
235
  members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
242
- inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
243
236
  lastModified: z.ZodNullable<z.ZodISODateTime>;
244
237
  email: z.ZodEmail;
245
238
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
246
- status: z.ZodEnum<{
247
- inviteSent: "inviteSent";
248
- active: "active";
249
- inactive: "inactive";
250
- }>;
251
239
  isBusy: z.ZodObject<{
252
240
  value: z.ZodBoolean;
253
241
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -261,8 +249,10 @@ declare const CompanyDetails: z.ZodObject<{
261
249
  "a/r": "a/r";
262
250
  founder: "founder";
263
251
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[]>>;
264
- lastActive: z.ZodNullable<z.ZodISODateTime>;
252
+ lastOnline: z.ZodNullable<z.ZodISODateTime>;
253
+ inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
265
254
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
255
+ isOnline: z.ZodBoolean;
266
256
  }, z.core.$strip>>;
267
257
  partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
268
258
  addedAt: z.ZodISODateTime;
@@ -615,15 +605,9 @@ type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
615
605
 
616
606
  declare const CompanyStaff: z.ZodObject<{
617
607
  members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
618
- inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
619
608
  lastModified: z.ZodNullable<z.ZodISODateTime>;
620
609
  email: z.ZodEmail;
621
610
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
622
- status: z.ZodEnum<{
623
- inviteSent: "inviteSent";
624
- active: "active";
625
- inactive: "inactive";
626
- }>;
627
611
  isBusy: z.ZodObject<{
628
612
  value: z.ZodBoolean;
629
613
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -637,8 +621,10 @@ declare const CompanyStaff: z.ZodObject<{
637
621
  "a/r": "a/r";
638
622
  founder: "founder";
639
623
  }>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[]>>;
640
- lastActive: z.ZodNullable<z.ZodISODateTime>;
624
+ lastOnline: z.ZodNullable<z.ZodISODateTime>;
625
+ inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
641
626
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
627
+ isOnline: z.ZodBoolean;
642
628
  }, z.core.$strip>>;
643
629
  _id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
644
630
  partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
@@ -722,7 +708,7 @@ declare const CompanyUserSession: z.ZodObject<{
722
708
  }, z.core.$strip>;
723
709
  type CompanyUserSession = z.infer<typeof CompanyUserSession>;
724
710
  declare const MiniCompanyUser: z.ZodObject<{
725
- lastActive: z.ZodNullable<z.ZodISODateTime>;
711
+ lastOnline: z.ZodNullable<z.ZodISODateTime>;
726
712
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
727
713
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
728
714
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -743,15 +729,11 @@ declare const MiniCompanyUser: z.ZodObject<{
743
729
  }, z.core.$strip>;
744
730
  type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
745
731
  declare const CompanyUser: z.ZodObject<{
746
- status: z.ZodEnum<{
747
- inviteSent: "inviteSent";
748
- active: "active";
749
- inactive: "inactive";
750
- }>;
732
+ isOnline: z.ZodBoolean;
751
733
  _id: z.ZodUUID;
752
734
  email: z.ZodEmail;
753
735
  name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
754
- lastActive: z.ZodNullable<z.ZodISODateTime>;
736
+ lastOnline: z.ZodNullable<z.ZodISODateTime>;
755
737
  inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
756
738
  inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
757
739
  lastModified: z.ZodNullable<z.ZodISODateTime>;
@@ -1688,15 +1670,15 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
1688
1670
  lastModified: string | null;
1689
1671
  email: string;
1690
1672
  name: string;
1691
- status: "inviteSent" | "active" | "inactive";
1692
1673
  isBusy: {
1693
1674
  value: boolean;
1694
1675
  lastModified: string | null;
1695
1676
  };
1696
1677
  appointments: Record<"ongoing" | "completed", number>;
1697
1678
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
1698
- lastActive: string | null;
1679
+ lastOnline: string | null;
1699
1680
  inviteAccepted: string | null;
1681
+ isOnline: boolean;
1700
1682
  inviteSent?: string | null | undefined;
1701
1683
  }>;
1702
1684
  _id: string;
@@ -1897,11 +1879,11 @@ declare function findNextAvailableStaff(userUids: string[], algorithm: CompanyPr
1897
1879
  * @returns {(CompanyUser|MiniCompanyUser)[]|null} an array of the users that have conflicting roles or roles that are
1898
1880
  * incompatible with the other partners, or null if none was found. */
1899
1881
  declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyUser)[]) => ({
1900
- status: "inviteSent" | "active" | "inactive";
1882
+ isOnline: boolean;
1901
1883
  _id: string;
1902
1884
  email: string;
1903
1885
  name: string;
1904
- lastActive: string | null;
1886
+ lastOnline: string | null;
1905
1887
  inviteAccepted: string | null;
1906
1888
  lastModified: string | null;
1907
1889
  isBusy: {
@@ -1912,7 +1894,7 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
1912
1894
  roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
1913
1895
  inviteSent?: string | null | undefined;
1914
1896
  } | {
1915
- lastActive: string | null;
1897
+ lastOnline: string | null;
1916
1898
  inviteAccepted: string | null;
1917
1899
  lastModified: string | null;
1918
1900
  isBusy: {
@@ -1938,4 +1920,4 @@ declare function createNotifId(options?: {
1938
1920
  to: string;
1939
1921
  }): string;
1940
1922
 
1941
- 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, MAX_COMPANY_PRICE_MODS, 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 };
1923
+ 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, CreateCompanyForm, CreditCurrency, type EmployeeRole, type Gender, type HealthcareProviderRole, type Industry, InviteResponse, InvoiceNo, MAX_COMPANY_PRICE_MODS, 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, createNotifId, employeeRoles, findAvailableStaff, findConflictingPartners, findNextAvailableStaff, genders, getCompatibleRoles, healthcareProviderRoles, industries, normalizeCompanyId, normalizeNidKey, parseClientName, paymentMethods, scheduleAppointment, serviceProviders, tiers, vitalKeys };
package/dist/main.js CHANGED
@@ -25,7 +25,6 @@ var industries = z.enum([
25
25
  "healthcare"
26
26
  // "Pharmaceutical",
27
27
  ]);
28
- var companyUserStatus = z.enum(["inviteSent", "active", "inactive"]);
29
28
 
30
29
  // src/enums/Global.ts
31
30
  import { currencies } from "@wavy/util";
@@ -591,18 +590,16 @@ var MiniCompanyUser2 = z15.object({
591
590
  appointments: true
592
591
  }).shape,
593
592
  /** The time before the company session gets deleted */
594
- lastActive: Timestamp.nullable(),
593
+ lastOnline: Timestamp.nullable(),
595
594
  inviteSent: Timestamp.nullish(),
596
595
  inviteAccepted: Timestamp.nullable()
597
596
  });
598
597
  var CompanyUser = z15.object({
599
598
  ...MiniCompanyUser2.shape,
600
599
  ...CompanyUserSession.shape.user.shape,
601
- // Determined based on:
602
- // [1] where the data was retrieved from (if it is from the session pool then status === "active")
603
- // [2] user's roles
604
- // [3] inviteSent timestamp (if it )
605
- status: companyUserStatus
600
+ // Only true when the user's data is retrieved from the session pool
601
+ // NB: This property is purely cosmetic (so need to store this on the server)
602
+ isOnline: z15.boolean()
606
603
  });
607
604
 
608
605
  // src/schemas/company/components/Staff.ts
@@ -926,7 +923,7 @@ function findAvailableStaff(role, staff) {
926
923
  return Object.keys(role === "doc" ? staff.partnerMap : staff.members).filter(
927
924
  (uid) => {
928
925
  const user = staff.members[uid];
929
- return !(uid in staff.updateQueue) && user.roles.includes(role) && user.status === "active";
926
+ return !(uid in staff.updateQueue) && user.roles.includes(role) && user.isOnline;
930
927
  }
931
928
  );
932
929
  }
@@ -1170,7 +1167,6 @@ export {
1170
1167
  companyPartnerRoles,
1171
1168
  companyServiceSelectors,
1172
1169
  companyUserRoles,
1173
- companyUserStatus,
1174
1170
  createNotifId,
1175
1171
  employeeRoles,
1176
1172
  findAvailableStaff,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bizmap/sdk",
3
- "version": "0.0.106",
3
+ "version": "0.0.107",
4
4
  "main": "./dist/main.js",
5
5
  "types": "./dist/main.d.ts",
6
6
  "type": "module",