feat(medusa): Separate money amount and variant (#4906)
* initial changes * working test * final changes to product tests * update integration tests * update price list integration tests * update integration tests * update unit tests * update plugin integration tests * remove catch from integration test * undo change * add andWhere * update upsertCurrencyMoneyAmount method * undo line item changes * undo changes * update deprecated method * Update packages/medusa/src/migrations/1692953518123-drop_money_amount_constraints_for_pricing_module.ts Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> * rename joinTable * update with joinTable entity * update load methods * remove await create * re-add context test * update price list behavior for prices * update price list snapshots * re-add admin seeder * pr feedback * fix unit tests * fix plugin integration tests * initial review changes * redo changes to variant creation --------- Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
@@ -86,13 +86,13 @@ describe("Promotions", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
@@ -141,13 +141,13 @@ describe("Promotions", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
@@ -436,13 +436,13 @@ describe("Promotions", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
|
||||
@@ -804,13 +804,13 @@ describe("tax inclusive prices", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
@@ -859,13 +859,13 @@ describe("tax inclusive prices", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
@@ -1154,13 +1154,13 @@ describe("tax inclusive prices", () => {
|
||||
expect(variant.prices).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.objectContaining({
|
||||
id: "test-price1",
|
||||
id: "test-price-1",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
amount: 120,
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "test-price3",
|
||||
id: "test-price-3",
|
||||
region_id: "test-region",
|
||||
currency_code: "usd",
|
||||
price_list_id: "pl",
|
||||
|
||||
Reference in New Issue
Block a user