fix(medusa): Discount allocation precision issues (#3244)

This commit is contained in:
Adrien de Peretti
2023-02-13 17:22:18 +01:00
committed by GitHub
parent bbbb3d8882
commit 4cb44a3a2e
10 changed files with 306 additions and 40 deletions

View File

@@ -2569,15 +2569,13 @@ describe("/admin/order-edits", () => {
]),
}),
]),
// rounding issue since we are allocating 1/3 of the discount to one item and 2/3 to the other item where both cost 10
// resulting in adjustment amounts like: 1333...
discount_total: 2001,
total: 1099,
discount_total: 2000,
gift_card_total: 0,
gift_card_tax_total: 0,
shipping_total: 0,
subtotal: 3000,
tax_total: 100,
total: 1100,
})
)