refs #6078 - workerAct #2814
Labels
No Milestone
No Assignees
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#2814
Loading…
Reference in New Issue
No description provided.
Delete Branch "6078_workerAct"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -0,0 +11,4 @@
};
});
fit('should insert in workerActivity', async() => {
tens foco en el test
6078_workerActto refs #6078 - workerAct@ -0,0 +1,37 @@
const {models} = require('vn-loopback');
describe('workerActivity insert()', () => {
beforeAll(async() => {
const ctx = beforeAll.getCtx();
@ -0,0 +21,4 @@
const options = {transaction: tx};
ctx.req.accessToken.userId = 1106;
models.WorkerActivity.add(ctx, 'STOP', 'APP', options);
await
@ -0,0 +25,4 @@
Self.add = async(ctx, code, model, options) => {
const userId = ctx.req.accessToken.userId;
const result = await await Self.rawSql(`
return await Self.rawSql(`
@ -0,0 +44,4 @@
WHERE sub.workerFk IS NULL
OR sub.code <> ?
OR TIMESTAMPDIFF(SECOND, sub.created, util.VN_NOW()) > wtcp.dayBreak;`
, [userId, code, model, userId, code]);
, myOptions);
@ -0,0 +24,4 @@
Self.add = async(ctx, code, model, options) => {
const userId = ctx.req.accessToken.userId;
@ -0,0 +18,4 @@
await models.WorkerActivityType.create(
{'code': 'STOP', 'description': 'STOP'}
);
const options = {transaction: tx};
Esto arriba, y usar options
@ -0,0 +1,53 @@
Aquí se te ha colado un salto de linea
Llevat
@ -0,0 +31,4 @@
return await Self.rawSql(`
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model)
SELECT ?,
Aquí como todas las columnas son parámetros, no metería un salto de linea por cada columna.
A parte a partir de aquí, tiene que ir una tabulación más.
Tabulat
@ -0,0 +13,4 @@
{'code': 'STOP', 'description': 'STOP'}, options
);
result = await models.WorkerActivity.add(ctx, 'STOP', 'APP', options);
result no es gasta
Llevat