refactor: refs #6501 Migrated procs from vn2008 to vn #2016

Merged
guillermo merged 24 commits from 6501-procMigration into dev 2024-02-14 10:31:14 +00:00
6 changed files with 13 additions and 22 deletions
Showing only changes of commit 9dd5b725e1 - Show all commits

2
Jenkinsfile vendored
View File

@ -103,7 +103,7 @@ pipeline {
NODE_ENV = '' NODE_ENV = ''
} }
steps { steps {
sh 'npm run test:back:ci' sh 'node back/tests.js --ci --junit --network jenkins'
} }
post { post {
always { always {

View File

@ -23,7 +23,8 @@ BEGIN
SUM(IFNULL(sub.amount,0)) lack, SUM(IFNULL(sub.amount,0)) lack,
i.inkFk, i.inkFk,
IFNULL(im.timed, util.midnight()) timed, IFNULL(im.timed, util.midnight()) timed,
IFNULL(izc.timed, util.midnight()) minTimed IFNULL(izc.timed, util.midnight()) minTimed,
o.name originFk
FROM (SELECT item_id, FROM (SELECT item_id,
warehouse_id, warehouse_id,
amount amount
@ -42,6 +43,7 @@ BEGIN
JOIN itemCategory ic ON ic.id = it.categoryFk JOIN itemCategory ic ON ic.id = it.categoryFk
LEFT JOIN tmp.itemMinETD im ON im.itemFk = i.id LEFT JOIN tmp.itemMinETD im ON im.itemFk = i.id
LEFT JOIN tmp.itemZoneClosure izc ON izc.itemFk = i.id LEFT JOIN tmp.itemZoneClosure izc ON izc.itemFk = i.id
JOIN origin o ON o.id = i.originFk
WHERE w.isForTicket WHERE w.isForTicket
AND ic.display AND ic.display
AND it.code != 'GEN' AND it.code != 'GEN'

View File

@ -8,12 +8,6 @@ BEGIN
END; END;
START TRANSACTION; START TRANSACTION;
INSERT INTO vn.clientCredit(clientFk, amount)
SELECT c.id, 0
FROM vn.`client` c
JOIN vn.payMethod pm ON pm.id = c.payMethodFk
WHERE c.credit <> 0 AND pm.`code` = 'card';
UPDATE vn.`client` c UPDATE vn.`client` c
JOIN vn.payMethod pm ON pm.id = c.payMethodFk JOIN vn.payMethod pm ON pm.id = c.payMethodFk
SET credit = 0 SET credit = 0
@ -45,10 +39,6 @@ BEGIN
JOIN clientes_credit USING(Id_Cliente) JOIN clientes_credit USING(Id_Cliente)
SET Clientes.Credito = newCredit; SET Clientes.Credito = newCredit;
INSERT INTO credit(Id_Cliente, amount, Id_Trabajador)
SELECT Id_Cliente, newCredit, NULL
FROM clientes_credit;
DROP TEMPORARY TABLE clientes_credit; DROP TEMPORARY TABLE clientes_credit;
COMMIT; COMMIT;
END$$ END$$

View File

@ -0,0 +1 @@
DROP TABLE vn.timeControlDevice;

View File

@ -10,7 +10,7 @@ const Myt = require('@verdnatura/myt/myt');
const Run = require('@verdnatura/myt/myt-run'); const Run = require('@verdnatura/myt/myt-run');
const axios = require('axios'); const axios = require('axios');
const e2eConfig = require('./config.js'); const e2eConfig = require('./helpers/config.js');
const log = require('fancy-log'); const log = require('fancy-log');
process.on('warning', warning => { process.on('warning', warning => {
@ -23,11 +23,12 @@ async function test() {
const opts = getopts(process.argv.slice(2), { const opts = getopts(process.argv.slice(2), {
boolean: ['show'] boolean: ['show']
}); });
process.env.E2E_SHOW = opts.show; if (opts.show)
process.env.E2E_SHOW = true;
console.log('Building and running DB container.'); console.log('Building and running DB container.');
const myt = new Myt(); const myt = new Myt();
await myt.init({workspace: path.join(__dirname, '../..')}); await myt.init({workspace: path.join(__dirname, '..')});
await myt.run(Run); await myt.run(Run);
await myt.deinit(); await myt.deinit();

View File

@ -105,14 +105,11 @@
"yaml-loader": "^0.5.0" "yaml-loader": "^0.5.0"
}, },
"scripts": { "scripts": {
"dbtest": "nodemon -q db/tests.js -w db/tests",
"test:back": "nodemon -q back/tests.js --config back/nodemonConfig.json", "test:back": "nodemon -q back/tests.js --config back/nodemonConfig.json",
"test:back:ci": "node back/tests.js --ci --junit --network jenkins", "test:e2e": "node e2e/tests.js",
"test:e2e": "node e2e/helpers/tests.js",
"test:front": "jest --watch", "test:front": "jest --watch",
"back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back", "back": "nodemon --inspect -w modules ./node_modules/gulp/bin/gulp.js back",
"lint": "eslint ./ --cache --ignore-pattern .gitignore", "lint": "eslint ./ --cache --ignore-pattern .gitignore"
"docker": "docker build --progress=plain -t salix-db ./db"
}, },
"jest": { "jest": {
"projects": [ "projects": [