Skip to content

Commit

Permalink
Merge branch 'develop' into feat/inventory-ux-feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperkristensen authored Jan 10, 2025
2 parents 2638460 + ff72509 commit 149e4d5
Show file tree
Hide file tree
Showing 760 changed files with 144,399 additions and 132,660 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-experts-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/utils": patch
---

feat: add default retry strategy for redis
8 changes: 0 additions & 8 deletions .changeset/angry-coats-warn.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/angry-jobs-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/types": patch
---

fix(types): add missing inventory_items to input of createProductsWorkflow
6 changes: 0 additions & 6 deletions .changeset/beige-ligers-yawn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/chatty-zebras-smash.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/dull-chairs-whisper.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/five-roses-swim.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/forty-forks-move.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/grumpy-adults-relate.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/grumpy-ladybugs-tickle.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/itchy-walls-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

chore(medusa): Add handler path to the http tracing to be able to group by
5 changes: 0 additions & 5 deletions .changeset/light-dodos-knock.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/metal-weeks-retire.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/moody-ladybugs-melt.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/nasty-poets-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/pricing": patch
---

fix(pricing): add null conditions for deleted at during price calculations
7 changes: 0 additions & 7 deletions .changeset/nice-teachers-design.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/quick-buttons-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/pricing": patch
---

fix(pricing): PriceLists of type Sale no longer override default prices when the price list price is higher than the default price.
5 changes: 0 additions & 5 deletions .changeset/real-pianos-eat.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/selfish-coats-drop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silent-lies-knock.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/silver-comics-give.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slow-garlics-accept.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/soft-elephants-attack.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/tall-camels-dance.md

This file was deleted.

8 changes: 8 additions & 0 deletions .changeset/tiny-moles-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@medusajs/medusa": patch
"@medusajs/test-utils": patch
"@medusajs/types": patch
"@medusajs/utils": patch
---

feat: remove dead code and refactor the logic of resolving plugins
5 changes: 0 additions & 5 deletions .changeset/two-bananas-switch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/unlucky-carpets-remain.md

This file was deleted.

166 changes: 166 additions & 0 deletions integration-tests/http/__tests__/product/store/product.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,89 @@ medusaIntegrationTestRunner({
expect(response.data.products).toEqual(expectation)
})

it("should list products with prices with a default price when the price list price is higher and the price list is of type SALE", async () => {
const priceList = (
await api.post(
`/admin/price-lists`,
{
title: "test price list",
description: "test",
status: PriceListStatus.ACTIVE,
type: PriceListType.SALE,
prices: [
{
amount: 3500,
currency_code: "usd",
variant_id: product.variants[0].id,
},
],
rules: { "customer.groups.id": [customerGroup.id] },
},
adminHeaders
)
).data.price_list

let response = await api.get(
`/store/products?fields=*variants.calculated_price&region_id=${region.id}`,
storeHeadersWithCustomer
)

const expectation = expect.arrayContaining([
expect.objectContaining({
id: product.id,
variants: [
expect.objectContaining({
calculated_price: {
id: expect.any(String),
is_calculated_price_price_list: false,
is_calculated_price_tax_inclusive: false,
calculated_amount: 3000,
raw_calculated_amount: {
value: "3000",
precision: 20,
},
is_original_price_price_list: false,
is_original_price_tax_inclusive: false,
original_amount: 3000,
raw_original_amount: {
value: "3000",
precision: 20,
},
currency_code: "usd",
calculated_price: {
id: expect.any(String),
price_list_id: null,
price_list_type: null,
min_quantity: null,
max_quantity: null,
},
original_price: {
id: expect.any(String),
price_list_id: null,
price_list_type: null,
min_quantity: null,
max_quantity: null,
},
},
}),
],
}),
])

expect(response.status).toEqual(200)
expect(response.data.count).toEqual(3)
expect(response.data.products).toEqual(expectation)

// with only region_id
response = await api.get(
`/store/products?region_id=${region.id}`,
storeHeadersWithCustomer
)

expect(response.status).toEqual(200)
expect(response.data.products).toEqual(expectation)
})

it("should list products with prices with a override price list price", async () => {
const priceList = (
await api.post(
Expand Down Expand Up @@ -1254,6 +1337,89 @@ medusaIntegrationTestRunner({
expect(response.status).toEqual(200)
expect(response.data.products).toEqual(expectation)
})

it("should list products with prices with a override price list price even if the price list price is higher than the default price", async () => {
const priceList = (
await api.post(
`/admin/price-lists`,
{
title: "test price list",
description: "test",
status: PriceListStatus.ACTIVE,
type: PriceListType.OVERRIDE,
prices: [
{
amount: 35000,
currency_code: "usd",
variant_id: product.variants[0].id,
},
],
rules: { "customer.groups.id": [customerGroup.id] },
},
adminHeaders
)
).data.price_list

let response = await api.get(
`/store/products?fields=*variants.calculated_price&region_id=${region.id}`,
storeHeadersWithCustomer
)

const expectation = expect.arrayContaining([
expect.objectContaining({
id: product.id,
variants: [
expect.objectContaining({
calculated_price: {
id: expect.any(String),
is_calculated_price_price_list: true,
is_calculated_price_tax_inclusive: false,
calculated_amount: 35000,
raw_calculated_amount: {
value: "35000",
precision: 20,
},
is_original_price_price_list: true,
is_original_price_tax_inclusive: false,
original_amount: 35000,
raw_original_amount: {
value: "35000",
precision: 20,
},
currency_code: "usd",
calculated_price: {
id: expect.any(String),
price_list_id: priceList.id,
price_list_type: "override",
min_quantity: null,
max_quantity: null,
},
original_price: {
id: expect.any(String),
price_list_id: priceList.id,
price_list_type: "override",
min_quantity: null,
max_quantity: null,
},
},
}),
],
}),
])

expect(response.status).toEqual(200)
expect(response.data.count).toEqual(3)
expect(response.data.products).toEqual(expectation)

// with only region_id
response = await api.get(
`/store/products?region_id=${region.id}`,
storeHeadersWithCustomer
)

expect(response.status).toEqual(200)
expect(response.data.products).toEqual(expectation)
})
})

describe("with inventory items", () => {
Expand Down
9 changes: 9 additions & 0 deletions packages/admin/admin-bundler/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @medusajs/admin-bundler

## 2.2.0

### Patch Changes

- Updated dependencies [[`47594192b79fbc798cfaf21821b60673745d1374`](https://github.com/medusajs/medusa/commit/47594192b79fbc798cfaf21821b60673745d1374)]:
- @medusajs/dashboard@2.2.0
- @medusajs/admin-shared@2.2.0
- @medusajs/admin-vite-plugin@2.2.0

## 2.1.3

### Patch Changes
Expand Down
Loading

0 comments on commit 149e4d5

Please sign in to comment.