@devizovaburza/mdm-sdk 1.2.8 → 1.3.0

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/v1/index.mjs CHANGED
@@ -455,6 +455,14 @@ const createAddressInputSchema = z.object({
455
455
  countryCode: z.enum(COUNTRY_CODES, "St\xE1t je povinn\xFD"),
456
456
  ruianCode: z.string().optional()
457
457
  });
458
+ const ownerAddressInputSchema = createAddressInputSchema.extend({
459
+ addressType: z.enum(ADDRESS_TYPE).default("PERMANENT_ADDRESS"),
460
+ district: z.string().max(255).nullish(),
461
+ region: z.string().max(255).nullish()
462
+ });
463
+ const ownerIndividualInputSchema = individualInsertSchema.extend({
464
+ email: z.email("E-mail je povinn\xFD").optional()
465
+ });
458
466
  const businessPartnerInputSchema$1 = z.object({
459
467
  name: z.string().min(1, "N\xE1zev partnera je povinn\xFD"),
460
468
  country: z.enum(COUNTRY_CODES, "St\xE1t partnera je povinn\xFD"),
@@ -536,19 +544,11 @@ const productsInputSchema$1 = z.object({
536
544
  }).optional(),
537
545
  cbs: z.object({}).optional()
538
546
  });
539
- const ownerInputSchema = z.object({
547
+ const ownerInputSchema = ownerIndividualInputSchema.extend({
540
548
  titleBefore: z.string().optional(),
541
- name: z.string().min(1, "Jm\xE9no je povinn\xE9"),
542
- surname: z.string().min(1, "P\u0159\xEDjmen\xED je povinn\xE9"),
543
549
  titleAfter: z.string().optional(),
544
- email: z.email("E-mail je povinn\xFD"),
545
- birthDate: z.string().min(1, "Datum narozen\xED je povinn\xE9"),
546
- birthPlace: z.string().optional(),
547
- personalId: z.string().min(1, "Rodn\xE9 \u010D\xEDslo je povinn\xE9"),
548
- gender: z.enum(GENDER, "Pohlav\xED je povinn\xE9"),
549
- citizenship: z.enum(COUNTRY_CODES, "St\xE1tn\xED p\u0159\xEDslu\u0161nost je povinn\xE1"),
550
550
  isPep: z.boolean({ error: "Politicky exponovan\xE1 osoba je povinn\xE1" }),
551
- address: createAddressInputSchema,
551
+ address: ownerAddressInputSchema,
552
552
  sharePercentage: z.number({ error: "Pod\xEDl na spole\u010Dnosti je povinn\xFD" }).min(1, "Pod\xEDl na spole\u010Dnosti je povinn\xFD").max(100),
553
553
  shareEstablishedAt: z.string().min(1, "Datum vzniku pod\xEDlu je povinn\xFD")
554
554
  });
@@ -567,7 +567,7 @@ const legalRepresentativeInputSchema = z.object({
567
567
  phone: z.string().optional(),
568
568
  pin: z.string().optional(),
569
569
  identityDocuments: z.array(idDocumentInputSchema$1).optional(),
570
- address: createAddressInputSchema,
570
+ address: ownerAddressInputSchema,
571
571
  dateOfEstablishment: z.string().min(1, "Datum vzniku funkce je povinn\xFD")
572
572
  });
573
573
  const createPartyInputSchema = z.object({
@@ -758,12 +758,18 @@ new OpenAPIHono().openapi(
758
758
  language: partyInput.party.language,
759
759
  customerStatus: "NEW"
760
760
  },
761
- personalData: individual,
761
+ personalData: { ...individual, email: individual.email ?? "" },
762
762
  organizationData: null,
763
763
  bankAccounts: null,
764
764
  recipients: null,
765
765
  disponents: null,
766
- addresses: [{ ...address, addressType: "PERMANENT_ADDRESS" }],
766
+ addresses: [
767
+ {
768
+ ...address,
769
+ district: address.district ?? "",
770
+ region: address.region ?? ""
771
+ }
772
+ ],
767
773
  aml: null
768
774
  });
769
775
  if (ownerParty && !ownerError) {
@@ -796,7 +802,13 @@ new OpenAPIHono().openapi(
796
802
  bankAccounts: null,
797
803
  recipients: null,
798
804
  disponents: null,
799
- addresses: [{ ...address, addressType: "PERMANENT_ADDRESS" }],
805
+ addresses: [
806
+ {
807
+ ...address,
808
+ district: address.district ?? "",
809
+ region: address.region ?? ""
810
+ }
811
+ ],
800
812
  aml: null
801
813
  });
802
814
  if (!repParty || repError) {
@@ -1079,7 +1091,7 @@ const ownerSyncSchema = z.object({
1079
1091
  name: z.string(),
1080
1092
  surname: z.string(),
1081
1093
  titleAfter: z.string().optional(),
1082
- email: z.email("E-mail je povinn\xFD"),
1094
+ email: z.email("E-mail je povinn\xFD").optional(),
1083
1095
  birthDate: z.string(),
1084
1096
  birthPlace: z.string().optional(),
1085
1097
  personalId: z.string(),
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@devizovaburza/mdm-sdk",
3
- "version": "1.2.8",
3
+ "version": "1.3.0",
4
4
  "author": "Devizová burza a.s.",
5
5
  "license": "ISC",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "prepare": "bun run build",
9
- "build": "unbuild"
9
+ "build": "unbuild",
10
+ "test": "vitest --project $npm_package_name --root ../.."
10
11
  },
11
12
  "exports": {
12
13
  "./v1": {
@@ -18,18 +19,18 @@
18
19
  "dist"
19
20
  ],
20
21
  "dependencies": {
21
- "@develit-io/backend-sdk": "^10.0.2",
22
+ "@develit-io/backend-sdk": "^10.0.3",
22
23
  "@develit-io/general-codes": "^1.17.0",
23
- "@hono/zod-openapi": "^1.2.0",
24
+ "@hono/zod-openapi": "^1.3.0",
24
25
  "drizzle-orm": "^0.45.2",
25
26
  "drizzle-zod": "^0.8.3",
26
27
  "zod": "^4.3.6"
27
28
  },
28
29
  "peerDependencies": {
29
- "hono": "^4.12.9"
30
+ "hono": "^4.12.14"
30
31
  },
31
32
  "devDependencies": {
32
33
  "@apps/gateway": "workspace:*",
33
- "unbuild": "^3.5.0"
34
+ "unbuild": "3.6.1"
34
35
  }
35
36
  }