From ace458ed7eaf61ffbd4dc9713da649483f04f2d9 Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Wed, 21 Jan 2026 09:19:44 +0700 Subject: [PATCH] Add KYC profile integration and SupplierInfoBlock component --- app/components/CalcResultContent.vue | 36 +++++++++- app/components/SupplierInfoBlock.vue | 70 +++++++++++++++++++ app/components/catalog/OfferResultCard.vue | 4 ++ app/composables/useGraphQL.ts | 1 + codegen.ts | 6 ++ .../exchange/GetSupplierProfile.graphql | 1 + .../exchange/GetSupplierProfileByTeam.graphql | 14 ++++ .../public/kyc/GetKycProfileFull.graphql | 16 +++++ .../public/kyc/GetKycProfileTeaser.graphql | 8 +++ nuxt.config.ts | 4 ++ 10 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 app/components/SupplierInfoBlock.vue create mode 100644 graphql/operations/public/exchange/GetSupplierProfileByTeam.graphql create mode 100644 graphql/operations/public/kyc/GetKycProfileFull.graphql create mode 100644 graphql/operations/public/kyc/GetKycProfileTeaser.graphql diff --git a/app/components/CalcResultContent.vue b/app/components/CalcResultContent.vue index 4d3d07f..8211973 100644 --- a/app/components/CalcResultContent.vue +++ b/app/components/CalcResultContent.vue @@ -26,6 +26,7 @@ :currency="getOfferData(option.sourceUuid)?.currency" :unit="getOfferData(option.sourceUuid)?.unit" :stages="getRouteStages(option)" + :kyc-profile-uuid="getKycProfileUuid(option.sourceUuid)" /> @@ -64,7 +65,7 @@ diff --git a/app/components/catalog/OfferResultCard.vue b/app/components/catalog/OfferResultCard.vue index c842ff4..ff06e66 100644 --- a/app/components/catalog/OfferResultCard.vue +++ b/app/components/catalog/OfferResultCard.vue @@ -11,6 +11,9 @@ + + + (), { stages: () => [] }) diff --git a/app/composables/useGraphQL.ts b/app/composables/useGraphQL.ts index 734dbdc..0bb82ff 100644 --- a/app/composables/useGraphQL.ts +++ b/app/composables/useGraphQL.ts @@ -15,6 +15,7 @@ const RESOURCE_MAP: Record = { const CLIENT_MAP: Record = { 'public:exchange': 'default', 'public:geo': 'publicGeo', + 'public:kyc': 'publicKyc', 'user:teams': 'teamsUser', 'user:kyc': 'kycUser', 'team:teams': 'teamsTeam', diff --git a/codegen.ts b/codegen.ts index dae13a0..fe98367 100644 --- a/codegen.ts +++ b/codegen.ts @@ -29,6 +29,12 @@ const config: CodegenConfig = { plugins, config: pluginConfig, }, + './app/composables/graphql/public/kyc-generated.ts': { + schema: 'https://kyc.optovia.ru/graphql/public/', + documents: './graphql/operations/public/kyc/*.graphql', + plugins, + config: pluginConfig, + }, // User-level operations (ID Token) './app/composables/graphql/user/teams-generated.ts': { diff --git a/graphql/operations/public/exchange/GetSupplierProfile.graphql b/graphql/operations/public/exchange/GetSupplierProfile.graphql index d815a41..dec1c9a 100644 --- a/graphql/operations/public/exchange/GetSupplierProfile.graphql +++ b/graphql/operations/public/exchange/GetSupplierProfile.graphql @@ -2,6 +2,7 @@ query GetSupplierProfile($uuid: String!) { getSupplierProfile(uuid: $uuid) { uuid teamUuid + kycProfileUuid name description country diff --git a/graphql/operations/public/exchange/GetSupplierProfileByTeam.graphql b/graphql/operations/public/exchange/GetSupplierProfileByTeam.graphql new file mode 100644 index 0000000..c6d4340 --- /dev/null +++ b/graphql/operations/public/exchange/GetSupplierProfileByTeam.graphql @@ -0,0 +1,14 @@ +query GetSupplierProfileByTeam($teamUuid: String!) { + getSupplierProfileByTeam(teamUuid: $teamUuid) { + uuid + teamUuid + kycProfileUuid + name + description + country + logoUrl + isVerified + isActive + offersCount + } +} diff --git a/graphql/operations/public/kyc/GetKycProfileFull.graphql b/graphql/operations/public/kyc/GetKycProfileFull.graphql new file mode 100644 index 0000000..fa2b9c5 --- /dev/null +++ b/graphql/operations/public/kyc/GetKycProfileFull.graphql @@ -0,0 +1,16 @@ +query GetKycProfileFull($profileUuid: String!) { + companyFullByProfile(profileUuid: $profileUuid) { + inn + ogrn + name + companyType + registrationYear + isActive + address + director + capital + activities + sources + lastUpdated + } +} diff --git a/graphql/operations/public/kyc/GetKycProfileTeaser.graphql b/graphql/operations/public/kyc/GetKycProfileTeaser.graphql new file mode 100644 index 0000000..4897199 --- /dev/null +++ b/graphql/operations/public/kyc/GetKycProfileTeaser.graphql @@ -0,0 +1,8 @@ +query GetKycProfileTeaser($profileUuid: String!) { + companyTeaserByProfile(profileUuid: $profileUuid) { + companyType + registrationYear + isActive + sourcesCount + } +} diff --git a/nuxt.config.ts b/nuxt.config.ts index 0b5b93c..3e6ce15 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -209,6 +209,10 @@ export default defineNuxtConfig({ httpEndpoint: process.env.NUXT_PUBLIC_GEO_GRAPHQL_PUBLIC || 'https://geo.optovia.ru/graphql/public/', devtools: { enabled: process.dev } }, + publicKyc: { + httpEndpoint: process.env.NUXT_PUBLIC_KYC_GRAPHQL_PUBLIC || 'https://kyc.optovia.ru/graphql/public/', + devtools: { enabled: process.dev } + }, teamsUser: { httpEndpoint: process.env.NUXT_PUBLIC_TEAMS_GRAPHQL_USER || 'https://teams.optovia.ru/graphql/user/', devtools: { enabled: process.dev }