Merge branch 'dev' into 8594-createTestE2eVehicleList
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
3ab44fa4d6
|
@ -13,6 +13,11 @@ module.exports = Self => {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'Origin model from insert'
|
description: 'Origin model from insert'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
arg: 'description',
|
||||||
|
type: 'string',
|
||||||
|
description: 'Action description'
|
||||||
|
},
|
||||||
|
|
||||||
],
|
],
|
||||||
http: {
|
http: {
|
||||||
|
@ -21,7 +26,7 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.add = async(ctx, code, model, options) => {
|
Self.add = async(ctx, code, model, description, options) => {
|
||||||
const userId = ctx.req.accessToken.userId;
|
const userId = ctx.req.accessToken.userId;
|
||||||
const myOptions = {};
|
const myOptions = {};
|
||||||
|
|
||||||
|
@ -29,8 +34,8 @@ module.exports = Self => {
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
return await Self.rawSql(`
|
return await Self.rawSql(`
|
||||||
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model)
|
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model, description)
|
||||||
SELECT ?, ?, ?
|
SELECT ?, ?, ?, ?
|
||||||
FROM workerTimeControlConfig wtcc
|
FROM workerTimeControlConfig wtcc
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT wa.workerFk,
|
SELECT wa.workerFk,
|
||||||
|
@ -43,8 +48,8 @@ module.exports = Self => {
|
||||||
LIMIT 1
|
LIMIT 1
|
||||||
) sub ON TRUE
|
) sub ON TRUE
|
||||||
WHERE sub.workerFk IS NULL
|
WHERE sub.workerFk IS NULL
|
||||||
OR sub.code <> ?
|
OR sub.code <> ?
|
||||||
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcc.dayBreak;`
|
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcc.dayBreak;`
|
||||||
, [userId, code, model, userId, code], myOptions);
|
, [userId, code, model, description, userId, code], myOptions);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -13,7 +13,7 @@ describe('workerActivity insert()', () => {
|
||||||
{'code': 'TEST', 'description': 'TEST'}, options
|
{'code': 'TEST', 'description': 'TEST'}, options
|
||||||
);
|
);
|
||||||
|
|
||||||
await models.WorkerActivity.add(ctx, 'TEST', 'APP', options);
|
await models.WorkerActivity.add(ctx, 'TEST', 'APP', 'description', options);
|
||||||
|
|
||||||
count = await models.WorkerActivity.count(
|
count = await models.WorkerActivity.count(
|
||||||
{'workerFK': 1106}, options
|
{'workerFK': 1106}, options
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
"relations": {
|
"relations": {
|
||||||
"agency": {
|
"agency": {
|
||||||
"type": "belongsTo",
|
"type": "belongsTo",
|
||||||
"model": "WorkCenter",
|
"model": "Agency",
|
||||||
"foreignKey": "agencyFk"
|
"foreignKey": "agencyFk"
|
||||||
},
|
},
|
||||||
"workCenter": {
|
"workCenter": {
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
UPDATE vn.claimEnd ce
|
||||||
|
JOIN(
|
||||||
|
SELECT id
|
||||||
|
FROM vn.claimEnd
|
||||||
|
WHERE claimDestinationFk NOT IN
|
||||||
|
(SELECT id FROM vn.claimDestination WHERE id IS NOT NULL)
|
||||||
|
) s ON ce.id = s.id
|
||||||
|
SET ce.claimDestinationFk = 1;
|
|
@ -0,0 +1,9 @@
|
||||||
|
ALTER TABLE vn.claimEnd
|
||||||
|
MODIFY COLUMN claimDestinationFk tinyint(3) unsigned NOT NULL DEFAULT 1;
|
||||||
|
|
||||||
|
ALTER TABLE vn.claimEnd
|
||||||
|
ADD CONSTRAINT fk_claimEnd_claimDestination
|
||||||
|
FOREIGN KEY (claimDestinationFk)
|
||||||
|
REFERENCES claimDestination(id)
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
ON DELETE RESTRICT;
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
USE vn;
|
||||||
|
|
||||||
|
INSERT INTO vn.workerActivityType (code, description)
|
||||||
|
VALUES('SHELVING_CLEAN_START', 'SE INICIA LIMPIEZA CARRO'),
|
||||||
|
('SHELVING_CLEAN_STOP', 'SE FINALIZA LIMPIEZA CARRO');
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ module.exports = Self => {
|
||||||
);
|
);
|
||||||
const newRefundTicket = await models.Ticket.create({
|
const newRefundTicket = await models.Ticket.create({
|
||||||
clientFk: claim.ticket().clientFk,
|
clientFk: claim.ticket().clientFk,
|
||||||
shipped: nextShipped,
|
shipped: nextShipped.shipped,
|
||||||
landed: null,
|
landed: null,
|
||||||
nickname,
|
nickname,
|
||||||
warehouseFk,
|
warehouseFk,
|
||||||
|
|
|
@ -19,7 +19,7 @@ describe('importToNewRefundTicket()', () => {
|
||||||
});
|
});
|
||||||
tx = await models.Entry.beginTransaction({});
|
tx = await models.Entry.beginTransaction({});
|
||||||
options = {transaction: tx};
|
options = {transaction: tx};
|
||||||
spyOn(models.Agency, 'getShipped').and.returnValue(Promise.resolve(expectedDate));
|
spyOn(models.Agency, 'getShipped').and.returnValue(Promise.resolve({shipped: expectedDate}));
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(async() => {
|
afterEach(async() => {
|
||||||
|
|
|
@ -33,6 +33,11 @@ module.exports = Self => {
|
||||||
type: 'date',
|
type: 'date',
|
||||||
description: `The to date filter`
|
description: `The to date filter`
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
arg: 'shipped',
|
||||||
|
type: 'date',
|
||||||
|
description: `The shipped date filter`
|
||||||
|
},
|
||||||
{
|
{
|
||||||
arg: 'nickname',
|
arg: 'nickname',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
@ -201,6 +206,7 @@ module.exports = Self => {
|
||||||
case 'clientFk':
|
case 'clientFk':
|
||||||
case 'agencyModeFk':
|
case 'agencyModeFk':
|
||||||
case 'warehouseFk':
|
case 'warehouseFk':
|
||||||
|
case 'shipped':
|
||||||
param = `t.${param}`;
|
param = `t.${param}`;
|
||||||
return {[param]: value};
|
return {[param]: value};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue