@bizmap/sdk 0.0.128 → 0.0.130
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 +67 -57
- package/dist/main.js +25 -22
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -115,7 +115,7 @@ declare const CompanyDetails: z.ZodObject<{
|
|
|
115
115
|
tktNo: z.ZodInt;
|
|
116
116
|
}, z.core.$strip>;
|
|
117
117
|
}, z.core.$strip>;
|
|
118
|
-
|
|
118
|
+
preference: z.ZodObject<{
|
|
119
119
|
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
120
120
|
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
121
121
|
serviceSelector: z.ZodEnum<{
|
|
@@ -484,7 +484,7 @@ declare const CompanyNotifications: z.ZodArray<z.ZodObject<{
|
|
|
484
484
|
}, z.core.$strip>>;
|
|
485
485
|
type CompanyNotifications = z.infer<typeof CompanyNotifications>;
|
|
486
486
|
|
|
487
|
-
declare const
|
|
487
|
+
declare const CompanyPreference: z.ZodObject<{
|
|
488
488
|
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
489
489
|
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
490
490
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -499,7 +499,7 @@ declare const CompanyPreferences: z.ZodObject<{
|
|
|
499
499
|
}>;
|
|
500
500
|
servicesDeployed: z.ZodBoolean;
|
|
501
501
|
}, z.core.$strip>;
|
|
502
|
-
type
|
|
502
|
+
type CompanyPreference = z.infer<typeof CompanyPreference>;
|
|
503
503
|
declare const MutableCompanyPreferences: z.ZodObject<{
|
|
504
504
|
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
505
505
|
serviceSelector: z.ZodEnum<{
|
|
@@ -515,6 +515,15 @@ declare const MutableCompanyPreferences: z.ZodObject<{
|
|
|
515
515
|
}, z.core.$strip>;
|
|
516
516
|
type MutableCompanyPreferences = z.infer<typeof MutableCompanyPreferences>;
|
|
517
517
|
|
|
518
|
+
declare const CompanyMemberRoles: z.ZodPipe<z.ZodArray<z.ZodEnum<{
|
|
519
|
+
doc: "doc";
|
|
520
|
+
physAsst: "physAsst";
|
|
521
|
+
rcpst: "rcpst";
|
|
522
|
+
cshr: "cshr";
|
|
523
|
+
"a/r": "a/r";
|
|
524
|
+
ceo: "ceo";
|
|
525
|
+
}>>, z.ZodTransform<("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "ceo")[], ("doc" | "physAsst" | "rcpst" | "cshr" | "a/r" | "ceo")[]>>;
|
|
526
|
+
type CompanyMemberRoles = z.infer<typeof CompanyMemberRoles>;
|
|
518
527
|
declare const CompanyStaff: z.ZodObject<{
|
|
519
528
|
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
520
529
|
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
@@ -601,7 +610,57 @@ declare const CompanyState: z.ZodObject<{
|
|
|
601
610
|
}, z.core.$strip>;
|
|
602
611
|
type CompanyState = z.infer<typeof CompanyState>;
|
|
603
612
|
|
|
604
|
-
declare const
|
|
613
|
+
declare const ClientDetails: z.ZodObject<{
|
|
614
|
+
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
615
|
+
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
616
|
+
_id: z.ZodUUID;
|
|
617
|
+
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
618
|
+
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
619
|
+
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
620
|
+
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
621
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
622
|
+
dob: z.ZodISODateTime;
|
|
623
|
+
sex: z.ZodEnum<{
|
|
624
|
+
male: "male";
|
|
625
|
+
female: "female";
|
|
626
|
+
}>;
|
|
627
|
+
isGlobal: z.ZodBoolean;
|
|
628
|
+
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
629
|
+
visits: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodArray<z.ZodISODateTime>>>;
|
|
630
|
+
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
631
|
+
nid: z.ZodOptional<z.ZodObject<{
|
|
632
|
+
trn: z.ZodOptional<z.ZodString>;
|
|
633
|
+
nin: z.ZodOptional<z.ZodString>;
|
|
634
|
+
passportNo: z.ZodOptional<z.ZodString>;
|
|
635
|
+
}, z.core.$strip>>;
|
|
636
|
+
attributes: z.ZodOptional<z.ZodObject<{
|
|
637
|
+
motherMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
638
|
+
fatherMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
639
|
+
motherMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
640
|
+
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
641
|
+
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
642
|
+
}, z.core.$strip>>;
|
|
643
|
+
address: z.ZodOptional<z.ZodObject<{
|
|
644
|
+
streetAddress: z.ZodString;
|
|
645
|
+
city: z.ZodOptional<z.ZodString>;
|
|
646
|
+
parish: z.ZodString;
|
|
647
|
+
country: z.ZodString;
|
|
648
|
+
}, z.core.$strip>>;
|
|
649
|
+
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
650
|
+
}, z.core.$strip>;
|
|
651
|
+
type ClientDetails = z.infer<typeof ClientDetails>;
|
|
652
|
+
|
|
653
|
+
declare const ClientForm: z.ZodObject<{
|
|
654
|
+
firstName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
655
|
+
lastName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
656
|
+
middleName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
657
|
+
dob: z.ZodNonOptional<z.ZodISODateTime>;
|
|
658
|
+
sex: z.ZodNonOptional<z.ZodEnum<{
|
|
659
|
+
male: "male";
|
|
660
|
+
female: "female";
|
|
661
|
+
}>>;
|
|
662
|
+
}, z.core.$strip>;
|
|
663
|
+
type ClientForm = z.infer<typeof ClientForm>;
|
|
605
664
|
|
|
606
665
|
declare const CreateCompanyForm: z.ZodObject<{
|
|
607
666
|
_id: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
@@ -662,6 +721,8 @@ declare const CompanySession: z.ZodObject<{
|
|
|
662
721
|
}, z.core.$strip>;
|
|
663
722
|
type CompanySession = z.infer<typeof CompanySession>;
|
|
664
723
|
|
|
724
|
+
declare const COMPANY_USER_RELATIONSHIP: Partial<Record<CompanyUserRole, CompanyUserRole[]>>;
|
|
725
|
+
|
|
665
726
|
declare const TierList: z.ZodRecord<z.ZodEnum<{
|
|
666
727
|
basic: "basic";
|
|
667
728
|
pro: "pro";
|
|
@@ -851,62 +912,11 @@ declare const UserDetails: z.ZodObject<{
|
|
|
851
912
|
auto: z.ZodOptional<z.ZodISODateTime>;
|
|
852
913
|
manual: z.ZodOptional<z.ZodISODateTime>;
|
|
853
914
|
}, z.core.$strip>;
|
|
854
|
-
|
|
915
|
+
companyIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
|
|
855
916
|
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
856
917
|
}, z.core.$strip>;
|
|
857
918
|
type UserDetails = z.infer<typeof UserDetails>;
|
|
858
919
|
|
|
859
|
-
declare const ClientDetails: z.ZodObject<{
|
|
860
|
-
createdAt: z.ZodReadonly<z.ZodISODateTime>;
|
|
861
|
-
lastModified: z.ZodOptional<z.ZodISODateTime>;
|
|
862
|
-
_id: z.ZodUUID;
|
|
863
|
-
photoUrl: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
864
|
-
firstName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
865
|
-
middleName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
866
|
-
lastName: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
867
|
-
email: z.ZodOptional<z.ZodEmail>;
|
|
868
|
-
dob: z.ZodISODateTime;
|
|
869
|
-
sex: z.ZodEnum<{
|
|
870
|
-
male: "male";
|
|
871
|
-
female: "female";
|
|
872
|
-
}>;
|
|
873
|
-
isGlobal: z.ZodBoolean;
|
|
874
|
-
origin: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
875
|
-
visits: z.ZodOptional<z.ZodRecord<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodArray<z.ZodISODateTime>>>;
|
|
876
|
-
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
877
|
-
nid: z.ZodOptional<z.ZodObject<{
|
|
878
|
-
trn: z.ZodOptional<z.ZodString>;
|
|
879
|
-
nin: z.ZodOptional<z.ZodString>;
|
|
880
|
-
passportNo: z.ZodOptional<z.ZodString>;
|
|
881
|
-
}, z.core.$strip>>;
|
|
882
|
-
attributes: z.ZodOptional<z.ZodObject<{
|
|
883
|
-
motherMaidenName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
884
|
-
fatherMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
885
|
-
motherMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
886
|
-
oldestSiblingMiddleName: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
887
|
-
firstSchoolName: z.ZodOptional<z.ZodString>;
|
|
888
|
-
}, z.core.$strip>>;
|
|
889
|
-
address: z.ZodOptional<z.ZodObject<{
|
|
890
|
-
streetAddress: z.ZodString;
|
|
891
|
-
city: z.ZodOptional<z.ZodString>;
|
|
892
|
-
parish: z.ZodString;
|
|
893
|
-
country: z.ZodString;
|
|
894
|
-
}, z.core.$strip>>;
|
|
895
|
-
linkedTo: z.ZodOptional<z.ZodUUID>;
|
|
896
|
-
}, z.core.$strip>;
|
|
897
|
-
type ClientDetails = z.infer<typeof ClientDetails>;
|
|
898
|
-
declare const ClientForm: z.ZodObject<{
|
|
899
|
-
firstName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
900
|
-
lastName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
901
|
-
middleName: z.ZodNonOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
902
|
-
dob: z.ZodNonOptional<z.ZodISODateTime>;
|
|
903
|
-
sex: z.ZodNonOptional<z.ZodEnum<{
|
|
904
|
-
male: "male";
|
|
905
|
-
female: "female";
|
|
906
|
-
}>>;
|
|
907
|
-
}, z.core.$strip>;
|
|
908
|
-
type ClientForm = z.infer<typeof ClientForm>;
|
|
909
|
-
|
|
910
920
|
declare const ServiceSeverity: z.ZodObject<{
|
|
911
921
|
"1": z.ZodLiteral<"Emergency">;
|
|
912
922
|
"2": z.ZodLiteral<"Important">;
|
|
@@ -1208,4 +1218,4 @@ declare function createNotifId(options?: {
|
|
|
1208
1218
|
to: string;
|
|
1209
1219
|
}): string;
|
|
1210
1220
|
|
|
1211
|
-
export { type AcceptedCurrency, AlphaNumeric, COMPANY_USER_RELATIONSHIP, ClientDetails, ClientForm, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyIndustry, CompanyNotifications,
|
|
1221
|
+
export { type AcceptedCurrency, AlphaNumeric, COMPANY_USER_RELATIONSHIP, ClientDetails, ClientForm, CompanyBilling, CompanyDetails, CompanyIdentity, CompanyIndustry, CompanyMemberRoles, CompanyNotifications, CompanyPreference, 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, type ServiceDistAlg, ServiceSeverity, StandardTime, 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, safeParseSector, serviceDistAlgs, tiers, vitalKeys };
|
package/dist/main.js
CHANGED
|
@@ -186,7 +186,7 @@ var MutableCompanyBilling = CompanyBilling.omit({
|
|
|
186
186
|
import { Address, PhoneNumber } from "@wavy/util";
|
|
187
187
|
import * as z9 from "zod";
|
|
188
188
|
|
|
189
|
-
// src/schemas/company/
|
|
189
|
+
// src/schemas/company/entities/Industry.ts
|
|
190
190
|
import * as z8 from "zod";
|
|
191
191
|
var CompanyIndustry = z8.object({
|
|
192
192
|
healthcare: z8.object({
|
|
@@ -252,7 +252,7 @@ var MutableCompanyIdentity = CompanyIdentity.pick({
|
|
|
252
252
|
|
|
253
253
|
// src/schemas/company/components/Preferences.ts
|
|
254
254
|
import * as z10 from "zod";
|
|
255
|
-
var
|
|
255
|
+
var CompanyPreference = z10.object({
|
|
256
256
|
_id: CompanyState.shape._id,
|
|
257
257
|
/** The user that's allowed to record the client's services. */
|
|
258
258
|
serviceSelector: companyServiceSelectors,
|
|
@@ -269,7 +269,7 @@ var CompanyPreferences = z10.object({
|
|
|
269
269
|
(data) => !data.pps || data.pps && data.serviceSelector === "scheduler",
|
|
270
270
|
`Pay per service is only allowed when the service selector is the "${"scheduler"}".`
|
|
271
271
|
);
|
|
272
|
-
var MutableCompanyPreferences =
|
|
272
|
+
var MutableCompanyPreferences = CompanyPreference.omit({
|
|
273
273
|
_id: true,
|
|
274
274
|
lastModified: true
|
|
275
275
|
});
|
|
@@ -281,10 +281,10 @@ import * as z13 from "zod";
|
|
|
281
281
|
// src/functions/helper-functions.ts
|
|
282
282
|
import { camelCaseToLetter, upperFirst } from "@wavy/fn";
|
|
283
283
|
|
|
284
|
-
// src/schemas/
|
|
284
|
+
// src/schemas/company/entities/client/Details.ts
|
|
285
285
|
import * as z12 from "zod";
|
|
286
286
|
|
|
287
|
-
// src/schemas/
|
|
287
|
+
// src/schemas/user/Details.ts
|
|
288
288
|
import { UserModel } from "@wavy/util";
|
|
289
289
|
import * as z11 from "zod";
|
|
290
290
|
|
|
@@ -292,7 +292,7 @@ import * as z11 from "zod";
|
|
|
292
292
|
var NOTIF_ID_DELIM = "::";
|
|
293
293
|
var MAX_NAME_LENGTH = 21;
|
|
294
294
|
|
|
295
|
-
// src/schemas/
|
|
295
|
+
// src/schemas/user/Details.ts
|
|
296
296
|
var UserDetails = z11.object({
|
|
297
297
|
...UserModel.shape,
|
|
298
298
|
_id: z11.uuidv4(),
|
|
@@ -320,12 +320,12 @@ var UserDetails = z11.object({
|
|
|
320
320
|
auto: Timestamp,
|
|
321
321
|
manual: Timestamp
|
|
322
322
|
}).partial(),
|
|
323
|
-
|
|
323
|
+
companyIds: z11.array(CompanyState.shape._id).min(1).optional(),
|
|
324
324
|
// resumeToken: z.uuidv4().optional(),
|
|
325
325
|
...TimeLog.shape
|
|
326
326
|
}).omit({ uid: true });
|
|
327
327
|
|
|
328
|
-
// src/schemas/
|
|
328
|
+
// src/schemas/company/entities/client/Details.ts
|
|
329
329
|
import { Address as Address2, PhoneNumber as PhoneNumber2 } from "@wavy/util";
|
|
330
330
|
var Name = z12.string().trim().min(2).max(MAX_NAME_LENGTH).transform((d) => d.replace(/-+/g, "-").replace(/'+/g, "'")).superRefine((data, ctx) => {
|
|
331
331
|
const invalidCharIdx = data.search(/[^a-z'-]/i);
|
|
@@ -374,15 +374,8 @@ var ClientDetails = UserDetails.pick({
|
|
|
374
374
|
linkedTo: UserDetails.shape._id.optional()
|
|
375
375
|
}).shape
|
|
376
376
|
);
|
|
377
|
-
var ClientForm = ClientDetails.pick({
|
|
378
|
-
firstName: true,
|
|
379
|
-
middleName: true,
|
|
380
|
-
lastName: true,
|
|
381
|
-
dob: true,
|
|
382
|
-
sex: true
|
|
383
|
-
}).required();
|
|
384
377
|
|
|
385
|
-
// src/schemas/company/
|
|
378
|
+
// src/schemas/company/entities/utils.ts
|
|
386
379
|
var COMPANY_USER_RELATIONSHIP = {
|
|
387
380
|
doc: ["physAsst"],
|
|
388
381
|
physAsst: ["doc"]
|
|
@@ -484,7 +477,7 @@ var CompanyDetails = z14.object({
|
|
|
484
477
|
// notifications: CompanyNotifications,
|
|
485
478
|
// receipts: Receipts,
|
|
486
479
|
state: CompanyState.omit({ _id: true }),
|
|
487
|
-
|
|
480
|
+
preference: CompanyPreference.omit({ _id: true }),
|
|
488
481
|
billing: CompanyBilling.omit({ _id: true }),
|
|
489
482
|
staff: CompanyStaff.omit({ _id: true })
|
|
490
483
|
});
|
|
@@ -609,7 +602,16 @@ var CompanyNotifications = z16.array(Notification).refine(
|
|
|
609
602
|
"A company can't receive a company invite."
|
|
610
603
|
);
|
|
611
604
|
|
|
612
|
-
// src/schemas/company/
|
|
605
|
+
// src/schemas/company/entities/client/Form.ts
|
|
606
|
+
var ClientForm = ClientDetails.pick({
|
|
607
|
+
firstName: true,
|
|
608
|
+
middleName: true,
|
|
609
|
+
lastName: true,
|
|
610
|
+
dob: true,
|
|
611
|
+
sex: true
|
|
612
|
+
}).required();
|
|
613
|
+
|
|
614
|
+
// src/schemas/company/entities/CreateCompanyForm.ts
|
|
613
615
|
import * as z17 from "zod";
|
|
614
616
|
var CreateCompanyForm = z17.object({
|
|
615
617
|
alias: CompanyIdentity.shape.alias.optional(),
|
|
@@ -629,7 +631,7 @@ var CreateCompanyForm = z17.object({
|
|
|
629
631
|
}
|
|
630
632
|
});
|
|
631
633
|
|
|
632
|
-
// src/schemas/company/
|
|
634
|
+
// src/schemas/company/entities/Session.ts
|
|
633
635
|
import * as z18 from "zod";
|
|
634
636
|
var CompanySession = z18.object({
|
|
635
637
|
_id: z18.uuidv4(),
|
|
@@ -650,7 +652,7 @@ var CompanySession = z18.object({
|
|
|
650
652
|
...TimeLog.shape
|
|
651
653
|
});
|
|
652
654
|
|
|
653
|
-
// src/schemas/company/
|
|
655
|
+
// src/schemas/company/entities/service/payloads/Medical.ts
|
|
654
656
|
import * as z19 from "zod";
|
|
655
657
|
var Vitals = z19.record(
|
|
656
658
|
vitalKeys,
|
|
@@ -685,7 +687,7 @@ var MedicalDetails = z19.object({
|
|
|
685
687
|
).optional()
|
|
686
688
|
});
|
|
687
689
|
|
|
688
|
-
// src/schemas/company/
|
|
690
|
+
// src/schemas/company/entities/service/ServiceDetails.ts
|
|
689
691
|
import * as z20 from "zod";
|
|
690
692
|
var ServiceSeverity = z20.object({
|
|
691
693
|
"1": z20.literal("Emergency"),
|
|
@@ -844,8 +846,9 @@ export {
|
|
|
844
846
|
CompanyDetails,
|
|
845
847
|
CompanyIdentity,
|
|
846
848
|
CompanyIndustry,
|
|
849
|
+
CompanyMemberRoles,
|
|
847
850
|
CompanyNotifications,
|
|
848
|
-
|
|
851
|
+
CompanyPreference,
|
|
849
852
|
CompanySession,
|
|
850
853
|
CompanyStaff,
|
|
851
854
|
CompanyState,
|