@bizmap/sdk 0.0.113 → 0.0.114
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 +3 -10
- package/dist/main.js +10 -4
- package/package.json +1 -1
package/dist/main.d.ts
CHANGED
|
@@ -284,11 +284,6 @@ declare const MutableCompanyDetails: z.ZodObject<{
|
|
|
284
284
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
285
285
|
emailVerified: z.ZodBoolean;
|
|
286
286
|
}, z.core.$strip>>;
|
|
287
|
-
legal: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
288
|
-
regNo: z.ZodReadonly<z.ZodString>;
|
|
289
|
-
trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
-
gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
291
|
-
}, z.core.$strip>>>;
|
|
292
287
|
}, z.core.$strip>>;
|
|
293
288
|
preferences: z.ZodOptional<z.ZodObject<{
|
|
294
289
|
version: z.ZodOptional<z.ZodInt>;
|
|
@@ -541,11 +536,6 @@ declare const MutableCompanyIdentity: z.ZodObject<{
|
|
|
541
536
|
phoneNumber: z.ZodOptional<z.ZodString>;
|
|
542
537
|
emailVerified: z.ZodBoolean;
|
|
543
538
|
}, z.core.$strip>;
|
|
544
|
-
legal: z.ZodOptional<z.ZodObject<{
|
|
545
|
-
regNo: z.ZodReadonly<z.ZodString>;
|
|
546
|
-
trn: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
547
|
-
gctRegNo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
548
|
-
}, z.core.$strip>>;
|
|
549
539
|
}, z.core.$strip>;
|
|
550
540
|
type MutableCompanyIdentity = z.infer<typeof MutableCompanyIdentity>;
|
|
551
541
|
|
|
@@ -764,6 +754,7 @@ declare const CreateCompanyForm: z.ZodPipe<z.ZodObject<{
|
|
|
764
754
|
industry: z.ZodReadonly<z.ZodEnum<{
|
|
765
755
|
healthcare: "healthcare";
|
|
766
756
|
}>>;
|
|
757
|
+
sector: z.ZodString;
|
|
767
758
|
address: z.ZodNonOptional<z.ZodOptional<z.ZodObject<{
|
|
768
759
|
streetAddress: z.ZodString;
|
|
769
760
|
city: z.ZodOptional<z.ZodString>;
|
|
@@ -777,6 +768,7 @@ declare const CreateCompanyForm: z.ZodPipe<z.ZodObject<{
|
|
|
777
768
|
logo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
778
769
|
}, z.core.$strip>, z.ZodTransform<{
|
|
779
770
|
industry: "healthcare";
|
|
771
|
+
sector: string;
|
|
780
772
|
address: {
|
|
781
773
|
streetAddress: string;
|
|
782
774
|
parish: string;
|
|
@@ -790,6 +782,7 @@ declare const CreateCompanyForm: z.ZodPipe<z.ZodObject<{
|
|
|
790
782
|
logo?: string | null | undefined;
|
|
791
783
|
}, {
|
|
792
784
|
industry: "healthcare";
|
|
785
|
+
sector: string;
|
|
793
786
|
address: {
|
|
794
787
|
streetAddress: string;
|
|
795
788
|
parish: string;
|
package/dist/main.js
CHANGED
|
@@ -210,6 +210,9 @@ var CompanyIndustry = z9.object({
|
|
|
210
210
|
])
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
+
// src/schemas/company/utils/utils.ts
|
|
214
|
+
var getInvalidSectorError = (industry, sector) => `Invalid sector: "${sector}" isn't a sector under the "${industry}" industry.`;
|
|
215
|
+
|
|
213
216
|
// src/schemas/company/components/Identity.ts
|
|
214
217
|
var CompanyIdentity = z10.object({
|
|
215
218
|
_id: CompanyState.shape._id,
|
|
@@ -254,16 +257,14 @@ var CompanyIdentity = z10.object({
|
|
|
254
257
|
ctx.addIssue("Unverified companies can't have the legal field defined.");
|
|
255
258
|
}
|
|
256
259
|
if (!CompanyIndustry.shape[data.industry].safeParse(data.sector).success) {
|
|
257
|
-
ctx.addIssue(
|
|
258
|
-
`Invalid sector: "${data.sector}" isn't a sector under the "${data.industry}" industry.`
|
|
259
|
-
);
|
|
260
|
+
ctx.addIssue(getInvalidSectorError(data.industry, data.sector));
|
|
260
261
|
}
|
|
261
262
|
});
|
|
262
263
|
var MutableCompanyIdentity = CompanyIdentity.pick({
|
|
263
264
|
address: true,
|
|
264
265
|
contact: true,
|
|
265
266
|
logo: true,
|
|
266
|
-
legal: true,
|
|
267
|
+
// legal: true,
|
|
267
268
|
alias: true
|
|
268
269
|
});
|
|
269
270
|
|
|
@@ -748,12 +749,17 @@ var CreateCompanyForm = z20.object({
|
|
|
748
749
|
logo: CompanyIdentity.shape.logo.optional(),
|
|
749
750
|
...CompanyIdentity.shape.contact.pick({ email: true, phoneNumber: true }).shape,
|
|
750
751
|
industry: CompanyIdentity.shape.industry,
|
|
752
|
+
sector: CompanyIdentity.shape.sector,
|
|
751
753
|
address: CompanyIdentity.shape.address.nonoptional()
|
|
752
754
|
}).transform((data) => {
|
|
753
755
|
if (!("alias" in data)) {
|
|
754
756
|
data.alias = normalizeCompanyId(data._id);
|
|
755
757
|
}
|
|
756
758
|
return data;
|
|
759
|
+
}).superRefine((data, ctx) => {
|
|
760
|
+
if (!CompanyIndustry.shape[data.industry].safeParse(data.sector).success) {
|
|
761
|
+
ctx.addIssue(getInvalidSectorError(data.industry, data.sector));
|
|
762
|
+
}
|
|
757
763
|
});
|
|
758
764
|
|
|
759
765
|
// src/schemas/appointment/components/Medical.ts
|