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 Peretti
2023-02-14 10:52:45 +01:00
committed by GitHub
co-authored by Oliver Windall Juhl
parent 80452332d8
commit 5e0273a370
5 changed files with 85 additions and 38 deletions
@@ -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",