Skip to content

Conversation

@bc-keelan
Copy link

@bc-keelan bc-keelan commented Oct 22, 2025

Jira: B2B-3491

What/Why?

Consumes the UUIDs added to quote links in this backend PR so that they are used in graphql calls to retrieve quotes.

Rollout/Rollback

Revert this commit. This PR is intended to be backwards compatible with existing quotes, so this shouldn't need to be reverted, but the backend change rollout is controlled by feature flag B2B-3491.quote_uuid_generation_and_access

Testing

See backend PR for testing screenshots.

@icatalina
Copy link
Contributor

Wondering if we could replace the quoteId with the UUID instead of adding a new parameter to the url. On the long run it is a safer and simpler solution.

@bc-keelan bc-keelan marked this pull request as ready for review October 23, 2025 04:20
@bc-keelan bc-keelan requested review from a team and icatalina as code owners October 23, 2025 04:20
@bc-keelan
Copy link
Author

@icatalina as we discussed, we will go ahead with the UUID solution, with notice to be given to merchants with custom buyer portals before rolling out the changes.

Copy link
Contributor

@icatalina icatalina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have tests covering these scenarios? should we?

@bc-keelan bc-keelan force-pushed the B2B-3491 branch 3 times, most recently from 4cf0b97 to 2750b19 Compare November 7, 2025 05:51
@bc-keelan bc-keelan marked this pull request as draft November 7, 2025 06:05
@bc-keelan
Copy link
Author

Good call out, have added tests, as well as refactored the name of the parameter to be just uuid.

@bc-keelan bc-keelan marked this pull request as ready for review November 9, 2025 23:07
Copy link
Contributor

@icatalina icatalina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks 🙇

await userEvent.click(within(table).getByRole('row', { name: /Quote with UUID/ }));

expect(navigation).toHaveBeenCalledWith(
`/quoteDetail/123456?date=${getUnixTime(new Date('1 January 2025'))}&uuid=abc-123-def-456`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there's an issue with getUnixTime, this test won't catch it. Imagine:

const getUnixTime = () => 'potato';

it is better not to rely on code for the expectations. Simply hard-code the expected value.

const data = {
id: Number(id),
date: date.toString(),
...(uuid && { uuid: uuid.toString() }),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 undefined uuids are already handled in the get*QuoteDetails methods. Might be easier to pass it as undefined instead of doing this conditional spread:

const data = {
  id: Number(id),
  date: date.toString(),
  uuid: uuid ? uuid.toString() : undefined,
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants