feat(medusa): Continue create product workflow changes (#4473)
This commit is contained in:
1 parent
edf93d972d
commit
d2a8cf0378
103 files changed
+1859
-524
No files matched your search
@@ -106,6 +106,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-reg",
|
||||
title: "Multi Reg Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
status: "published",
|
||||
collection_id: "test-collection",
|
||||
|
||||
@@ -444,14 +444,16 @@ module.exports = async (dataSource, data = {}) => {
|
||||
|
||||
await manager.save(priceList1)
|
||||
|
||||
await manager.insert(Product, {
|
||||
const giftCardProduct = manager.create(Product, {
|
||||
id: "giftcard-product",
|
||||
title: "Giftcard",
|
||||
is_giftcard: true,
|
||||
discountable: false,
|
||||
profile_id: gcProfile.id,
|
||||
profiles: [{ id: gcProfile.id }],
|
||||
options: [{ id: "denom", title: "Denomination" }],
|
||||
})
|
||||
await manager.save(Product, giftCardProduct)
|
||||
|
||||
await manager.insert(ProductVariant, {
|
||||
id: "giftcard-denom",
|
||||
@@ -466,12 +468,14 @@ module.exports = async (dataSource, data = {}) => {
|
||||
],
|
||||
})
|
||||
|
||||
await manager.insert(Product, {
|
||||
const testProduct = manager.create(Product, {
|
||||
id: "test-product",
|
||||
title: "test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
options: [{ id: "test-option", title: "Size" }],
|
||||
})
|
||||
await manager.save(Product, testProduct)
|
||||
|
||||
await manager.insert(ProductVariant, {
|
||||
id: "test-variant-quantity",
|
||||
|
||||
@@ -34,6 +34,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
id: "test-product",
|
||||
title: "test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
options: [{ id: "test-option", title: "Size" }],
|
||||
})
|
||||
|
||||
@@ -52,6 +53,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
id: "test-product-2",
|
||||
title: "test product 2",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
options: [{ id: "test-option-color", title: "Color" }],
|
||||
})
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
id: "test-product",
|
||||
title: "test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
options: [{ id: "test-option", title: "Size" }],
|
||||
})
|
||||
|
||||
|
||||
@@ -238,6 +238,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -305,6 +306,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-quantity",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -413,6 +415,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-sale",
|
||||
title: "Test product sale",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -480,6 +483,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-sale-overlap",
|
||||
title: "Test product sale",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -540,6 +544,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-multi-region",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-multi-region-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -606,6 +611,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-quantity-customer",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -713,6 +719,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-sale-customer",
|
||||
title: "Test product sale",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
@@ -781,6 +788,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product-sale-customer-quantity",
|
||||
title: "Test product sale",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
tags: [],
|
||||
|
||||
@@ -98,6 +98,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
collection_id: "test-collection",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
@@ -215,6 +216,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product1",
|
||||
title: "Test product1",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description1",
|
||||
collection_id: "test-collection",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
@@ -283,6 +285,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product_filtering_1",
|
||||
title: "Test product filtering 1",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection1",
|
||||
@@ -297,6 +300,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product_filtering_2",
|
||||
title: "Test product filtering 2",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection2",
|
||||
@@ -311,6 +315,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product_filtering_3",
|
||||
title: "Test product filtering 3",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection1",
|
||||
@@ -325,6 +330,7 @@ module.exports = async (dataSource, data = {}) => {
|
||||
handle: "test-product_filtering_4",
|
||||
title: "Test product filtering 4",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
status: "proposed",
|
||||
deleted_at: new Date().toISOString(),
|
||||
|
||||
@@ -130,6 +130,7 @@ module.exports = async (dataSource, defaultSalesChannel) => {
|
||||
handle: "test-product",
|
||||
title: "Test product",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
status: "published",
|
||||
collection_id: "test-collection",
|
||||
@@ -323,6 +324,7 @@ module.exports = async (dataSource, defaultSalesChannel) => {
|
||||
handle: "test-product_filtering_1",
|
||||
title: "Test product filtering 1",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection1",
|
||||
@@ -338,6 +340,7 @@ module.exports = async (dataSource, defaultSalesChannel) => {
|
||||
handle: "test-product_filtering_2",
|
||||
title: "Test product filtering 2",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection2",
|
||||
@@ -353,6 +356,7 @@ module.exports = async (dataSource, defaultSalesChannel) => {
|
||||
handle: "test-product_filtering_3",
|
||||
title: "Test product filtering 3",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
collection_id: "test-collection1",
|
||||
@@ -369,6 +373,7 @@ module.exports = async (dataSource, defaultSalesChannel) => {
|
||||
is_giftcard: true,
|
||||
title: "giftcard",
|
||||
profile_id: defaultProfile.id,
|
||||
profiles: [{ id: defaultProfile.id }],
|
||||
description: "test-product-description",
|
||||
type: { id: "test-type", value: "test-type" },
|
||||
status: "published",
|
||||
|
||||
Reference in new issue
Block a user