chore(medusa): New totals calc. in Swap creation (#3191)

* feat(medusa): Cleanup swap creation flow

* revert test and package

* fix unit tests

* fix swap seeder that does not include the tax lines on the return line item

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
Adrien de PerettiandOliver Windall Juhl authored and GitHub committed 2023-02-14 10:52:45 +01:00
1 parent 80452332d8
commit 5e0273a370
5 files changed
+85 -38

No files matched your search

@@ -138,9 +138,9 @@ export default async (req, res) => {
.workStage(idempotencyKey.idempotency_key, async (manager) => {
const order = await orderService
.withTransaction(manager)
.retrieve(id, {
select: ["refunded_total", "total"],
.retrieveWithTotals(id, {
relations: [
"cart",
"items",
"items.tax_lines",
"swaps",