refs #6078 - workerAct #2814

Merged
sergiodt merged 7 commits from 6078_workerAct into dev 2024-08-08 08:26:13 +00:00
Member
No description provided.
sergiodt added 2 commits 2024-07-30 15:48:57 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
59df0b3886
feat workerActivity refs #6078
sergiodt requested review from carlosap 2024-07-30 15:49:04 +00:00
sergiodt requested review from alexm 2024-07-30 15:49:11 +00:00
carlosap requested changes 2024-07-30 16:12:20 +00:00
Dismissed
@ -0,0 +11,4 @@
};
});
fit('should insert in workerActivity', async() => {
Member

tens foco en el test

tens foco en el test
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-07-31 04:43:46 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
3c62046277
feat workerActivity refs #6078
alexm approved these changes 2024-08-05 05:24:36 +00:00
Dismissed
alexm changed title from 6078_workerAct to refs #6078 - workerAct 2024-08-05 05:24:50 +00:00
alexm reviewed 2024-08-06 07:04:21 +00:00
@ -0,0 +1,37 @@
const {models} = require('vn-loopback');
describe('workerActivity insert()', () => {
beforeAll(async() => {
Member

const ctx = beforeAll.getCtx();

const ctx = beforeAll.getCtx();
sergiodt marked this conversation as resolved
alexm reviewed 2024-08-06 07:04:49 +00:00
@ -0,0 +21,4 @@
const options = {transaction: tx};
ctx.req.accessToken.userId = 1106;
models.WorkerActivity.add(ctx, 'STOP', 'APP', options);
Member

await

await
sergiodt marked this conversation as resolved
alexm requested changes 2024-08-06 07:06:11 +00:00
Dismissed
@ -0,0 +25,4 @@
Self.add = async(ctx, code, model, options) => {
const userId = ctx.req.accessToken.userId;
const result = await await Self.rawSql(`
Member

return await Self.rawSql(`

return await Self.rawSql(`
sergiodt marked this conversation as resolved
@ -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]);
Member

, myOptions);

, myOptions);
sergiodt marked this conversation as resolved
alexm reviewed 2024-08-06 07:11:43 +00:00
@ -0,0 +24,4 @@
Self.add = async(ctx, code, model, options) => {
const userId = ctx.req.accessToken.userId;
Member
    const myOptions = {};

    if (typeof options == 'object')
        Object.assign(myOptions, options);
const myOptions = {}; if (typeof options == 'object') Object.assign(myOptions, options);
sergiodt marked this conversation as resolved
alexm reviewed 2024-08-06 07:12:37 +00:00
@ -0,0 +18,4 @@
await models.WorkerActivityType.create(
{'code': 'STOP', 'description': 'STOP'}
);
const options = {transaction: tx};
Member

Esto arriba, y usar options

Esto arriba, y usar options
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-08-06 14:34:56 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
163faf983e
feat workerActivity refs #6078
sergiodt requested review from alexm 2024-08-06 14:35:32 +00:00
sergiodt requested review from guillermo 2024-08-06 14:36:12 +00:00
guillermo requested changes 2024-08-07 05:12:30 +00:00
Dismissed
@ -0,0 +1,53 @@
Member

Aquí se te ha colado un salto de linea

Aquí se te ha colado un salto de linea
Author
Member

Llevat

Llevat
sergiodt marked this conversation as resolved
@ -0,0 +31,4 @@
return await Self.rawSql(`
INSERT INTO workerActivity (workerFk, workerActivityTypeFk, model)
SELECT ?,
Member

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.

INSERT INTO...
       SELECT ?, ?, ?
              FROM...          
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. ``` INSERT INTO... SELECT ?, ?, ? FROM... ```
Author
Member

Tabulat

Tabulat
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-08-07 06:15:59 +00:00
sergiodt added 1 commit 2024-08-07 06:19:56 +00:00
gitea/salix/pipeline/pr-dev Build queued... Details
849989afa8
feat workerActivity refs #6078
sergiodt requested review from guillermo 2024-08-07 06:20:49 +00:00
guillermo approved these changes 2024-08-07 06:29:50 +00:00
Dismissed
alexm reviewed 2024-08-07 07:02:40 +00:00
alexm requested changes 2024-08-07 07:02:59 +00:00
Dismissed
@ -0,0 +13,4 @@
{'code': 'STOP', 'description': 'STOP'}, options
);
result = await models.WorkerActivity.add(ctx, 'STOP', 'APP', options);
Member

result no es gasta

result no es gasta
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-08-07 08:48:22 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
22c3a632e2
feat workerActivity refs #6078
Author
Member

Llevat

Llevat
sergiodt closed this pull request 2024-08-07 08:48:40 +00:00
sergiodt reopened this pull request 2024-08-07 08:48:46 +00:00
sergiodt requested review from alexm 2024-08-07 08:48:53 +00:00
alexm approved these changes 2024-08-07 08:54:57 +00:00
sergiodt requested review from guillermo 2024-08-07 09:01:48 +00:00
guillermo approved these changes 2024-08-07 11:54:12 +00:00
juan dismissed carlosap’s review 2024-08-08 07:46:25 +00:00
sergiodt merged commit 09d93caddb into dev 2024-08-08 08:26:13 +00:00
sergiodt deleted branch 6078_workerAct 2024-08-08 08:26:13 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: verdnatura/salix#2814
No description provided.