From 314d1709cf38b962dc29103d5d1b45a0779a1471 Mon Sep 17 00:00:00 2001 From: adrien2p Date: Thu, 15 Sep 2022 20:24:34 +0200 Subject: [PATCH] fix(medusa): order edit service mock get totals + fix oas --- packages/medusa/src/models/order-edit.ts | 10 +++++----- packages/medusa/src/services/__mocks__/order-edit.js | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/medusa/src/models/order-edit.ts b/packages/medusa/src/models/order-edit.ts index 5d3fd4140afaa..b8b41817b19f9 100644 --- a/packages/medusa/src/models/order-edit.ts +++ b/packages/medusa/src/models/order-edit.ts @@ -136,23 +136,23 @@ export class OrderEdit extends SoftDeletableEntity { * type: string * subtotal: * type: integer - * description: The subtotal for line items computed from changes. + * description: The total of subtotal * example: 8000 * discount_total: * type: integer * description: The total of discount * example: 800 - * shipping_total + * shipping_total: * type: integer * description: The total of the shipping amount * example: 800 - * gift_card_total + * gift_card_total: * type: integer * description: The total of the gift card amount * example: 800 - * gift_card_tax_total + * gift_card_tax_total: * type: integer - * description: The total of the gift card amount + * description: The total of the gift card tax amount * example: 800 * tax_total: * type: integer diff --git a/packages/medusa/src/services/__mocks__/order-edit.js b/packages/medusa/src/services/__mocks__/order-edit.js index 75a0f35f5e8f9..0bd95ae2d00c7 100644 --- a/packages/medusa/src/services/__mocks__/order-edit.js +++ b/packages/medusa/src/services/__mocks__/order-edit.js @@ -60,6 +60,9 @@ export const orderEditServiceMock = { created_by: context.loggedInUserId, }) }), + getTotals: jest.fn().mockImplementation(() => { + return Promise.resolve({}) + }), } const mock = jest.fn().mockImplementation(() => {