feat: Implement PriceList and extend MoneyAmount (#1152)

* init

* added buld id validation to repo

* admin done

* updated price reqs

* intial implementation of PriceList

* integration tests for price lists

* updated admin/product integration tests

* update updateVariantPrices method

* remove comment from error handler

* add integration test for batch deleting prices associated with price list

* make update to prices through variant service limited to default prices

* update store/products.js snapshot

* add api unit tests and update product integration tests to validate that prices from Price List are ignored

* fix product test

* requested changes

* cascade

* ensure delete variant cascades to MoneyAmount

* addresses PR feedback

* removed unused endpoint

* update mock

* fix failing store integration tests

* remove medusajs ressource

* re add env.template

* Update integration-tests/api/__tests__/admin/price-list.js

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* Update integration-tests/api/__tests__/admin/price-list.js

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* fix: update snapshots

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2022-03-18 15:18:50 +01:00
1 parent 23f8399c16
commit 5300926db8
52 files changed
+4234 -505

No files matched your search

@@ -37,8 +37,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": "test-price",
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": "test-variant",
},
@@ -93,8 +95,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": "test-price",
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": "test-variant",
},
@@ -150,8 +154,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": Any<String>,
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": Any<String>,
},
@@ -162,8 +162,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": "test-price",
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": "test-variant",
},
@@ -211,8 +213,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": "test-price2",
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": "test-variant_2",
},
@@ -260,8 +264,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": "test-price1",
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": "test-variant_1",
},
@@ -314,8 +320,10 @@ Object {
"currency_code": "usd",
"deleted_at": null,
"id": Any<String>,
"max_quantity": null,
"min_quantity": null,
"price_list_id": null,
"region_id": null,
"sale_amount": null,
"updated_at": Any<String>,
"variant_id": Any<String>,
},
@@ -99,7 +99,9 @@ describe("/store/variants", () => {
deleted_at: null,
id: "test-price",
region_id: null,
sale_amount: null,
min_quantity: null,
max_quantity: null,
price_list_id: null,
variant_id: "test-variant",
},
],
@@ -193,7 +195,9 @@ describe("/store/variants", () => {
deleted_at: null,
id: "test-price",
region_id: null,
sale_amount: null,
min_quantity: null,
max_quantity: null,
price_list_id: null,
variant_id: "test-variant",
},
],
@@ -353,7 +353,9 @@ describe("/store/products", () => {
deleted_at: null,
id: "test-price",
region_id: null,
sale_amount: null,
min_quantity: null,
max_quantity: null,
price_list_id: null,
updated_at: expect.any(String),
variant_id: "test-variant",
},
@@ -396,7 +398,9 @@ describe("/store/products", () => {
deleted_at: null,
id: "test-price2",
region_id: null,
sale_amount: null,
min_quantity: null,
max_quantity: null,
price_list_id: null,
variant_id: "test-variant_2",
},
],
@@ -438,7 +442,9 @@ describe("/store/products", () => {
deleted_at: null,
id: "test-price1",
region_id: null,
sale_amount: null,
min_quantity: null,
max_quantity: null,
price_list_id: null,
updated_at: expect.any(String),
variant_id: "test-variant_1",
},