From 09ae378a922bca7d0402c905f2ac673b6d70d63f Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Mon, 5 Feb 2024 15:49:33 -0300 Subject: [PATCH 01/10] Adjuste condition is corporate --- node/resolvers/Routes/index.ts | 6 ++++++ node/resolvers/Routes/utils/index.ts | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 27a9d58..f355508 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -161,6 +161,7 @@ export const Routes = { let tradeName = null let stateRegistration = null let user = null + let isCorporate = false; if (b2bImpersonate) { try { @@ -310,6 +311,10 @@ export const Routes = { } } + if (organization) { + isCorporate = true + } + businessName = organization.name tradeName = organization.tradeName @@ -509,6 +514,7 @@ export const Routes = { phoneNumber, stateRegistration, tradeName, + isCorporate, }) if (clUser && orderFormId) { diff --git a/node/resolvers/Routes/utils/index.ts b/node/resolvers/Routes/utils/index.ts index e7fb41a..3c55548 100644 --- a/node/resolvers/Routes/utils/index.ts +++ b/node/resolvers/Routes/utils/index.ts @@ -86,6 +86,7 @@ export const generateClUser = async ({ businessName, businessDocument, tradeName, + isCorporate, stateRegistration, ctx, }: { @@ -94,6 +95,7 @@ export const generateClUser = async ({ businessName: string | null businessDocument: string | null tradeName: string | null + isCorporate: boolean stateRegistration: string | null ctx: Context }) => { @@ -121,7 +123,7 @@ export const generateClUser = async ({ clUser.phone = phoneNumber } - if (businessName && businessDocument) { + if (isCorporate) { clUser.isCorporate = true clUser.document = null clUser.corporateName = businessName From 3d7ab42538f5d97f4d85ba016e3e024ea7226b6d Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Mon, 5 Feb 2024 15:56:25 -0300 Subject: [PATCH 02/10] Add Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d9eb8..ed74970 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +- Fix IsCorporate in SetProfile + ## [1.38.0] - 2023-12-14 ### Added From 00e5b42796a80d86bfb4d4a0829ce8936d8c0557 Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Mon, 5 Feb 2024 15:59:37 -0300 Subject: [PATCH 03/10] Adjust Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed74970..8ba4f79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Fixed - Fix IsCorporate in SetProfile ## [1.38.0] - 2023-12-14 From 4fe6ef0fcab73e9ae9b460575156f13abdf7de7d Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Mon, 5 Feb 2024 16:03:30 -0300 Subject: [PATCH 04/10] Adjust lint --- node/resolvers/Routes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index f355508..771cd3d 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -161,7 +161,7 @@ export const Routes = { let tradeName = null let stateRegistration = null let user = null - let isCorporate = false; + let isCorporate = false if (b2bImpersonate) { try { From 1b9e42691090dbd830258aabdbcdf9b8bedadc55 Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Tue, 6 Feb 2024 15:26:15 -0300 Subject: [PATCH 05/10] Adjust PR comment --- node/resolvers/Routes/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 771cd3d..4afcb83 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -161,7 +161,6 @@ export const Routes = { let tradeName = null let stateRegistration = null let user = null - let isCorporate = false if (b2bImpersonate) { try { @@ -311,9 +310,7 @@ export const Routes = { } } - if (organization) { - isCorporate = true - } + const isCorporate = organization ? true : false businessName = organization.name tradeName = organization.tradeName From 806bb118fe9442ea2b367457738c2e0e7b6d1b91 Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Tue, 6 Feb 2024 15:44:18 -0300 Subject: [PATCH 06/10] Lint --- node/resolvers/Routes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 4afcb83..9294a6d 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -310,7 +310,7 @@ export const Routes = { } } - const isCorporate = organization ? true : false + const isCorporate = !!organization businessName = organization.name tradeName = organization.tradeName From dc834b76cbbb532579650d257f247b9c5fdf301b Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Tue, 6 Feb 2024 15:54:24 -0300 Subject: [PATCH 07/10] Change conversion --- node/resolvers/Routes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 9294a6d..3a9bd96 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -310,7 +310,7 @@ export const Routes = { } } - const isCorporate = !!organization + const isCorporate = Boolean(organization) businessName = organization.name tradeName = organization.tradeName From b8e08a3ac8c78751aecb1261277188906664a592 Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Thu, 8 Feb 2024 09:39:16 -0300 Subject: [PATCH 08/10] Change isCorporate to true --- node/resolvers/Routes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 3a9bd96..0c383df 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -310,7 +310,7 @@ export const Routes = { } } - const isCorporate = Boolean(organization) + const isCorporate = true businessName = organization.name tradeName = organization.tradeName From 2149565eddd64cb2b00a1c8b7726f9a400157aca Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Thu, 8 Feb 2024 15:07:48 -0300 Subject: [PATCH 09/10] move const position --- node/resolvers/Routes/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/node/resolvers/Routes/index.ts b/node/resolvers/Routes/index.ts index 5db5682..a03de49 100644 --- a/node/resolvers/Routes/index.ts +++ b/node/resolvers/Routes/index.ts @@ -152,6 +152,7 @@ export const Routes = { const b2bImpersonate = body?.public?.impersonate?.value const telemarketingImpersonate = body?.impersonate?.storeUserId?.value const orderFormId = body?.checkout?.orderFormId?.value + const isCorporate = true let email = body?.authentication?.storeUserEmail?.value let businessName = null @@ -319,8 +320,6 @@ export const Routes = { } } - const isCorporate = true - businessName = organization.name tradeName = organization.tradeName From 1fd1fea4a0096812cbc38ce905137b1c011e621f Mon Sep 17 00:00:00 2001 From: Pablo Pupulin Date: Fri, 9 Feb 2024 08:53:38 -0300 Subject: [PATCH 10/10] adjust changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75aa3e1..48dff16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] ### Fixed + - Fix IsCorporate in SetProfile ## [1.39.0] - 2024-02-06