Skip to content

Commit

Permalink
Merge branch 'develop' into fix/distribute-transaction-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
carlos-r-l-rodrigues authored Jan 10, 2025
2 parents 8b14fe6 + a126f40 commit 12d1558
Show file tree
Hide file tree
Showing 2,736 changed files with 405,132 additions and 297,513 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
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
5 changes: 0 additions & 5 deletions .changeset/eight-pigs-wave.md

This file was deleted.

9 changes: 0 additions & 9 deletions .changeset/gorgeous-tools-enjoy.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/heavy-spies-thank.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/little-books-think.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
5 changes: 0 additions & 5 deletions .changeset/pink-ways-count.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/slimy-seas-join.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
---
"@medusajs/fulfillment": patch
"@medusajs/medusa": patch
"@medusajs/types": patch
"@medusajs/utils": patch
"@medusajs/medusa": patch
---

chore: fulfillment module DML
Feat/merge plugin modules
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/wet-queens-deliver.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/wild-parrots-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/medusa": patch
"@medusajs/framework": patch
---

chore: move build utilities to Compiler class
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Thank you for considering contributing to Medusa! This document will outline how to submit changes to this repository and which conventions to follow. If you are ever in doubt about anything we encourage you to reach out either by submitting an issue here or reaching out [via Discord](https://discord.gg/xpCwq3Kfn8).

If you're contributing to our documentation, make sure to also check out the [contribution guidelines on our documentation website](https://docs.medusajs.com/contribution-guidelines).
If you're contributing to our documentation, make sure to also check out the [contribution guidelines on our documentation website](https://docs.medusajs.com/resources/contribution-guidelines/docs).

### Important
Our core maintainers prioritize pull requests (PRs) from within our organization. External contributions are regularly triaged, but not at any fixed cadence. It varies depending on how busy the maintainers are. This is applicable to all types of PRs, so we kindly ask for your patience.
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,11 @@ Visit the [Documentation](https://docs.medusajs.com/learn) to set up a Medusa ap

## What is Medusa

Medusa is a set of commerce modules and tools that allow you to build rich, reliable, and performant commerce applications without reinventing core commerce logic. The modules can be customized and used to build advanced ecommerce stores, marketplaces, or any product that needs foundational commerce primitives. All modules are open-source and freely available on npm.
Medusa is an ecommerce platform with a built-in framework for customization that allows you to build custom commerce applications without reinventing core commerce logic. The framework and modules can be used to build advanced B2B or DTC ecommerce stores, marketplaces, PoS systems, service businesses, or any product that needs foundational commerce primitives. All commerce modules are open-source and freely available on npm.

Learn more about [Medusa’s architecture](https://docs.medusajs.com/learn/advanced-development/architecture/overview) and [commerce modules](https://docs.medusajs.com/resources/commerce-modules) in the Docs.

## Roadmap, Upgrades & Integrations

You can view the planned, started and completed features in the [Roadmap discussion](https://github.com/medusajs/medusa/discussions/categories/roadmap).
## Upgrades & Integrations

Follow the [Release Notes](https://github.com/medusajs/medusa/releases) to keep your Medusa project up-to-date.

Expand Down
28 changes: 28 additions & 0 deletions integration-tests/http/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# integration-tests-http

## 1.0.6

### Patch Changes

- Updated dependencies [[`100da64242838739816351ed259461f2d7c258e3`](https://github.com/medusajs/medusa/commit/100da64242838739816351ed259461f2d7c258e3), [`d08b71f9b87c68350e57016e62e406a9bdd82342`](https://github.com/medusajs/medusa/commit/d08b71f9b87c68350e57016e62e406a9bdd82342), [`c9b8db04c1b35f1cf129bb9ad74789fbc2881815`](https://github.com/medusajs/medusa/commit/c9b8db04c1b35f1cf129bb9ad74789fbc2881815), [`9d85e663b8bac2240ec3e3bf99377dd0eac72160`](https://github.com/medusajs/medusa/commit/9d85e663b8bac2240ec3e3bf99377dd0eac72160), [`5d1098ceb9713225186fce16c0306b0539d71fc5`](https://github.com/medusajs/medusa/commit/5d1098ceb9713225186fce16c0306b0539d71fc5), [`1232a43fcec50b01477149089bbb957dec15ba76`](https://github.com/medusajs/medusa/commit/1232a43fcec50b01477149089bbb957dec15ba76)]:
- @medusajs/fulfillment@2.1.3
- @medusajs/utils@2.1.3
- @medusajs/medusa@2.1.3
- @medusajs/product@2.1.3
- @medusajs/core-flows@2.1.3
- @medusajs/modules-sdk@2.1.3
- @medusajs/test-utils@2.1.3
- @medusajs/api-key@2.1.3
- @medusajs/auth@2.1.3
- @medusajs/cache-inmemory@2.1.3
- @medusajs/customer@2.1.3
- @medusajs/event-bus-local@2.1.3
- @medusajs/inventory@2.1.3
- @medusajs/pricing@2.1.3
- @medusajs/promotion@2.1.3
- @medusajs/fulfillment-manual@2.1.3
- @medusajs/region@2.1.3
- @medusajs/stock-location@2.1.3
- @medusajs/store@2.1.3
- @medusajs/tax@2.1.3
- @medusajs/user@2.1.3
- @medusajs/workflow-engine-inmemory@2.1.3

## 1.0.5

### Patch Changes
Expand Down
11 changes: 10 additions & 1 deletion integration-tests/http/__tests__/cart/store/cart.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,15 @@ medusaIntegrationTestRunner({
})
)

await api.post(
`/store/carts/${cart.id}/line-items`,
{
variant_id: product.variants[0].id,
quantity: 100,
},
storeHeaders
)

let cartAfterExpensiveShipping = (
await api.post(
`/store/carts/${cart.id}/shipping-methods`,
Expand All @@ -631,7 +640,7 @@ medusaIntegrationTestRunner({
}),
]),
payment_collection: expect.objectContaining({
amount: 6398,
amount: 156398,
}),
})
)
Expand Down
193 changes: 193 additions & 0 deletions integration-tests/http/__tests__/order/admin/order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,199 @@ medusaIntegrationTestRunner({
})
})

describe("POST /orders/:id/cancel", () => {
beforeEach(async () => {
seeder = await createOrderSeeder({
api,
container: getContainer(),
})
order = seeder.order

order = (await api.get(`/admin/orders/${order.id}`, adminHeaders)).data
.order
})

it("should successfully cancel an order and its authorized but not captured payments", async () => {
const response = await api.post(
`/admin/orders/${order.id}/cancel`,
{},
adminHeaders
)

expect(response.status).toBe(200)
expect(response.data.order).toEqual(
expect.objectContaining({
id: order.id,
status: "canceled",

summary: expect.objectContaining({
credit_line_total: 106,
current_order_total: 0,
accounting_total: 0,
}),

payment_collections: [
expect.objectContaining({
status: "canceled",
captured_amount: 0,
refunded_amount: 0,
amount: 106,
payments: [
expect.objectContaining({
canceled_at: expect.any(String),
refunds: [],
captures: [],
}),
],
}),
],
})
)
})

it("should successfully cancel an order with a captured payment", async () => {
const payment = order.payment_collections[0].payments[0]

const paymentResponse = await api.post(
`/admin/payments/${payment.id}/capture`,
undefined,
adminHeaders
)

expect(paymentResponse.data.payment).toEqual(
expect.objectContaining({
id: payment.id,
captured_at: expect.any(String),
captures: [
expect.objectContaining({
id: expect.any(String),
amount: 106,
}),
],
refunds: [],
amount: 106,
})
)

const response = await api.post(
`/admin/orders/${order.id}/cancel`,
{},
adminHeaders
)

expect(response.status).toBe(200)
expect(response.data.order).toEqual(
expect.objectContaining({
id: order.id,
status: "canceled",

summary: expect.objectContaining({
credit_line_total: 106,
current_order_total: 0,
accounting_total: 0,
}),

payment_collections: [
expect.objectContaining({
status: "canceled",
captured_amount: 106,
refunded_amount: 106,
amount: 106,
payments: [
expect.objectContaining({
// canceled_at: expect.any(String),
refunds: [
expect.objectContaining({
id: expect.any(String),
amount: 106,
}),
],
captures: [
expect.objectContaining({
id: expect.any(String),
amount: 106,
}),
],
}),
],
}),
],
})
)
})

it("should successfully cancel an order with a partially captured payment", async () => {
const payment = order.payment_collections[0].payments[0]

const paymentResponse = await api.post(
`/admin/payments/${payment.id}/capture`,
{ amount: 50 },
adminHeaders
)

expect(paymentResponse.data.payment).toEqual(
expect.objectContaining({
id: payment.id,
captured_at: null,
captures: [
expect.objectContaining({
id: expect.any(String),
amount: 50,
}),
],
refunds: [],
amount: 106,
})
)

const response = await api.post(
`/admin/orders/${order.id}/cancel`,
{},
adminHeaders
)

expect(response.status).toBe(200)
expect(response.data.order).toEqual(
expect.objectContaining({
id: order.id,
status: "canceled",

summary: expect.objectContaining({
credit_line_total: 106,
current_order_total: 0,
accounting_total: 0,
}),

payment_collections: [
expect.objectContaining({
status: "canceled",
captured_amount: 50,
refunded_amount: 50,
amount: 106,
payments: [
expect.objectContaining({
// canceled_at: expect.any(String),
refunds: [
expect.objectContaining({
id: expect.any(String),
amount: 50,
}),
],
captures: [
expect.objectContaining({
id: expect.any(String),
amount: 50,
}),
],
}),
],
}),
],
})
)
})
})

describe("POST /orders/:id/fulfillments", () => {
beforeEach(async () => {
const stockChannelOverride = (
Expand Down
Loading

0 comments on commit 12d1558

Please sign in to comment.