feat(core-flows, product): options checks on product create/update (#9171)

**What**
- validate that variants are unique with respect to options on product update/create and variant update/create
- validate that the product has options upon creation
- ensure variants have the same number of option values as the product has options
- admin error handling
- update tests

---

FIXES FRMW-2707 CC-556
This commit is contained in:
Frane Polić
2024-10-15 09:06:51 +00:00
committed by GitHub
parent 20d19c1d67
commit 48cc00e991
21 changed files with 501 additions and 102 deletions
@@ -1331,7 +1331,10 @@ medusaIntegrationTestRunner({
const product1 = (
await api.post(
"/admin/products",
{ title: "Test product 1" },
{
title: "Test product 1",
options: [{ title: "size", values: ["large", "small"] }],
},
adminHeaders
)
).data.product
@@ -1339,7 +1342,10 @@ medusaIntegrationTestRunner({
const product2 = (
await api.post(
"/admin/products",
{ title: "Test product 2" },
{
title: "Test product 2",
options: [{ title: "size", values: ["large", "small"] }],
},
adminHeaders
)
).data.product