feat(product-category): add external_id to product-category#14799
Conversation
🦋 Changeset detectedLatest commit: b9e2e7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 77 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@asgerjensen is attempting to deploy a commit to the medusajs Team on Vercel. A member of the Team first needs to authorize it. |
integration-tests/http/__tests__/product-category/store/product-category.spec.ts
Show resolved
Hide resolved
53e0dbc to
d56b73c
Compare
|
Hey @asgerjensen thanks for the contribution. I think this PR could be expanded to include |
Sure, i can work through those. But i think in order to keep the PR size managable, that it should be individual PRs pr type? I'd say, that for product-variant, there already exists a natural identifier field (sku), so maybe for that it just needs to be searchable via apis, much like barcode/ean. |
d56b73c to
ecbebd0
Compare
integration-tests/http/__tests__/product-category/store/product-category.spec.ts
Show resolved
Hide resolved
|
Hey @asgerjensen not necessarily I think it would be okay to have them all in this PR, but whatever you are comfortable with I'm happy with :) |
36e864f to
693d4b6
Compare
integration-tests/http/__tests__/product-category/store/product-category.spec.ts
Outdated
Show resolved
Hide resolved
I think i would prefer the seperate-PRs, mostly for my own sake. Easier to navigate for me, being relatively new to the codebase. |
693d4b6 to
4f58ed7
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
@NicolasGorga seperate PR made for the collection, type and tag. #14855 and variant in #14826 |
2872ea5 to
f4bd40c
Compare
|
You have run out of free Bugbot PR reviews for this billing cycle. This will reset on March 17. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
f60a1e1 to
4707678
Compare
785fc86 to
393ca0b
Compare
It is available on both /admin and /store, and can be used as filter. fix: add missing snapshot test: fix race condition in test chore: clean up test-cases. Remove dead code chore: cleanup tests
393ca0b to
6d2440b
Compare
|
Thank you for your contribution! After an initial review, this PR looks good to us. Here's a summary: ✅ PR template is complete Notes:
A team member will do a final review before this is merged. We appreciate your patience! |
Summary
What — What changes are introduced in this PR?
This PR adds
external_idto theproduct-categorytype.It is available on both /admin and /store, and can be used as filter.
Why — Why are these changes relevant or necessary?
To facilitate runtime lookup from values derived from 3rd party systems (PIM, ERP, Recommendations, CMS-stored-references) of the product-category.
Allows addressing data via its native/real-world identifier, rather than synthetic/instance-specific database identifier.
How — How have these changes been implemented?
Added migration to add field. Added field to schemas and queryInfo blocks.
Testing — How have these changes been tested, or how can the reviewer test the feature?
Integration tests included.
Examples
Provide examples or code snippets that demonstrate how this feature works, or how it can be used in practice.
This helps with documentation and ensures maintainers can quickly understand and verify the change.
Checklist
Please ensure the following before requesting a review:
yarn changesetand follow the promptsAdditional Context
Add any additional context, related issues, or references that might help the reviewer understand this PR.
Note
Medium Risk
Adds a new nullable DB column and threads it through admin/store API validation, default field selection, and filtering, which could affect migrations and query behavior. Changes are straightforward but touch persisted schema and public API responses.
Overview
Product categories now support a nullable
external_id, persisted via a new MikroORM migration and model/schema update.The admin and store APIs include
external_idin default query fields, accept it on create/update payloads, and allow filtering by it (validators and types updated accordingly).Integration tests are expanded/added to cover returning
external_id, creating/updating it, and filtering by it across module, admin HTTP, and store HTTP routes.Written by Cursor Bugbot for commit 2872ea5. This will update automatically on new commits. Configure here.