-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/demo customer #509
Draft
ataideverton
wants to merge
6
commits into
main
Choose a base branch
from
chore/demo-customerId
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Chore/demo customer #509
+1,544
−2,318
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
ataideverton
force-pushed
the
chore/demo-customerId
branch
from
September 13, 2024 12:05
87194f9
to
cfdcfc2
Compare
ataideverton
added a commit
to vtex/faststore
that referenced
this pull request
Sep 16, 2024
## What's the purpose of this pull request? As we develop more b2b features inside the `faststore`, we need to be able to identify when a customer is a `b2b` customer and if he is member of an Organization (Normally refered to as a Buyer Organization). This PR addresses the first step to do so. For that, we added a `b2b` section to the `session` hook and mutation and inside of it, a `customerId` field, that informs us of what BuyerOrganization that customer is a part of. Why we decided to do this inside FastStore and not as an override or extra request: The information comes from the same `sessions` api `Faststore` already uses, we just need to bring an additional field. This will not impact B2C stores, for them, it will only be an empty objetct ## How it works? On a B2B account that fulfills several conditions (Some specific apps, some specific versions of apps, a feature flag), the `sessions` api will return the `customerId` field on the `authentication` namespace and that will be inserted on the internal session object, like so: Account: `b2bfaststoredev`: ![image](https://github.com/user-attachments/assets/88ed84f8-0b62-406c-8596-931e09ca799d) On a B2C account, or any account that doesn't fit all the criteria, the field will be empty and should not interfere with anything. Account: `storeframework` ![image](https://github.com/user-attachments/assets/81dbb28c-7561-4bf9-ae56-f3a57846e9c6) ## How to test it? To make validation easier, we have 2 previews (You will need to be logged in to see it working, as they are previews, you will need to edit the cookie): [B2B Preview - Session will print on console every few seconds, only on the /self-management page](https://sfj-45b4ae2--b2bfaststoredev.preview.vtex.app/self-management) [B2C Preview - Has a button on navbar to print the session on console](https://sfj-342a275--starter.preview.vtex.app/) The button and the `faststore/cli` dependency are the only changes here The PRs for these previews: [B2B](vtex-sites/b2bfaststoredev.store#91) [B2C](vtex-sites/starter.store#509)
ataideverton
added a commit
to vtex/faststore
that referenced
this pull request
Oct 3, 2024
## What's the purpose of this pull request? As we develop more b2b features inside the `faststore`, we need to be able to identify when a customer is a `b2b` customer and if he is member of an Organization (Normally refered to as a Buyer Organization). This PR addresses the first step to do so. For that, we added a `b2b` section to the `session` hook and mutation and inside of it, a `customerId` field, that informs us of what BuyerOrganization that customer is a part of. Why we decided to do this inside FastStore and not as an override or extra request: The information comes from the same `sessions` api `Faststore` already uses, we just need to bring an additional field. This will not impact B2C stores, for them, it will only be an empty objetct ## How it works? On a B2B account that fulfills several conditions (Some specific apps, some specific versions of apps, a feature flag), the `sessions` api will return the `customerId` field on the `authentication` namespace and that will be inserted on the internal session object, like so: Account: `b2bfaststoredev`: ![image](https://github.com/user-attachments/assets/88ed84f8-0b62-406c-8596-931e09ca799d) On a B2C account, or any account that doesn't fit all the criteria, the field will be empty and should not interfere with anything. Account: `storeframework` ![image](https://github.com/user-attachments/assets/81dbb28c-7561-4bf9-ae56-f3a57846e9c6) ## How to test it? To make validation easier, we have 2 previews (You will need to be logged in to see it working, as they are previews, you will need to edit the cookie): [B2B Preview - Session will print on console every few seconds, only on the /self-management page](https://sfj-45b4ae2--b2bfaststoredev.preview.vtex.app/self-management) [B2C Preview - Has a button on navbar to print the session on console](https://sfj-342a275--starter.preview.vtex.app/) The button and the `faststore/cli` dependency are the only changes here The PRs for these previews: [B2B](vtex-sites/b2bfaststoredev.store#91) [B2C](vtex-sites/starter.store#509)
cezar-guimaraes
force-pushed
the
main
branch
2 times, most recently
from
October 10, 2024 10:30
84ed4da
to
7ef7784
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the purpose of this pull request?
How does it work?
How to test it?
Faststore related PRs
References