diff --git a/.eslintignore b/.eslintignore index 32ec6fa5e3..4e1f81a356 100644 --- a/.eslintignore +++ b/.eslintignore @@ -7,10 +7,9 @@ /packages/medusa/src/services/discount.js /packages/medusa/src/services/draft-order.js /packages/medusa/src/services/event-bus.js -/packages/medusa/src/services/fulfillment-provider.js + /packages/medusa/src/services/fulfillment.js /packages/medusa/src/services/idempotency-key.js -/packages/medusa/src/services/inventory.js /packages/medusa/src/services/line-item.js /packages/medusa/src/services/middleware.js /packages/medusa/src/services/note.js diff --git a/packages/medusa/src/services/inventory.js b/packages/medusa/src/services/inventory.js index 944a7e6ffe..3883506b30 100644 --- a/packages/medusa/src/services/inventory.js +++ b/packages/medusa/src/services/inventory.js @@ -29,19 +29,19 @@ class InventoryService extends BaseService { /** * Updates the inventory of a variant based on a given adjustment. - * @params {string} variantId - the id of the variant to update - * @params {number} adjustment - the number to adjust the inventory quantity by + * @param {string} variantId - the id of the variant to update + * @param {number} adjustment - the number to adjust the inventory quantity by * @return {Promise} resolves to the update result. */ async adjustInventory(variantId, adjustment) { - //if variantId is undefined – ergo. a custom item – then do nothing + // if variantId is undefined – ergo. a custom item – then do nothing if (typeof variantId === "undefined" || variantId === null) { return } - return this.atomicPhase_(async manager => { + return this.atomicPhase_(async (manager) => { const variant = await this.productVariantService_.retrieve(variantId) - //if inventory is managed then update + // if inventory is managed then update if (variant.manage_inventory) { return await this.productVariantService_ .withTransaction(manager) @@ -55,13 +55,13 @@ class InventoryService extends BaseService { * Checks if the inventory of a variant can cover a given quantity. Will * return true if the variant doesn't have managed inventory or if the variant * allows backorders or if the inventory quantity is greater than `quantity`. - * @params {string} variantId - the id of the variant to check - * @params {number} quantity - the number of units to check availability for + * @param {string} variantId - the id of the variant to check + * @param {number} quantity - the number of units to check availability for * @return {boolean} true if the inventory covers the quantity */ async confirmInventory(variantId, quantity) { - //if variantId is undefined then confirm inventory as it - //is a custom item that is not managed + // if variantId is undefined then confirm inventory as it + // is a custom item that is not managed if (typeof variantId === "undefined" || variantId === null) { return true }