Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7529-workerPIT
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Carlos Satorres 2024-09-19 08:54:53 +02:00
commit 355ce46393
11 changed files with 26 additions and 56 deletions

View File

@ -29,7 +29,7 @@ describe('Postcode filter()', () => {
} }
}, options); }, options);
expect(results.length).toEqual(4); expect(results.length).toEqual(5);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();
@ -63,7 +63,7 @@ describe('Postcode filter()', () => {
search: 'one', search: 'one',
}}, options); }}, options);
expect(results.length).toEqual(4); expect(results.length).toEqual(5);
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
await tx.rollback(); await tx.rollback();

View File

@ -26,7 +26,7 @@ module.exports = Self => {
description: 'The user lang' description: 'The user lang'
}, { }, {
arg: 'twoFactor', arg: 'twoFactor',
type: 'string', type: 'any',
description: 'The user twoFactor' description: 'The user twoFactor'
} }
], ],

View File

@ -165,7 +165,8 @@
"hasGrant", "hasGrant",
"realm", "realm",
"email", "email",
"emailVerified" "emailVerified",
"twoFactor"
] ]
} }
} }

View File

@ -361,11 +361,12 @@ INSERT INTO `vn`.`town`(`id`, `name`, `provinceFk`)
INSERT INTO `vn`.`postCode`(`code`, `townFk`, `geoFk`) INSERT INTO `vn`.`postCode`(`code`, `townFk`, `geoFk`)
VALUES VALUES
('46000', 1, 6), ('46000', 1, 6),
('46460', 2, 6), ('46460', 2, 6),
('46680', 3, 6), ('46680', 3, 6),
('46600', 4, 7), ('46600', 4, 7),
('EC170150', 5, 8); ('46600',1, 6),
('EC170150', 5, 8);
INSERT INTO `vn`.`clientType`(`code`, `type`) INSERT INTO `vn`.`clientType`(`code`, `type`)
VALUES VALUES
@ -3936,7 +3937,7 @@ INSERT INTO vn.medicalReview
(id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark) (id, workerFk, centerFk, `date`, `time`, isFit, amount, invoice, remark)
VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL); VALUES(3, 9, 2, '2000-01-01', '8:00', 1, 150.0, NULL, NULL);
INSERT INTO vn.stockBought (workerFk, bought, reserve, dated) INSERT INTO vn.stockBought (workerFk, bought, reserve, dated)
VALUES(35, 1.00, 1.00, '2001-01-01'); VALUES(35, 1.00, 1.00, '2001-01-01');
INSERT INTO vn.auctionConfig (id,conversionCoefficient,warehouseFk) INSERT INTO vn.auctionConfig (id,conversionCoefficient,warehouseFk)

View File

@ -1,8 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`MIDNIGHT`(vDate DATE)
RETURNS datetime
DETERMINISTIC
BEGIN
RETURN TIMESTAMP(vDate,'23:59:59');
END$$
DELIMITER ;

View File

@ -1,30 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`vn`@`localhost` FUNCTION `vn`.`routeProposal_`(vTicketFk INT)
RETURNS int(11)
NOT DETERMINISTIC
READS SQL DATA
BEGIN
DECLARE vRouteFk INT;
DECLARE vAddressFk INT;
DECLARE vShipped DATETIME;
SELECT addressFk, date(shipped) INTO vAddressFk, vShipped
FROM vn.ticket
WHERE id = vTicketFk;
SELECT routeFk INTO vRouteFk
FROM
(SELECT t.routeFk, sum(af.friendship) friendshipSum
FROM vn.ticket t
JOIN cache.addressFriendship af ON af.addressFk2 = t.addressFk AND af.addressFk1 = vAddressFk
WHERE t.shipped BETWEEN vShipped and MIDNIGHT(vShipped)
AND t.routeFk
GROUP BY routeFk
ORDER BY friendshipSum DESC
) sub
LIMIT 1;
RETURN vRouteFk;
END$$
DELIMITER ;

View File

@ -38,7 +38,7 @@ BEGIN
AND IFNULL(sub3.transit,0) < s.quantity AND IFNULL(sub3.transit,0) < s.quantity
AND s.isPicked = FALSE AND s.isPicked = FALSE
AND s.reserved = FALSE AND s.reserved = FALSE
AND t.shipped BETWEEN util.VN_CURDATE() AND MIDNIGHT(util.VN_CURDATE()) AND t.shipped BETWEEN util.VN_CURDATE() AND util.midnight()
AND tst.isPreviousPreparable = TRUE AND tst.isPreviousPreparable = TRUE
AND t.warehouseFk = vWarehouseFk AND t.warehouseFk = vWarehouseFk
AND iss.sectorFk = vSectorFk AND iss.sectorFk = vSectorFk

View File

@ -13,4 +13,4 @@ FROM (
`vn`.`ticketState` `ts` `vn`.`ticketState` `ts`
JOIN `vn`.`ticket` `t` ON(`t`.`id` = `ts`.`ticketFk`) JOIN `vn`.`ticket` `t` ON(`t`.`id` = `ts`.`ticketFk`)
) )
WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `MIDNIGHT`(`util`.`VN_CURDATE`()) WHERE `t`.`shipped` BETWEEN `util`.`VN_CURDATE`() AND `util`.`midnight`()

View File

@ -1,4 +1,7 @@
{ {
"Account": {
"dataSource": "vn"
},
"AccountConfig": { "AccountConfig": {
"dataSource": "vn" "dataSource": "vn"
}, },
@ -47,9 +50,6 @@
"SipConfig": { "SipConfig": {
"dataSource": "vn" "dataSource": "vn"
}, },
"Account": {
"dataSource": "vn"
},
"UserLog": { "UserLog": {
"dataSource": "vn" "dataSource": "vn"
}, },

View File

@ -43,8 +43,14 @@ module.exports = Self => {
include: [{ include: [{
relation: 'province', relation: 'province',
scope: { scope: {
fields: ['id', 'name'] fields: ['id', 'name', 'countryFk'],
} include: [
{
relation: 'country',
scope: {fields: ['id', 'name']},
},
],
},
}, { }, {
relation: 'agencyMode', relation: 'agencyMode',
scope: { scope: {

View File

@ -394,4 +394,4 @@ localFixtures:
- zoneExclusionGeo - zoneExclusionGeo
- zoneGeo - zoneGeo
- zoneIncluded - zoneIncluded
- zoneWarehouse - zoneWarehouse