Skip to content
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

Channel awareness for FacetService findByCode #3201

Open
wants to merge 4 commits into
base: minor
Choose a base branch
from

Conversation

d46
Copy link
Contributor

@d46 d46 commented Nov 7, 2024

Description

This PR introduces channel awareness to the findByCode method in the FacetService. The method now uses a channel-aware query to ensure that facets are retrieved in the context of the specified channel. This change enhances the accuracy and relevance of the data returned by the service.

Breaking changes

This PR does not introduce any breaking changes. The existing functionality is preserved, and backward compatibility is maintained by supporting the old method signature.

Checklist

📌 Always:

  • I have set a clear title
  • My PR is small and contains a single feature
  • I have checked my own PR

👍 Most of the time:

  • I have added or updated test cases
  • I have updated the README if needed

Copy link

vercel bot commented Nov 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview Nov 7, 2024 7:55pm

Copy link

sonarcloud bot commented Nov 7, 2024

@michaelbromley
Copy link
Member

Hi,
I'm not sure I understand the use case here, because the Facet.code column is set to be unique.

Do you have some situation where there is more than 1 version of the same code on different channels?

@mschipperheyn
Copy link
Collaborator

Hi, I'm not sure I understand the use case here, because the Facet.code column is set to be unique.

Do you have some situation where there is more than 1 version of the same code on different channels?

Yes. We have a custom populate scenario where we import a csv for a 1 or more demo channels. A number of facets are created on the default channel and shared between channels. The FacetValue are channel specific and created on a per channel basis referencing the central facet and all have the same code. We don't want age-5-7-channel-code or anything like that. It has to be the same code age-5-7. the findByCode gets all the facetValues of all the channels. That has created issues for us when we want to import a csv with facet values inside.

I figured in general all the facet - facetValue relation retrieval should result in a channel specific result and that it would likely solve a lot of hard to diagnose issues we had during the import process.

@d46
Copy link
Contributor Author

d46 commented Nov 21, 2024

Yes, as @mschipperheyn mentioned, that is the same case we are struggling with. We need full channel-aware support for all entities when we have two distinct channels of customers. I think I also need to work on the entity.

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.

4 participants