chore: OAS for product options - #14344
Merged
shahednasser merged 1 commit intoDec 18, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 8 Skipped Deployments
|
|
shahednasser
merged commit Dec 18, 2025
b73b2c7
into
chore/add-many-to-many-between-product-and-option
46 of 47 checks passed
NicolasGorga
added a commit
that referenced
this pull request
Jun 24, 2026
* chore(product,types): change relationship between product and option to many to many * tests * define model for pivot table * test commit will revert * Revert "test commit will revert" This reverts commit cb3dda5. * model for pivot table * more * new product options endpoint * product options endpoints * tests * remove debug * small changes in endpoints * add ranks to product option values * allow linking to existing option on product creation * updates to link endpoint * Create forty-tables-fetch.md * integration tests * integration tests * product integration tests * update validator * fix import * fix import * maintain ordering * self review * pr comments * pr comments * pr comments * is string * pr comments * query graph * comment about moving error * create options in parallel * comments * small change in doc * migration name * fix test * feat(dashboard,admin-shared,js-sdk): product option redesign (client-side) (#13887) * feat(dashboard,js-sdk): product option redesign (client-side) * support create * edit option and values rank * change bade * select from options at product creation * create product with link to option * edit option from product page * link and unlink option to product * missed the js sdk in last commit * small fix when removing a value * Create shaggy-parents-guess.md * pr comments * pr comments * pr comments * is string * pr comments * query graph * fix pipeline * woops * todo * better table * review * changeset * feat(): allow linking a subset of an option's values to the product (#14054) * wip * model changes * map products * remove log * link subset of values * fix tests * link subset at product creation * chips in combobox * chips in product creation too * Create spotty-dragons-shave.md * migration + sort values by rank in product details * cursor review * small fixes --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> * fix: prod normalization mege * fix: delete cascade between 2 pivot tables * fix: make link test deterministic * fix: options filters * feat: navigate to the option instead of edit * feat: disable changin product option exclusivity setting * fix: make migrated ids follow our format * fix: disable only global option making * fix: migration * fix: temp enable pgcrpyto * fix: update tests, fix condition, revert id change * feat: validate product <> option assignments and updates (#14207) * feat: validate product <> option (un)assignemnts * fix: rm Knex import * fix: update test file * chore(): cleanup proposal (#14294) * chore(): cleanup proposal * chore(): cleanup proposal * chore(): cleanup proposal * reorder arguments * reorder arguments --------- Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com> * fix: test suite, address feedback --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * feat: validate product option (value) deletion (#14248) * wip: prevent option deletion if an associated product exists * wip: refactor, check if value is removed * fix: typos * feat: push validation into module, finish update and delete test cases * chore: refactor * fix: try referencing rollup from global modules * fix: undo last change * fix: split methods * fix: options map --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * chore: improve TSDocs of product options (#14323) * chore: improve TSDocs of product options * fixes * feat: product option UI + storefront API changes (#14265) * wip: product option UI changes * feat: allow managing non global options * chore: finalise create form * feat: product options storefront endpoints * feat: rest of changes * fix: finalise changes and tests * feat: filter products by option values (#14308) * feat: filtering products by option values * wip: grouping and filtering * feat: implement prefetching query * fix: rm var opts check * feat: subquery * fix: vars * chore: cleanup * fix: join * fix: excape * fix: rename * chore: test names * chore: another test * fix: duplicate import * fix: translation --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * chore: tsdocs updates for latest product option changes (#14326) * fix(types,medusa): use HTTP types in request type parameters of product options routes (#14324) * fix(types,medusa): use HTTP types in request type parameters of product options routes * fix type for store product options * fix type parameters for store request * feat: product update schema file * chore: OAS for product options (#14344) * fix: product pivots id format migration (#14446) * wip: set pivot tables ids in batches * fix: update processing logic * fix: use max batches guard * fix: product options catch-all improvements (#14343) * wip: manage form improvements, delete product exclusive options with product * fix: build * fix: revert client change * fix: order of args, with deleted test * fix: iitem removal condition * feat: emit event on options manage * fix: transform * fix: return object * feat: cascade soft delete options to the pivot tables, update can delete check * chore: cleanup, add variants to tested products * fix: default ranking * refactor: create option form * fix: prepanding exclusive options in combobox on options manage form * fix: handle product without variants * fix: make ranking logic consistent * feat: better pagination query, remove client side options merge * fix: set param * refacto: options state to be in a single place * feat: handle new option add, submit validation * chore: refactor * fix: do not cuncurrently manage product options in the link step * feat: invalidate options lists on product create/delete * fix: rm autogenerated soft delete methods * chore: rework PPO management API (#14473) * chore: rework PPO management api * fix: address removall compensation issue * fix: address update compensation * fix: restore only PPO links that exist * feat: validate that exclusive option cannot be added to multiple products * fix: is string * refactor: use query * fix: validation edge case, do a single query check, add tests * chore: refactor add PPO flow, simplify method, add validtion checks, update the step * fix: address feedback * fix: disallow creation of global option values from the create product flow * fix: reorg options details page * feat: exclusive options creation with batch PPO flow * fix: consistently indexation on ranks edits * fix: optimise list product options fetching (#14548) * fix: optimise list products options loading and filtering * fix: type import * test: add back prod relation for options fetching on update * fix: revert options products fetch * feat: filtering with inner join * fix: preserve search params on create modal open * feat: handle creation and duplication of new options and values * fix: handling is exclusive default filter --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * feat: add rbac policies for new product option endpoints * zod fixes * remove unused * fix performance issues + variant values not reinforced * fix tests * address comments * change since tags * fix test * Add missing unsuported filter guards for index engine queries * Fix pagination and reduce network requests * Allow getOptions typing to return more than label and value * Fix type * Fix pagination issue and reduce network requests * Guard product options batch endpoint * Fix option_ids validator type in update product endpoint * Add test documenting exclusivity changes current constraints * Fix js doc * Avoid mutating in place * Use translations * fix: highlight product option filter chip for manual URLs * fix: remove product option when its last value is unselected * feat(admin-shared,dashboard,core-flows,product,js-sdk,types,medusa): rework product option values views and add dedicated endpoints (#15810) * Rework product option values views and introduce dedicated endpoints * Changeset * Add .js ext --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> Co-authored-by: fPolic <mainacc.polic@gmail.com> Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com> Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> Co-authored-by: Shahed Nasser <shahednasser@gmail.com> Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com> Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
NicolasGorga
added a commit
that referenced
this pull request
Jul 9, 2026
…n imports (#15614) * chore(product,types): change relationship between product and option to many to many * tests * define model for pivot table * test commit will revert * Revert "test commit will revert" This reverts commit cb3dda5. * model for pivot table * more * new product options endpoint * product options endpoints * tests * remove debug * small changes in endpoints * add ranks to product option values * allow linking to existing option on product creation * updates to link endpoint * Create forty-tables-fetch.md * integration tests * integration tests * product integration tests * update validator * fix import * fix import * maintain ordering * self review * pr comments * pr comments * pr comments * is string * pr comments * query graph * comment about moving error * create options in parallel * comments * small change in doc * migration name * fix test * feat(dashboard,admin-shared,js-sdk): product option redesign (client-side) (#13887) * feat(dashboard,js-sdk): product option redesign (client-side) * support create * edit option and values rank * change bade * select from options at product creation * create product with link to option * edit option from product page * link and unlink option to product * missed the js sdk in last commit * small fix when removing a value * Create shaggy-parents-guess.md * pr comments * pr comments * pr comments * is string * pr comments * query graph * fix pipeline * woops * todo * better table * review * changeset * feat(): allow linking a subset of an option's values to the product (#14054) * wip * model changes * map products * remove log * link subset of values * fix tests * link subset at product creation * chips in combobox * chips in product creation too * Create spotty-dragons-shave.md * migration + sort values by rank in product details * cursor review * small fixes --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> --------- Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> * fix: prod normalization mege * fix: delete cascade between 2 pivot tables * fix: make link test deterministic * fix: options filters * feat: navigate to the option instead of edit * feat: disable changin product option exclusivity setting * fix: make migrated ids follow our format * fix: disable only global option making * fix: migration * fix: temp enable pgcrpyto * fix: update tests, fix condition, revert id change * feat: validate product <> option assignments and updates (#14207) * feat: validate product <> option (un)assignemnts * fix: rm Knex import * fix: update test file * chore(): cleanup proposal (#14294) * chore(): cleanup proposal * chore(): cleanup proposal * chore(): cleanup proposal * reorder arguments * reorder arguments --------- Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com> * fix: test suite, address feedback --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * feat: validate product option (value) deletion (#14248) * wip: prevent option deletion if an associated product exists * wip: refactor, check if value is removed * fix: typos * feat: push validation into module, finish update and delete test cases * chore: refactor * fix: try referencing rollup from global modules * fix: undo last change * fix: split methods * fix: options map --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * chore: improve TSDocs of product options (#14323) * chore: improve TSDocs of product options * fixes * feat: product option UI + storefront API changes (#14265) * wip: product option UI changes * feat: allow managing non global options * chore: finalise create form * feat: product options storefront endpoints * feat: rest of changes * fix: finalise changes and tests * feat: filter products by option values (#14308) * feat: filtering products by option values * wip: grouping and filtering * feat: implement prefetching query * fix: rm var opts check * feat: subquery * fix: vars * chore: cleanup * fix: join * fix: excape * fix: rename * chore: test names * chore: another test * fix: duplicate import * fix: translation --------- Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> * chore: tsdocs updates for latest product option changes (#14326) * fix(types,medusa): use HTTP types in request type parameters of product options routes (#14324) * fix(types,medusa): use HTTP types in request type parameters of product options routes * fix type for store product options * fix type parameters for store request * feat: product update schema file * chore: OAS for product options (#14344) * fix: product pivots id format migration (#14446) * wip: set pivot tables ids in batches * fix: update processing logic * fix: use max batches guard * fix: product options catch-all improvements (#14343) * wip: manage form improvements, delete product exclusive options with product * fix: build * fix: revert client change * fix: order of args, with deleted test * fix: iitem removal condition * feat: emit event on options manage * fix: transform * fix: return object * feat: cascade soft delete options to the pivot tables, update can delete check * chore: cleanup, add variants to tested products * fix: default ranking * refactor: create option form * fix: prepanding exclusive options in combobox on options manage form * fix: handle product without variants * fix: make ranking logic consistent * feat: better pagination query, remove client side options merge * fix: set param * refacto: options state to be in a single place * feat: handle new option add, submit validation * chore: refactor * fix: do not cuncurrently manage product options in the link step * feat: invalidate options lists on product create/delete * fix: rm autogenerated soft delete methods * chore: rework PPO management API (#14473) * chore: rework PPO management api * fix: address removall compensation issue * fix: address update compensation * fix: restore only PPO links that exist * feat: validate that exclusive option cannot be added to multiple products * fix: is string * refactor: use query * fix: validation edge case, do a single query check, add tests * chore: refactor add PPO flow, simplify method, add validtion checks, update the step * fix: address feedback * fix: disallow creation of global option values from the create product flow * fix: reorg options details page * feat: exclusive options creation with batch PPO flow * fix: consistently indexation on ranks edits * fix: optimise list product options fetching (#14548) * fix: optimise list products options loading and filtering * fix: type import * test: add back prod relation for options fetching on update * fix: revert options products fetch * feat: filtering with inner join * fix: preserve search params on create modal open * feat: handle creation and duplication of new options and values * fix: handling is exclusive default filter --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * feat: add rbac policies for new product option endpoints * zod fixes * remove unused * fix performance issues + variant values not reinforced * fix tests * address comments * change since tags * fix test * Add missing unsuported filter guards for index engine queries * Fix pagination and reduce network requests * Allow getOptions typing to return more than label and value * Fix type * Fix pagination issue and reduce network requests * Guard product options batch endpoint * Fix option_ids validator type in update product endpoint * Add test documenting exclusivity changes current constraints * Fix js doc * Avoid mutating in place * Use translations * fix: highlight product option filter chip for manual URLs * fix: remove product option when its last value is unselected * [Global Product Options] fix(core-flows, utils): support global and exclusive imports * Remove orphaned exclusive options * Fix product options addition/removal compensation * Fix tests * Update convert to boolean util * Guarantee columns in csv fixture * feat(admin-shared,dashboard,core-flows,product,js-sdk,types,medusa): rework product option values views and add dedicated endpoints (#15810) * Rework product option values views and introduce dedicated endpoints * Changeset * Add .js ext * Add unique constraint on product option non exlcusive title + new tests * Update test * Changeset * Fix query * undo changes --------- Co-authored-by: willbouch <william.bouchard3@mail.mcgill.ca> Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com> Co-authored-by: fPolic <mainacc.polic@gmail.com> Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com> Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> Co-authored-by: Nicolas Gorga <nicogorga11@gmail.com> Co-authored-by: Nicolas Gorga <62995075+NicolasGorga@users.noreply.github.com>
This file contains hidden or 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
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.
Note
Introduces admin/store Product Options endpoints and schemas, new product-option linking, option/option-value filters on product lists/exports, a price-list prices listing, and updates docs generator and examples.
GET /admin/product-options,GET /admin/product-options/{id},POST /admin/product-options,POST /admin/product-options/{id},DELETE /admin/product-options/{id}.POST /admin/products/{id}/optionsto link/add/remove options usingAdminLinkProductOptions(workflowcreateAndLinkProductOptionsToProductWorkflow).GET /store/product-optionsandGET /store/product-options/{id}.GET /admin/price-lists/{id}/pricesandAdminPriceListPriceListResponse.option_idandoption_value_idfilters toGET /admin/products,POST /admin/products/export, andGET /store/products.is_exclusivefilter toGET /admin/products/{id}/options.AdminProductOption,BaseProductOption, andStoreProductOptionwithis_exclusive,products; add valuerankfields.AdminLinkProductOptions; enhanceAdminCreateProductOption/AdminUpdateProductOptionwithranks,is_exclusive,metadata.AdminCreateProductoptions structure andAdminBatchUpdateProductwithoption_ids.StoreProductOptionResponseand update related responses.StoreRequestWithContextandStoreVariantListRequestfor query parsing.Written by Cursor Bugbot for commit 5c0a741. This will update automatically on new commits. Configure here.