fix(dashboard, core-flows): improvements to order page on canceled orders (#10888)

what:

- Remove pending payment for canceled orders
- Hide unfulfilled items for canceled orders
- Disable non refundable payments from being refunded
- Populate refund created_by
- Disable order edit when canceled
- Fix bug https://github.com/medusajs/medusa/issues/10852

RESOLVES CMRC-842
This commit is contained in:
Riqwan Thamir
2025-01-13 17:51:38 +01:00
committed by GitHub
parent 7232a8a930
commit 1758bfb8d0
9 changed files with 77 additions and 61 deletions

View File

@@ -443,11 +443,12 @@ medusaIntegrationTestRunner({
amount: 106,
payments: [
expect.objectContaining({
// canceled_at: expect.any(String),
canceled_at: null,
refunds: [
expect.objectContaining({
id: expect.any(String),
amount: 106,
created_by: expect.any(String),
}),
],
captures: [
@@ -488,11 +489,9 @@ medusaIntegrationTestRunner({
})
)
const response = await api.post(
`/admin/orders/${order.id}/cancel`,
{},
adminHeaders
)
const response = await api
.post(`/admin/orders/${order.id}/cancel`, {}, adminHeaders)
.catch((e) => e)
expect(response.status).toBe(200)
expect(response.data.order).toEqual(
@@ -514,11 +513,11 @@ medusaIntegrationTestRunner({
amount: 106,
payments: [
expect.objectContaining({
// canceled_at: expect.any(String),
refunds: [
expect.objectContaining({
id: expect.any(String),
amount: 50,
created_by: expect.any(String),
}),
],
captures: [