From 5c7efbb838ff4ac2b103b67ca95208b4df6a14f0 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 11 Nov 2021 10:33:21 +0100 Subject: [PATCH 1/8] feat(item): back filter buyer in search panel ans test --- .../10370-pickles/00-item_getBalance.sql | 4 +- db/dump/fixtures.sql | 2 +- modules/item/back/methods/item/active.js | 42 +++++++++++++++++++ .../item/back/methods/item/activeWithBuyer.js | 31 ++++++++++++++ .../item/specs/activeWithBuyer.spec.js | 14 +++++++ modules/item/back/models/item.js | 2 + modules/item/front/search-panel/index.html | 4 +- 7 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 modules/item/back/methods/item/active.js create mode 100644 modules/item/back/methods/item/activeWithBuyer.js create mode 100644 modules/item/back/methods/item/specs/activeWithBuyer.spec.js diff --git a/db/changes/10370-pickles/00-item_getBalance.sql b/db/changes/10370-pickles/00-item_getBalance.sql index 91e5c3681..90e3ee2bb 100644 --- a/db/changes/10370-pickles/00-item_getBalance.sql +++ b/db/changes/10370-pickles/00-item_getBalance.sql @@ -1,9 +1,9 @@ -DROP PROCEDURE IF EXISTS vn.item_getBalance; +DROP PROCEDURE IF EXISTS `vn`.`item_getBalance`; DELIMITER $$ $$ CREATE - definer = root@`%` procedure vn.item_getBalance(IN vItemId int, IN vWarehouse int) + definer = root@`%` procedure `vn`.`item_getBalance`(IN vItemId int, IN vWarehouse int) BEGIN DECLARE vDateInventory DATETIME; DECLARE vCurdate DATE DEFAULT CURDATE(); diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 49a78ec98..28b8e9181 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -739,7 +739,7 @@ INSERT INTO `vn`.`itemType`(`id`, `code`, `name`, `categoryFk`, `warehouseFk`, ` (3, 'WPN', 'Paniculata', 2, 1, 31, 35, 0), (4, 'PRT', 'Delivery ports', 3, 1, NULL, 35, 1), (5, 'CON', 'Container', 3, 1, NULL, 35, 1), - (6, 'ALS', 'Alstroemeria', 1, 1, 31, 35, 0); + (6, 'ALS', 'Alstroemeria', 1, 1, 31, 16, 0); INSERT INTO `vn`.`ink`(`id`, `name`, `picture`, `showOrder`, `hex`) VALUES diff --git a/modules/item/back/methods/item/active.js b/modules/item/back/methods/item/active.js new file mode 100644 index 000000000..4537ab994 --- /dev/null +++ b/modules/item/back/methods/item/active.js @@ -0,0 +1,42 @@ +const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; +const buildFilter = require('vn-loopback/util/filter').buildFilter; +const mergeFilters = require('vn-loopback/util/filter').mergeFilters; + +module.exports = Self => { + Self.activeWorkers = async(query, filter) => { + let conn = Self.dataSource.connector; + if (filter.where && filter.where.and && Array.isArray(filter.where.and)) { + let where = {}; + filter.where.and.forEach(element => { + where[Object.keys(element)[0]] = Object.values(element)[0]; + }); + filter.where = where; + } + let clientFilter = Object.assign({}, filter); + clientFilter.where = buildFilter(filter.where, (param, value) => { + switch (param) { + case 'role': + return {'r.name': value}; + case 'firstName': + return {or: [ + {'w.firstName': {like: `%${value}%`}}, + {'w.lastName': {like: `%${value}%`}}, + {'u.name': {like: `%${value}%`}}, + {'u.nickname': {like: `%${value}%`}} + ]}; + case 'id': + return {'w.id': value}; + } + }); + + let myFilter = { + where: {'u.active': true} + }; + + myFilter = mergeFilters(myFilter, clientFilter); + + let stmt = new ParameterizedSQL(query); + stmt.merge(conn.makeSuffix(myFilter)); + return conn.executeStmt(stmt); + }; +}; diff --git a/modules/item/back/methods/item/activeWithBuyer.js b/modules/item/back/methods/item/activeWithBuyer.js new file mode 100644 index 000000000..ca2c9329d --- /dev/null +++ b/modules/item/back/methods/item/activeWithBuyer.js @@ -0,0 +1,31 @@ + +module.exports = Self => { + Self.remoteMethod('activeWithBuyer', { + description: 'Returns active workers in itemType', + accessType: 'READ', + accepts: [{ + arg: 'filter', + type: 'Object', + description: 'Filter defining where and paginated data', + required: false + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/activeWithBuyer`, + verb: 'GET' + } + }); + + Self.activeWithBuyer = async filter => { + const query = + `SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname + FROM worker w + JOIN itemType i ON i.workerFk = w.id + JOIN account.user u ON u.id = w.id`; + + return Self.activeWorkers(query, filter); + }; +}; diff --git a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js new file mode 100644 index 000000000..f894e431a --- /dev/null +++ b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js @@ -0,0 +1,14 @@ +const models = require('vn-loopback/server/server').models; + +describe('Worker activeWithBuyer', () => { + it('should return the buyers in itemType as result', async() => { + const filter = {}; + const result = await models.Item.activeWithBuyer(filter); + const firstWorker = result[0]; + const secondWorker = result[1]; + + expect(result.length).toEqual(2); + expect(firstWorker.nickname).toEqual('logisticBossNick'); + expect(secondWorker.nickname).toEqual('buyerNick'); + }); +}); diff --git a/modules/item/back/models/item.js b/modules/item/back/models/item.js index 6cf5ba625..887aa0a11 100644 --- a/modules/item/back/models/item.js +++ b/modules/item/back/models/item.js @@ -14,6 +14,8 @@ module.exports = Self => { require('../methods/item/getWasteByWorker')(Self); require('../methods/item/getWasteByItem')(Self); require('../methods/item/createIntrastat')(Self); + require('../methods/item/active')(Self); + require('../methods/item/activeWithBuyer')(Self); Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'}); diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index 518062eba..425df3d4f 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -41,12 +41,10 @@ -- 2.40.1 From adf295ebf304edc30a699848b0f2dcda31780308 Mon Sep 17 00:00:00 2001 From: alexm Date: Mon, 15 Nov 2021 12:14:34 +0100 Subject: [PATCH 2/8] fix(item): add ng-model, add fixture and transaction back test --- db/dump/fixtures.sql | 2 +- .../item/specs/activeWithBuyer.spec.js | 24 +++++++++++++------ modules/item/front/search-panel/index.html | 1 + 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index 28b8e9181..08f6643e7 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -814,7 +814,7 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT'), (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), (16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), - (71, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT'); + (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT'); -- Update the taxClass after insert of the items UPDATE `vn`.`itemTaxCountry` SET `taxClassFk` = 2 diff --git a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js index f894e431a..58860c204 100644 --- a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js +++ b/modules/item/back/methods/item/specs/activeWithBuyer.spec.js @@ -2,13 +2,23 @@ const models = require('vn-loopback/server/server').models; describe('Worker activeWithBuyer', () => { it('should return the buyers in itemType as result', async() => { - const filter = {}; - const result = await models.Item.activeWithBuyer(filter); - const firstWorker = result[0]; - const secondWorker = result[1]; + const tx = await models.Item.beginTransaction({}); - expect(result.length).toEqual(2); - expect(firstWorker.nickname).toEqual('logisticBossNick'); - expect(secondWorker.nickname).toEqual('buyerNick'); + try { + const options = {transaction: tx}; + const filter = {}; + const result = await models.Item.activeWithBuyer(filter, options); + const firstWorker = result[0]; + const secondWorker = result[1]; + + expect(result.length).toEqual(2); + expect(firstWorker.nickname).toEqual('logisticBossNick'); + expect(secondWorker.nickname).toEqual('buyerNick'); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } }); }); diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index 425df3d4f..29b2a24fc 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -41,6 +41,7 @@ Date: Mon, 15 Nov 2021 14:50:02 +0100 Subject: [PATCH 3/8] transaction activeWithBuyer.js --- db/dump/fixtures.sql | 2 +- .../item/back/methods/item/activeWithBuyer.js | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index e31c873c4..9a83f4163 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -813,7 +813,7 @@ INSERT INTO `vn`.`item`(`id`, `typeFk`, `size`, `inkFk`, `stems`, `originFk`, `d (13, 5, 30, 'RED', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '13', NULL, 0, 2, 'VT'), (14, 5, 90, 'BLU', 1, 2, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 4, 'VT'), (15, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), - (16, 4, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), + (16, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'EMB'), (71, 6, NULL, NULL, NULL, 1, NULL, NULL, 06021010, 4751000000, NULL, 0, '', NULL, 0, 0, 'VT'); -- Update the taxClass after insert of the items diff --git a/modules/item/back/methods/item/activeWithBuyer.js b/modules/item/back/methods/item/activeWithBuyer.js index ca2c9329d..121079aaa 100644 --- a/modules/item/back/methods/item/activeWithBuyer.js +++ b/modules/item/back/methods/item/activeWithBuyer.js @@ -1,4 +1,3 @@ - module.exports = Self => { Self.remoteMethod('activeWithBuyer', { description: 'Returns active workers in itemType', @@ -19,13 +18,18 @@ module.exports = Self => { } }); - Self.activeWithBuyer = async filter => { - const query = - `SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname - FROM worker w - JOIN itemType i ON i.workerFk = w.id - JOIN account.user u ON u.id = w.id`; + Self.activeWithBuyer = async(filter, options) => { + const myOptions = {}; - return Self.activeWorkers(query, filter); + if (typeof options == 'object') + Object.assign(myOptions, options); + + const query = + `SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname + FROM worker w + JOIN itemType i ON i.workerFk = w.id + JOIN account.user u ON u.id = w.id`; + + return Self.activeWorkers(query, filter, myOptions); }; }; -- 2.40.1 From f27420c14aa21db5cbb0dde0fe0366ad9479cc2a Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 16 Nov 2021 13:56:09 +0100 Subject: [PATCH 4/8] refactor(item): activeBuyers --- modules/item/back/methods/item/active.js | 42 ----------------- .../item/back/methods/item/activeBuyers.js | 45 +++++++++++++++++++ .../item/back/methods/item/activeWithBuyer.js | 35 --------------- modules/item/back/methods/item/filter.js | 2 +- modules/item/back/models/item.js | 3 +- modules/item/front/search-panel/index.html | 7 ++- 6 files changed, 50 insertions(+), 84 deletions(-) delete mode 100644 modules/item/back/methods/item/active.js create mode 100644 modules/item/back/methods/item/activeBuyers.js delete mode 100644 modules/item/back/methods/item/activeWithBuyer.js diff --git a/modules/item/back/methods/item/active.js b/modules/item/back/methods/item/active.js deleted file mode 100644 index 4537ab994..000000000 --- a/modules/item/back/methods/item/active.js +++ /dev/null @@ -1,42 +0,0 @@ -const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; -const buildFilter = require('vn-loopback/util/filter').buildFilter; -const mergeFilters = require('vn-loopback/util/filter').mergeFilters; - -module.exports = Self => { - Self.activeWorkers = async(query, filter) => { - let conn = Self.dataSource.connector; - if (filter.where && filter.where.and && Array.isArray(filter.where.and)) { - let where = {}; - filter.where.and.forEach(element => { - where[Object.keys(element)[0]] = Object.values(element)[0]; - }); - filter.where = where; - } - let clientFilter = Object.assign({}, filter); - clientFilter.where = buildFilter(filter.where, (param, value) => { - switch (param) { - case 'role': - return {'r.name': value}; - case 'firstName': - return {or: [ - {'w.firstName': {like: `%${value}%`}}, - {'w.lastName': {like: `%${value}%`}}, - {'u.name': {like: `%${value}%`}}, - {'u.nickname': {like: `%${value}%`}} - ]}; - case 'id': - return {'w.id': value}; - } - }); - - let myFilter = { - where: {'u.active': true} - }; - - myFilter = mergeFilters(myFilter, clientFilter); - - let stmt = new ParameterizedSQL(query); - stmt.merge(conn.makeSuffix(myFilter)); - return conn.executeStmt(stmt); - }; -}; diff --git a/modules/item/back/methods/item/activeBuyers.js b/modules/item/back/methods/item/activeBuyers.js new file mode 100644 index 000000000..ed19dd46b --- /dev/null +++ b/modules/item/back/methods/item/activeBuyers.js @@ -0,0 +1,45 @@ +const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; +const mergeFilters = require('vn-loopback/util/filter').mergeFilters; + +module.exports = Self => { + Self.remoteMethod('activeBuyers', { + description: 'Returns a list of agencies from a warehouse', + accepts: [{ + arg: 'filter', + type: 'object', + description: `Filter defining where, order, offset, and limit - must be a JSON-encoded string` + }], + returns: { + type: ['object'], + root: true + }, + http: { + path: `/activeBuyers`, + verb: 'GET' + } + }); + + Self.activeBuyers = async(filter, options) => { + const conn = Self.dataSource.connector; + const where = {isActive: true}; + let myOptions = {}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + + filter = mergeFilters(filter, {where}); + + let stmt = new ParameterizedSQL( + `SELECT DISTINCT w.id workerFk, w.firstName, w.lastName, u.name, u.nickname + FROM worker w + JOIN itemType it ON it.workerFk = w.id + JOIN account.user u ON u.id = w.id + JOIN item i ON i.typeFk = it.id`, + null, myOptions); + + stmt.merge(conn.makeSuffix(filter)); + console.log(stmt); + + return conn.executeStmt(stmt); + }; +}; diff --git a/modules/item/back/methods/item/activeWithBuyer.js b/modules/item/back/methods/item/activeWithBuyer.js deleted file mode 100644 index 121079aaa..000000000 --- a/modules/item/back/methods/item/activeWithBuyer.js +++ /dev/null @@ -1,35 +0,0 @@ -module.exports = Self => { - Self.remoteMethod('activeWithBuyer', { - description: 'Returns active workers in itemType', - accessType: 'READ', - accepts: [{ - arg: 'filter', - type: 'Object', - description: 'Filter defining where and paginated data', - required: false - }], - returns: { - type: ['object'], - root: true - }, - http: { - path: `/activeWithBuyer`, - verb: 'GET' - } - }); - - Self.activeWithBuyer = async(filter, options) => { - const myOptions = {}; - - if (typeof options == 'object') - Object.assign(myOptions, options); - - const query = - `SELECT DISTINCT w.id, w.firstName, w.lastName, u.name, u.nickname - FROM worker w - JOIN itemType i ON i.workerFk = w.id - JOIN account.user u ON u.id = w.id`; - - return Self.activeWorkers(query, filter, myOptions); - }; -}; diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 8cfefac9f..99152467a 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -44,7 +44,7 @@ module.exports = Self => { description: 'Whether the the item is or not active', }, { - arg: 'salesPersonFk', + arg: 'buyerFk', type: 'integer', description: 'The buyer of the item', }, diff --git a/modules/item/back/models/item.js b/modules/item/back/models/item.js index 887aa0a11..457cce4f2 100644 --- a/modules/item/back/models/item.js +++ b/modules/item/back/models/item.js @@ -14,8 +14,7 @@ module.exports = Self => { require('../methods/item/getWasteByWorker')(Self); require('../methods/item/getWasteByItem')(Self); require('../methods/item/createIntrastat')(Self); - require('../methods/item/active')(Self); - require('../methods/item/activeWithBuyer')(Self); + require('../methods/item/activeBuyers')(Self); Self.validatesPresenceOf('originFk', {message: 'Cannot be blank'}); diff --git a/modules/item/front/search-panel/index.html b/modules/item/front/search-panel/index.html index 29b2a24fc..2a8f52827 100644 --- a/modules/item/front/search-panel/index.html +++ b/modules/item/front/search-panel/index.html @@ -40,12 +40,11 @@ -- 2.40.1 From 6fa60e597ab4201675f00c088693ee9d60747354 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 16 Nov 2021 14:13:15 +0100 Subject: [PATCH 5/8] refactor(item): activeBuyer.spec.js --- modules/item/back/methods/item/activeBuyers.js | 1 - .../specs/{activeWithBuyer.spec.js => activeBuyers.spec.js} | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) rename modules/item/back/methods/item/specs/{activeWithBuyer.spec.js => activeBuyers.spec.js} (84%) diff --git a/modules/item/back/methods/item/activeBuyers.js b/modules/item/back/methods/item/activeBuyers.js index ed19dd46b..6489ae74f 100644 --- a/modules/item/back/methods/item/activeBuyers.js +++ b/modules/item/back/methods/item/activeBuyers.js @@ -38,7 +38,6 @@ module.exports = Self => { null, myOptions); stmt.merge(conn.makeSuffix(filter)); - console.log(stmt); return conn.executeStmt(stmt); }; diff --git a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js b/modules/item/back/methods/item/specs/activeBuyers.spec.js similarity index 84% rename from modules/item/back/methods/item/specs/activeWithBuyer.spec.js rename to modules/item/back/methods/item/specs/activeBuyers.spec.js index 58860c204..5bf36756f 100644 --- a/modules/item/back/methods/item/specs/activeWithBuyer.spec.js +++ b/modules/item/back/methods/item/specs/activeBuyers.spec.js @@ -1,13 +1,13 @@ const models = require('vn-loopback/server/server').models; -describe('Worker activeWithBuyer', () => { +describe('Worker activeBuyers', () => { it('should return the buyers in itemType as result', async() => { const tx = await models.Item.beginTransaction({}); try { const options = {transaction: tx}; const filter = {}; - const result = await models.Item.activeWithBuyer(filter, options); + const result = await models.Item.activeBuyers(filter, options); const firstWorker = result[0]; const secondWorker = result[1]; -- 2.40.1 From 1d253fc53db391989ce5a171be6fa953c783f2ee Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 18 Nov 2021 11:17:30 +0100 Subject: [PATCH 6/8] definitions corrected for myOptions of endpoints --- back/methods/chat/sendCheckingPresence.js | 2 +- back/methods/dms/updateFile.js | 2 +- back/methods/dms/uploadFile.js | 2 +- back/methods/starred-module/getStarredModules.js | 2 +- back/methods/starred-module/setPosition.js | 2 +- back/methods/starred-module/toggleStarredModule.js | 2 +- .../back/methods/claim-beginning/importToNewRefundTicket.js | 2 +- modules/claim/back/methods/claim-dms/removeFile.js | 2 +- modules/claim/back/methods/claim-end/importTicketSales.js | 2 +- modules/claim/back/methods/claim/regularizeClaim.js | 2 +- modules/claim/back/methods/claim/updateClaim.js | 2 +- modules/claim/back/methods/claim/updateClaimAction.js | 2 +- modules/claim/back/methods/claim/uploadFile.js | 2 +- modules/client/back/methods/client/canBeInvoiced.js | 2 +- modules/entry/back/methods/entry/addBuy.js | 2 +- modules/entry/back/methods/entry/deleteBuys.js | 2 +- modules/entry/back/methods/entry/editLatestBuys.js | 2 +- modules/entry/back/methods/entry/filter.js | 2 +- modules/entry/back/methods/entry/getBuys.js | 2 +- modules/entry/back/methods/entry/getEntry.js | 2 +- modules/entry/back/methods/entry/importBuysPreview.js | 2 +- modules/entry/back/methods/entry/latestBuysFilter.js | 2 +- modules/invoiceIn/back/methods/invoice-in/filter.js | 2 +- modules/invoiceIn/back/methods/invoice-in/summary.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/book.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/createPdf.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/filter.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/getTickets.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/summary.js | 2 +- modules/item/back/methods/item/activeBuyers.js | 4 ++-- modules/route/back/methods/route/getSuggestedTickets.js | 2 +- modules/route/back/methods/route/getTickets.js | 3 ++- modules/route/back/methods/route/insertTicket.js | 2 +- modules/route/back/methods/route/updateVolume.js | 2 +- modules/worker/back/methods/calendar/absences.js | 2 +- .../worker/back/methods/worker-time-control/addTimeEntry.js | 2 +- .../back/methods/worker-time-control/deleteTimeEntry.js | 2 +- .../back/methods/worker-time-control/updateTimeEntry.js | 2 +- modules/worker/back/methods/worker/createAbsence.js | 2 +- modules/worker/back/methods/worker/deleteAbsence.js | 2 +- modules/worker/back/methods/worker/holidays.js | 2 +- modules/worker/back/methods/worker/isSubordinate.js | 2 +- modules/worker/back/methods/worker/mySubordinates.js | 2 +- modules/zone/back/methods/agency-mode/byWarehouse.js | 2 +- modules/zone/back/methods/agency/getAgenciesWithWarehouse.js | 2 +- modules/zone/back/methods/agency/landsThatDay.js | 2 +- modules/zone/back/methods/zone/clone.js | 2 +- modules/zone/back/methods/zone/getEvents.js | 2 +- modules/zone/back/methods/zone/getLeaves.js | 2 +- modules/zone/back/methods/zone/getUpcomingDeliveries.js | 2 +- modules/zone/back/methods/zone/includingExpired.js | 2 +- modules/zone/back/methods/zone/toggleIsIncluded.js | 2 +- 52 files changed, 54 insertions(+), 53 deletions(-) diff --git a/back/methods/chat/sendCheckingPresence.js b/back/methods/chat/sendCheckingPresence.js index c1bc565eb..fcde20130 100644 --- a/back/methods/chat/sendCheckingPresence.js +++ b/back/methods/chat/sendCheckingPresence.js @@ -27,7 +27,7 @@ module.exports = Self => { Self.sendCheckingPresence = async(ctx, recipientId, message, options) => { if (!recipientId) return false; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/back/methods/dms/updateFile.js b/back/methods/dms/updateFile.js index 161f4728c..cfc4c322f 100644 --- a/back/methods/dms/updateFile.js +++ b/back/methods/dms/updateFile.js @@ -60,7 +60,7 @@ module.exports = Self => { const args = ctx.args; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/back/methods/dms/uploadFile.js b/back/methods/dms/uploadFile.js index 6bda1e6db..fb4b2e5b8 100644 --- a/back/methods/dms/uploadFile.js +++ b/back/methods/dms/uploadFile.js @@ -54,7 +54,7 @@ module.exports = Self => { const args = ctx.args; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/back/methods/starred-module/getStarredModules.js b/back/methods/starred-module/getStarredModules.js index 7b0f0e945..5d399f16e 100644 --- a/back/methods/starred-module/getStarredModules.js +++ b/back/methods/starred-module/getStarredModules.js @@ -16,7 +16,7 @@ module.exports = function(Self) { const models = Self.app.models; const userId = ctx.req.accessToken.userId; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/back/methods/starred-module/setPosition.js b/back/methods/starred-module/setPosition.js index c72de1083..d993f18e9 100644 --- a/back/methods/starred-module/setPosition.js +++ b/back/methods/starred-module/setPosition.js @@ -31,7 +31,7 @@ module.exports = function(Self) { const userId = ctx.req.accessToken.userId; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/back/methods/starred-module/toggleStarredModule.js b/back/methods/starred-module/toggleStarredModule.js index 16e14740b..9cc496f44 100644 --- a/back/methods/starred-module/toggleStarredModule.js +++ b/back/methods/starred-module/toggleStarredModule.js @@ -23,7 +23,7 @@ module.exports = function(Self) { const userId = ctx.req.accessToken.userId; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js index 0e358678e..de812417a 100644 --- a/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js +++ b/modules/claim/back/methods/claim-beginning/importToNewRefundTicket.js @@ -63,7 +63,7 @@ module.exports = Self => { }; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim-dms/removeFile.js b/modules/claim/back/methods/claim-dms/removeFile.js index 310d2b941..edc714235 100644 --- a/modules/claim/back/methods/claim-dms/removeFile.js +++ b/modules/claim/back/methods/claim-dms/removeFile.js @@ -20,7 +20,7 @@ module.exports = Self => { Self.removeFile = async(ctx, id, options) => { let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim-end/importTicketSales.js b/modules/claim/back/methods/claim-end/importTicketSales.js index 106313f14..6dd64be36 100644 --- a/modules/claim/back/methods/claim-end/importTicketSales.js +++ b/modules/claim/back/methods/claim-end/importTicketSales.js @@ -22,7 +22,7 @@ module.exports = Self => { let userId = ctx.req.accessToken.userId; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim/regularizeClaim.js b/modules/claim/back/methods/claim/regularizeClaim.js index 2106ab210..d1fe7c13e 100644 --- a/modules/claim/back/methods/claim/regularizeClaim.js +++ b/modules/claim/back/methods/claim/regularizeClaim.js @@ -24,7 +24,7 @@ module.exports = Self => { const resolvedState = 3; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim/updateClaim.js b/modules/claim/back/methods/claim/updateClaim.js index 68df9481c..a646db355 100644 --- a/modules/claim/back/methods/claim/updateClaim.js +++ b/modules/claim/back/methods/claim/updateClaim.js @@ -44,7 +44,7 @@ module.exports = Self => { const userId = ctx.req.accessToken.userId; const args = ctx.args; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim/updateClaimAction.js b/modules/claim/back/methods/claim/updateClaimAction.js index 12749fb6b..23d1d417d 100644 --- a/modules/claim/back/methods/claim/updateClaimAction.js +++ b/modules/claim/back/methods/claim/updateClaimAction.js @@ -30,7 +30,7 @@ module.exports = Self => { Self.updateClaimAction = async(ctx, id, options) => { let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/claim/back/methods/claim/uploadFile.js b/modules/claim/back/methods/claim/uploadFile.js index daab9341a..81ad40219 100644 --- a/modules/claim/back/methods/claim/uploadFile.js +++ b/modules/claim/back/methods/claim/uploadFile.js @@ -54,7 +54,7 @@ module.exports = Self => { Self.uploadFile = async(ctx, id, options) => { let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/client/back/methods/client/canBeInvoiced.js b/modules/client/back/methods/client/canBeInvoiced.js index d8a126ed2..567d491f1 100644 --- a/modules/client/back/methods/client/canBeInvoiced.js +++ b/modules/client/back/methods/client/canBeInvoiced.js @@ -25,7 +25,7 @@ module.exports = function(Self) { Self.canBeInvoiced = async(id, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/addBuy.js b/modules/entry/back/methods/entry/addBuy.js index f21c1650c..f612c1651 100644 --- a/modules/entry/back/methods/entry/addBuy.js +++ b/modules/entry/back/methods/entry/addBuy.js @@ -68,7 +68,7 @@ module.exports = Self => { Self.addBuy = async(ctx, options) => { const conn = Self.dataSource.connector; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/deleteBuys.js b/modules/entry/back/methods/entry/deleteBuys.js index ce5ff6a7d..ac6d30ce6 100644 --- a/modules/entry/back/methods/entry/deleteBuys.js +++ b/modules/entry/back/methods/entry/deleteBuys.js @@ -21,7 +21,7 @@ module.exports = Self => { Self.deleteBuys = async(ctx, options) => { const models = Self.app.models; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/editLatestBuys.js b/modules/entry/back/methods/entry/editLatestBuys.js index 53b92d966..fb0397d2b 100644 --- a/modules/entry/back/methods/entry/editLatestBuys.js +++ b/modules/entry/back/methods/entry/editLatestBuys.js @@ -32,7 +32,7 @@ module.exports = Self => { Self.editLatestBuys = async(field, newValue, lines, options) => { let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/filter.js b/modules/entry/back/methods/entry/filter.js index 24c518de8..13690d3ac 100644 --- a/modules/entry/back/methods/entry/filter.js +++ b/modules/entry/back/methods/entry/filter.js @@ -108,7 +108,7 @@ module.exports = Self => { }); Self.filter = async(ctx, filter, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/getBuys.js b/modules/entry/back/methods/entry/getBuys.js index 8adcc950d..6da9ec53e 100644 --- a/modules/entry/back/methods/entry/getBuys.js +++ b/modules/entry/back/methods/entry/getBuys.js @@ -29,7 +29,7 @@ module.exports = Self => { Self.getBuys = async(id, filter, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/getEntry.js b/modules/entry/back/methods/entry/getEntry.js index 74ccc88c5..66238d0dc 100644 --- a/modules/entry/back/methods/entry/getEntry.js +++ b/modules/entry/back/methods/entry/getEntry.js @@ -21,7 +21,7 @@ module.exports = Self => { Self.getEntry = async(id, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/importBuysPreview.js b/modules/entry/back/methods/entry/importBuysPreview.js index 790d33364..5b88b587c 100644 --- a/modules/entry/back/methods/entry/importBuysPreview.js +++ b/modules/entry/back/methods/entry/importBuysPreview.js @@ -26,7 +26,7 @@ module.exports = Self => { Self.importBuysPreview = async(id, buys, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/entry/back/methods/entry/latestBuysFilter.js b/modules/entry/back/methods/entry/latestBuysFilter.js index cbf9e3b6a..7711bc0f1 100644 --- a/modules/entry/back/methods/entry/latestBuysFilter.js +++ b/modules/entry/back/methods/entry/latestBuysFilter.js @@ -76,7 +76,7 @@ module.exports = Self => { }); Self.latestBuysFilter = async(ctx, filter, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceIn/back/methods/invoice-in/filter.js b/modules/invoiceIn/back/methods/invoice-in/filter.js index e2e759fb8..b5fc90487 100644 --- a/modules/invoiceIn/back/methods/invoice-in/filter.js +++ b/modules/invoiceIn/back/methods/invoice-in/filter.js @@ -95,7 +95,7 @@ module.exports = Self => { const conn = Self.dataSource.connector; const args = ctx.args; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceIn/back/methods/invoice-in/summary.js b/modules/invoiceIn/back/methods/invoice-in/summary.js index f09be4add..3693245cc 100644 --- a/modules/invoiceIn/back/methods/invoice-in/summary.js +++ b/modules/invoiceIn/back/methods/invoice-in/summary.js @@ -20,7 +20,7 @@ module.exports = Self => { }); Self.summary = async(id, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceOut/back/methods/invoiceOut/book.js b/modules/invoiceOut/back/methods/invoiceOut/book.js index 0371d4f74..7aa0eac1f 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/book.js +++ b/modules/invoiceOut/back/methods/invoiceOut/book.js @@ -23,7 +23,7 @@ module.exports = Self => { Self.book = async(ref, options) => { const models = Self.app.models; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js index ac79f0d5d..3f577c9b0 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js @@ -35,7 +35,7 @@ module.exports = Self => { throw new UserError(`Action not allowed on the test environment`); let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceOut/back/methods/invoiceOut/filter.js b/modules/invoiceOut/back/methods/invoiceOut/filter.js index 3496c9296..192490090 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/filter.js +++ b/modules/invoiceOut/back/methods/invoiceOut/filter.js @@ -87,7 +87,7 @@ module.exports = Self => { Self.filter = async(ctx, filter, options) => { const conn = Self.dataSource.connector; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceOut/back/methods/invoiceOut/getTickets.js b/modules/invoiceOut/back/methods/invoiceOut/getTickets.js index dc3296aba..dc94f0f0f 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/getTickets.js +++ b/modules/invoiceOut/back/methods/invoiceOut/getTickets.js @@ -29,7 +29,7 @@ module.exports = Self => { Self.getTickets = async(id, filter, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/invoiceOut/back/methods/invoiceOut/summary.js b/modules/invoiceOut/back/methods/invoiceOut/summary.js index a95016ff2..db01a4189 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/summary.js +++ b/modules/invoiceOut/back/methods/invoiceOut/summary.js @@ -21,7 +21,7 @@ module.exports = Self => { Self.summary = async(id, options) => { let summary = {}; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/item/back/methods/item/activeBuyers.js b/modules/item/back/methods/item/activeBuyers.js index 6489ae74f..e16ff877b 100644 --- a/modules/item/back/methods/item/activeBuyers.js +++ b/modules/item/back/methods/item/activeBuyers.js @@ -3,7 +3,7 @@ const mergeFilters = require('vn-loopback/util/filter').mergeFilters; module.exports = Self => { Self.remoteMethod('activeBuyers', { - description: 'Returns a list of agencies from a warehouse', + description: 'Returns a list of buyers for the given item type', accepts: [{ arg: 'filter', type: 'object', @@ -22,7 +22,7 @@ module.exports = Self => { Self.activeBuyers = async(filter, options) => { const conn = Self.dataSource.connector; const where = {isActive: true}; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/route/back/methods/route/getSuggestedTickets.js b/modules/route/back/methods/route/getSuggestedTickets.js index fe268f8cc..49d7c1977 100644 --- a/modules/route/back/methods/route/getSuggestedTickets.js +++ b/modules/route/back/methods/route/getSuggestedTickets.js @@ -20,7 +20,7 @@ module.exports = Self => { }); Self.getSuggestedTickets = async(id, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/route/back/methods/route/getTickets.js b/modules/route/back/methods/route/getTickets.js index 5705d8905..9a2f5289a 100644 --- a/modules/route/back/methods/route/getTickets.js +++ b/modules/route/back/methods/route/getTickets.js @@ -26,7 +26,8 @@ module.exports = Self => { Self.getTickets = async(filter, options) => { const conn = Self.dataSource.connector; - let myOptions = {}; + const myOptions = {}; + if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/route/back/methods/route/insertTicket.js b/modules/route/back/methods/route/insertTicket.js index d716bd8ba..f78e1cb83 100644 --- a/modules/route/back/methods/route/insertTicket.js +++ b/modules/route/back/methods/route/insertTicket.js @@ -30,7 +30,7 @@ module.exports = Self => { const models = Self.app.models; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/route/back/methods/route/updateVolume.js b/modules/route/back/methods/route/updateVolume.js index ce6e16b5c..f3b8da130 100644 --- a/modules/route/back/methods/route/updateVolume.js +++ b/modules/route/back/methods/route/updateVolume.js @@ -24,7 +24,7 @@ module.exports = Self => { const models = Self.app.models; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/calendar/absences.js b/modules/worker/back/methods/calendar/absences.js index 96293c931..32d311cdb 100644 --- a/modules/worker/back/methods/calendar/absences.js +++ b/modules/worker/back/methods/calendar/absences.js @@ -40,7 +40,7 @@ module.exports = Self => { ended.setMonth(12); ended.setDate(0); - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker-time-control/addTimeEntry.js b/modules/worker/back/methods/worker-time-control/addTimeEntry.js index 2079a62a3..80786b723 100644 --- a/modules/worker/back/methods/worker-time-control/addTimeEntry.js +++ b/modules/worker/back/methods/worker-time-control/addTimeEntry.js @@ -34,8 +34,8 @@ module.exports = Self => { const models = Self.app.models; const args = ctx.args; const currentUserId = ctx.req.accessToken.userId; + const myOptions = {}; - let myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker-time-control/deleteTimeEntry.js b/modules/worker/back/methods/worker-time-control/deleteTimeEntry.js index 23e4c5fff..c80dcab81 100644 --- a/modules/worker/back/methods/worker-time-control/deleteTimeEntry.js +++ b/modules/worker/back/methods/worker-time-control/deleteTimeEntry.js @@ -25,7 +25,7 @@ module.exports = Self => { const currentUserId = ctx.req.accessToken.userId; const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker-time-control/updateTimeEntry.js b/modules/worker/back/methods/worker-time-control/updateTimeEntry.js index abeda7f8e..a99a61770 100644 --- a/modules/worker/back/methods/worker-time-control/updateTimeEntry.js +++ b/modules/worker/back/methods/worker-time-control/updateTimeEntry.js @@ -31,7 +31,7 @@ module.exports = Self => { const models = Self.app.models; const args = ctx.args; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker/createAbsence.js b/modules/worker/back/methods/worker/createAbsence.js index 549ba7fd1..b276cf1f7 100644 --- a/modules/worker/back/methods/worker/createAbsence.js +++ b/modules/worker/back/methods/worker/createAbsence.js @@ -41,7 +41,7 @@ module.exports = Self => { const userId = ctx.req.accessToken.userId; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker/deleteAbsence.js b/modules/worker/back/methods/worker/deleteAbsence.js index 18427424d..72e9243d9 100644 --- a/modules/worker/back/methods/worker/deleteAbsence.js +++ b/modules/worker/back/methods/worker/deleteAbsence.js @@ -28,7 +28,7 @@ module.exports = Self => { const userId = ctx.req.accessToken.userId; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker/holidays.js b/modules/worker/back/methods/worker/holidays.js index f3ce0c661..e11d13002 100644 --- a/modules/worker/back/methods/worker/holidays.js +++ b/modules/worker/back/methods/worker/holidays.js @@ -34,7 +34,7 @@ module.exports = Self => { const models = Self.app.models; const args = ctx.args; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker/isSubordinate.js b/modules/worker/back/methods/worker/isSubordinate.js index 13cc365c6..f051cf768 100644 --- a/modules/worker/back/methods/worker/isSubordinate.js +++ b/modules/worker/back/methods/worker/isSubordinate.js @@ -27,7 +27,7 @@ module.exports = Self => { const models = Self.app.models; const myUserId = ctx.req.accessToken.userId; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/worker/back/methods/worker/mySubordinates.js b/modules/worker/back/methods/worker/mySubordinates.js index 07a22291d..b6711e382 100644 --- a/modules/worker/back/methods/worker/mySubordinates.js +++ b/modules/worker/back/methods/worker/mySubordinates.js @@ -25,7 +25,7 @@ module.exports = Self => { const userId = ctx.req.accessToken.userId; const stmts = []; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/agency-mode/byWarehouse.js b/modules/zone/back/methods/agency-mode/byWarehouse.js index 30716d145..945e79320 100644 --- a/modules/zone/back/methods/agency-mode/byWarehouse.js +++ b/modules/zone/back/methods/agency-mode/byWarehouse.js @@ -22,7 +22,7 @@ module.exports = Self => { Self.byWarehouse = async(filter, options) => { const conn = Self.dataSource.connector; const where = {isActive: true}; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/agency/getAgenciesWithWarehouse.js b/modules/zone/back/methods/agency/getAgenciesWithWarehouse.js index 296b9ee8d..846ad6a3d 100644 --- a/modules/zone/back/methods/agency/getAgenciesWithWarehouse.js +++ b/modules/zone/back/methods/agency/getAgenciesWithWarehouse.js @@ -29,7 +29,7 @@ module.exports = Self => { }); Self.getAgenciesWithWarehouse = async(addressFk, landed, warehouseFk, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/agency/landsThatDay.js b/modules/zone/back/methods/agency/landsThatDay.js index 5a9efefe8..b7f13ddda 100644 --- a/modules/zone/back/methods/agency/landsThatDay.js +++ b/modules/zone/back/methods/agency/landsThatDay.js @@ -23,7 +23,7 @@ module.exports = Self => { }); Self.landsThatDay = async(addressFk, landed, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/clone.js b/modules/zone/back/methods/zone/clone.js index 64dc5aa55..391b3762a 100644 --- a/modules/zone/back/methods/zone/clone.js +++ b/modules/zone/back/methods/zone/clone.js @@ -22,7 +22,7 @@ module.exports = Self => { Self.clone = async(id, options) => { const models = Self.app.models; let tx; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/getEvents.js b/modules/zone/back/methods/zone/getEvents.js index c76a38ea5..a8ee8bb7b 100644 --- a/modules/zone/back/methods/zone/getEvents.js +++ b/modules/zone/back/methods/zone/getEvents.js @@ -26,7 +26,7 @@ module.exports = Self => { }); Self.getEvents = async(geoFk, agencyModeFk, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/getLeaves.js b/modules/zone/back/methods/zone/getLeaves.js index cda5d7ff9..db17beb1b 100644 --- a/modules/zone/back/methods/zone/getLeaves.js +++ b/modules/zone/back/methods/zone/getLeaves.js @@ -32,7 +32,7 @@ module.exports = Self => { }); Self.getLeaves = async(id, parentId = null, search, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/getUpcomingDeliveries.js b/modules/zone/back/methods/zone/getUpcomingDeliveries.js index 6aceb694b..2a1c39ed6 100644 --- a/modules/zone/back/methods/zone/getUpcomingDeliveries.js +++ b/modules/zone/back/methods/zone/getUpcomingDeliveries.js @@ -14,7 +14,7 @@ module.exports = Self => { }); Self.getUpcomingDeliveries = async options => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/includingExpired.js b/modules/zone/back/methods/zone/includingExpired.js index 75aa41e1c..cd951b6d0 100644 --- a/modules/zone/back/methods/zone/includingExpired.js +++ b/modules/zone/back/methods/zone/includingExpired.js @@ -19,7 +19,7 @@ module.exports = Self => { }); Self.includingExpired = async(ctx, filter, options) => { - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); diff --git a/modules/zone/back/methods/zone/toggleIsIncluded.js b/modules/zone/back/methods/zone/toggleIsIncluded.js index 32144ab97..bf8c86f46 100644 --- a/modules/zone/back/methods/zone/toggleIsIncluded.js +++ b/modules/zone/back/methods/zone/toggleIsIncluded.js @@ -29,7 +29,7 @@ module.exports = Self => { Self.toggleIsIncluded = async(id, geoId, isIncluded, options) => { const models = Self.app.models; - let myOptions = {}; + const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options); -- 2.40.1 From 4fc01e6a0da575641ab8f08569628269c83d8f6a Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 18 Nov 2021 11:18:45 +0100 Subject: [PATCH 7/8] typos corrected --- modules/invoiceIn/back/methods/invoice-in/filter.js | 2 +- modules/invoiceOut/back/methods/invoiceOut/filter.js | 2 +- modules/item/back/methods/item/filter.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/invoiceIn/back/methods/invoice-in/filter.js b/modules/invoiceIn/back/methods/invoice-in/filter.js index b5fc90487..7e497d39a 100644 --- a/modules/invoiceIn/back/methods/invoice-in/filter.js +++ b/modules/invoiceIn/back/methods/invoice-in/filter.js @@ -78,7 +78,7 @@ module.exports = Self => { { arg: 'isBooked', type: 'boolean', - description: 'Whether the the invoice is booked or not', + description: 'Whether the invoice is booked or not', }, ], returns: { diff --git a/modules/invoiceOut/back/methods/invoiceOut/filter.js b/modules/invoiceOut/back/methods/invoiceOut/filter.js index 192490090..99a80c169 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/filter.js +++ b/modules/invoiceOut/back/methods/invoiceOut/filter.js @@ -35,7 +35,7 @@ module.exports = Self => { { arg: 'hasPdf', type: 'boolean', - description: 'Whether the the invoiceOut has PDF or not', + description: 'Whether the invoiceOut has PDF or not', http: {source: 'query'} }, { diff --git a/modules/item/back/methods/item/filter.js b/modules/item/back/methods/item/filter.js index 99152467a..53948c46e 100644 --- a/modules/item/back/methods/item/filter.js +++ b/modules/item/back/methods/item/filter.js @@ -41,7 +41,7 @@ module.exports = Self => { { arg: 'isActive', type: 'boolean', - description: 'Whether the the item is or not active', + description: 'Whether the item is or not active', }, { arg: 'buyerFk', -- 2.40.1 From 8676a1df90922be69e2c1115116d8d7919d762a4 Mon Sep 17 00:00:00 2001 From: carlosjr Date: Thu, 18 Nov 2021 11:28:11 +0100 Subject: [PATCH 8/8] updated method description --- modules/zone/back/methods/zone/includingExpired.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/zone/back/methods/zone/includingExpired.js b/modules/zone/back/methods/zone/includingExpired.js index cd951b6d0..e93b86471 100644 --- a/modules/zone/back/methods/zone/includingExpired.js +++ b/modules/zone/back/methods/zone/includingExpired.js @@ -2,7 +2,7 @@ const ParameterizedSQL = require('loopback-connector').ParameterizedSQL; module.exports = Self => { Self.remoteMethodCtx('includingExpired', { - description: 'Returns a list of agencies from a warehouse', + description: 'Returns a list of zones for the given warehouse and user', accepts: [{ arg: 'filter', type: 'Object', -- 2.40.1