feat(dashboard, js-sdk, types): receive return e2e (#8305)

**What**
- receive return flow
- order summary section adjustments
- fix received item in summary
- activity event

---

CLOSES TRI-79 CC-256
This commit is contained in:
Frane Polić
2024-08-01 18:29:11 +00:00
committed by GitHub
parent 7ae1d80380
commit 2280d31396
21 changed files with 1536 additions and 167 deletions
+5 -3
View File
@@ -2,14 +2,16 @@ import { AdminOrderLineItem } from "@medusajs/types"
export function getReturnableQuantity(item: AdminOrderLineItem): number {
const {
// TODO: this should be `fulfilled_quantity`? now there is check on the BD that we can't return more quantity than we shipped but some items don't require shipping
shipped_quantity,
return_received_quantity,
return_dismissed_quantity, // TODO: check this
return_dismissed_quantity,
return_requested_quantity,
} = item.detail
return (
shipped_quantity - (return_received_quantity + return_requested_quantity)
shipped_quantity -
(return_received_quantity +
return_requested_quantity +
return_dismissed_quantity)
)
}