@bizmap/sdk 0.0.105 → 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 +16 -33
- package/dist/main.js +8 -10
- package/package.json +1 -1
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
|
-
|
|
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;
|
|
@@ -398,6 +388,7 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
398
388
|
}, z.core.$strip>;
|
|
399
389
|
type MutableCompanyDetails = z.infer<typeof MutableCompanyDetails>;
|
|
400
390
|
|
|
391
|
+
declare const MAX_COMPANY_PRICE_MODS = 100;
|
|
401
392
|
declare const CompanyBilling: z.ZodObject<{
|
|
402
393
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
403
394
|
additionalFees: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
@@ -614,15 +605,9 @@ type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
|
|
|
614
605
|
|
|
615
606
|
declare const CompanyStaff: z.ZodObject<{
|
|
616
607
|
members: z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
617
|
-
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
618
608
|
lastModified: z.ZodNullable<z.ZodISODateTime>;
|
|
619
609
|
email: z.ZodEmail;
|
|
620
610
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
621
|
-
status: z.ZodEnum<{
|
|
622
|
-
inviteSent: "inviteSent";
|
|
623
|
-
active: "active";
|
|
624
|
-
inactive: "inactive";
|
|
625
|
-
}>;
|
|
626
611
|
isBusy: z.ZodObject<{
|
|
627
612
|
value: z.ZodBoolean;
|
|
628
613
|
lastModified: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -636,8 +621,10 @@ declare const CompanyStaff: z.ZodObject<{
|
|
|
636
621
|
"a/r": "a/r";
|
|
637
622
|
founder: "founder";
|
|
638
623
|
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[]>>;
|
|
639
|
-
|
|
624
|
+
lastOnline: z.ZodNullable<z.ZodISODateTime>;
|
|
625
|
+
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
640
626
|
inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
|
|
627
|
+
isOnline: z.ZodBoolean;
|
|
641
628
|
}, z.core.$strip>>;
|
|
642
629
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
643
630
|
partnerMap: z.ZodRecord<z.ZodUUID, z.ZodRecord<z.ZodUUID, z.ZodObject<{
|
|
@@ -721,7 +708,7 @@ declare const CompanyUserSession: z.ZodObject<{
|
|
|
721
708
|
}, z.core.$strip>;
|
|
722
709
|
type CompanyUserSession = z.infer<typeof CompanyUserSession>;
|
|
723
710
|
declare const MiniCompanyUser: z.ZodObject<{
|
|
724
|
-
|
|
711
|
+
lastOnline: z.ZodNullable<z.ZodISODateTime>;
|
|
725
712
|
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
726
713
|
inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
|
|
727
714
|
lastModified: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -742,15 +729,11 @@ declare const MiniCompanyUser: z.ZodObject<{
|
|
|
742
729
|
}, z.core.$strip>;
|
|
743
730
|
type MiniCompanyUser = z.infer<typeof MiniCompanyUser>;
|
|
744
731
|
declare const CompanyUser: z.ZodObject<{
|
|
745
|
-
|
|
746
|
-
inviteSent: "inviteSent";
|
|
747
|
-
active: "active";
|
|
748
|
-
inactive: "inactive";
|
|
749
|
-
}>;
|
|
732
|
+
isOnline: z.ZodBoolean;
|
|
750
733
|
_id: z.ZodUUID;
|
|
751
734
|
email: z.ZodEmail;
|
|
752
735
|
name: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
753
|
-
|
|
736
|
+
lastOnline: z.ZodNullable<z.ZodISODateTime>;
|
|
754
737
|
inviteSent: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
755
738
|
inviteAccepted: z.ZodNullable<z.ZodISODateTime>;
|
|
756
739
|
lastModified: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -1687,15 +1670,15 @@ declare function scheduleAppointment(request: RequestParameter): Promise<{
|
|
|
1687
1670
|
lastModified: string | null;
|
|
1688
1671
|
email: string;
|
|
1689
1672
|
name: string;
|
|
1690
|
-
status: "inviteSent" | "active" | "inactive";
|
|
1691
1673
|
isBusy: {
|
|
1692
1674
|
value: boolean;
|
|
1693
1675
|
lastModified: string | null;
|
|
1694
1676
|
};
|
|
1695
1677
|
appointments: Record<"ongoing" | "completed", number>;
|
|
1696
1678
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
|
|
1697
|
-
|
|
1679
|
+
lastOnline: string | null;
|
|
1698
1680
|
inviteAccepted: string | null;
|
|
1681
|
+
isOnline: boolean;
|
|
1699
1682
|
inviteSent?: string | null | undefined;
|
|
1700
1683
|
}>;
|
|
1701
1684
|
_id: string;
|
|
@@ -1896,11 +1879,11 @@ declare function findNextAvailableStaff(userUids: string[], algorithm: CompanyPr
|
|
|
1896
1879
|
* @returns {(CompanyUser|MiniCompanyUser)[]|null} an array of the users that have conflicting roles or roles that are
|
|
1897
1880
|
* incompatible with the other partners, or null if none was found. */
|
|
1898
1881
|
declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyUser)[]) => ({
|
|
1899
|
-
|
|
1882
|
+
isOnline: boolean;
|
|
1900
1883
|
_id: string;
|
|
1901
1884
|
email: string;
|
|
1902
1885
|
name: string;
|
|
1903
|
-
|
|
1886
|
+
lastOnline: string | null;
|
|
1904
1887
|
inviteAccepted: string | null;
|
|
1905
1888
|
lastModified: string | null;
|
|
1906
1889
|
isBusy: {
|
|
@@ -1911,7 +1894,7 @@ declare const findConflictingPartners: (...partners: (CompanyUser | MiniCompanyU
|
|
|
1911
1894
|
roles: ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "founder")[];
|
|
1912
1895
|
inviteSent?: string | null | undefined;
|
|
1913
1896
|
} | {
|
|
1914
|
-
|
|
1897
|
+
lastOnline: string | null;
|
|
1915
1898
|
inviteAccepted: string | null;
|
|
1916
1899
|
lastModified: string | null;
|
|
1917
1900
|
isBusy: {
|
|
@@ -1937,4 +1920,4 @@ declare function createNotifId(options?: {
|
|
|
1937
1920
|
to: string;
|
|
1938
1921
|
}): string;
|
|
1939
1922
|
|
|
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,
|
|
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";
|
|
@@ -179,8 +178,9 @@ var CompanyState = z7.object({
|
|
|
179
178
|
});
|
|
180
179
|
|
|
181
180
|
// src/schemas/company/components/Billing.ts
|
|
181
|
+
var MAX_COMPANY_PRICE_MODS = 100;
|
|
182
182
|
var createMod = (resource) => PriceModList.refine(
|
|
183
|
-
(d) => Object.values(d).length <=
|
|
183
|
+
(d) => Object.values(d).length <= MAX_COMPANY_PRICE_MODS,
|
|
184
184
|
`Adding more than 100 ${resource}s is prohibited.`
|
|
185
185
|
);
|
|
186
186
|
var CompanyBilling = z8.object({
|
|
@@ -590,18 +590,16 @@ var MiniCompanyUser2 = z15.object({
|
|
|
590
590
|
appointments: true
|
|
591
591
|
}).shape,
|
|
592
592
|
/** The time before the company session gets deleted */
|
|
593
|
-
|
|
593
|
+
lastOnline: Timestamp.nullable(),
|
|
594
594
|
inviteSent: Timestamp.nullish(),
|
|
595
595
|
inviteAccepted: Timestamp.nullable()
|
|
596
596
|
});
|
|
597
597
|
var CompanyUser = z15.object({
|
|
598
598
|
...MiniCompanyUser2.shape,
|
|
599
599
|
...CompanyUserSession.shape.user.shape,
|
|
600
|
-
//
|
|
601
|
-
//
|
|
602
|
-
|
|
603
|
-
// [3] inviteSent timestamp (if it )
|
|
604
|
-
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()
|
|
605
603
|
});
|
|
606
604
|
|
|
607
605
|
// src/schemas/company/components/Staff.ts
|
|
@@ -925,7 +923,7 @@ function findAvailableStaff(role, staff) {
|
|
|
925
923
|
return Object.keys(role === "doc" ? staff.partnerMap : staff.members).filter(
|
|
926
924
|
(uid) => {
|
|
927
925
|
const user = staff.members[uid];
|
|
928
|
-
return !(uid in staff.updateQueue) && user.roles.includes(role) && user.
|
|
926
|
+
return !(uid in staff.updateQueue) && user.roles.includes(role) && user.isOnline;
|
|
929
927
|
}
|
|
930
928
|
);
|
|
931
929
|
}
|
|
@@ -1134,6 +1132,7 @@ export {
|
|
|
1134
1132
|
CreditCurrency,
|
|
1135
1133
|
InviteResponse,
|
|
1136
1134
|
InvoiceNo,
|
|
1135
|
+
MAX_COMPANY_PRICE_MODS,
|
|
1137
1136
|
MedicalDetails,
|
|
1138
1137
|
Medicine,
|
|
1139
1138
|
MiniAppointmentDetails,
|
|
@@ -1168,7 +1167,6 @@ export {
|
|
|
1168
1167
|
companyPartnerRoles,
|
|
1169
1168
|
companyServiceSelectors,
|
|
1170
1169
|
companyUserRoles,
|
|
1171
|
-
companyUserStatus,
|
|
1172
1170
|
createNotifId,
|
|
1173
1171
|
employeeRoles,
|
|
1174
1172
|
findAvailableStaff,
|