#6964 _ itemOlder #2197

Merged
sergiodt merged 26 commits from 6964_itemOlder into dev 2024-04-04 14:18:20 +00:00
Member
No description provided.
sergiodt added 4 commits 2024-03-22 09:10:18 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
09923d2509
refs #6964 feat:advice for olderItem
gitea/salix/pipeline/pr-dev Build started... Details
d8da317339
Merge branch 'dev' into 6964_itemOlder
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
027aa86662
refs #6964 feat:advice for olderItem
sergiodt added 1 commit 2024-03-22 09:10:34 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
4dca49360e
Merge branch 'dev' into 6964_itemOlder
sergiodt added 1 commit 2024-03-22 10:42:28 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
976c5b7ba8
refs #6964 feat:advice for olderItem
sergiodt added 1 commit 2024-03-22 10:43:41 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
c10e8d6733
Merge branch 'dev' into 6964_itemOlder
sergiodt requested review from carlosap 2024-03-22 10:44:06 +00:00
sergiodt added 1 commit 2024-03-22 10:47:32 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
61b649fdc5
refs #6964 feat:advice for olderItem
sergiodt added 1 commit 2024-03-22 12:04:25 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
c4fcb2cd12
refs #6964 feat:advice for olderItem
carlosap requested review from alexm 2024-03-22 15:48:02 +00:00
carlosap requested changes 2024-03-22 16:24:41 +00:00
Dismissed
@ -0,0 +36,4 @@
Self.hasItemOlder = async(shelvingFkIn, parking, shelvingFkOut, itemFk, options) => {
const result = await Self.rawSql(`
SELECT COUNT(ish.id)
Member

Millor fiquem un alias al cam

Millor fiquem un alias al cam
sergiodt marked this conversation as resolved
@ -0,0 +37,4 @@
Self.hasItemOlder = async(shelvingFkIn, parking, shelvingFkOut, itemFk, options) => {
const result = await Self.rawSql(`
SELECT COUNT(ish.id)
FROM vn.itemShelving ish
Member

Tabulació

Tabulació
sergiodt marked this conversation as resolved
@ -0,0 +45,4 @@
LEFT JOIN vn.parking p ON p.id = s.parkingFk
WHERE ish.shelvingFk = ?
)sub ON sub.itemFK = ish.itemFk
JOIN vn.shelving s ON s.code = ish.shelvingFk
Member

Tabulació

Tabulació
sergiodt marked this conversation as resolved
alexm reviewed 2024-03-25 06:06:43 +00:00
@ -0,0 +52,4 @@
AND (ish.shelvingFk <> ? OR ? IS NULL)
AND (ish.itemFk <> ? OR ? IS NULL)`,
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
return result[0]['COUNT(ish.id)'] > 0;
Member

Si li poses el alias aci hi ha que canviarlo

Si li poses el alias aci hi ha que canviarlo
sergiodt marked this conversation as resolved
alexm approved these changes 2024-03-25 06:07:00 +00:00
Dismissed
alexm reviewed 2024-03-25 06:10:53 +00:00
@ -0,0 +34,4 @@
}
});
Self.hasItemOlder = async(shelvingFkIn, parking, shelvingFkOut, itemFk, options) => {
Member

Els 3(parking, shelvingFkOut, itemFk) poden ser null a la vega? O faria falta al menys uno?
Per si fera falta ficar un if(!parking && !shelvingFkOut && !itemFk) return throw new UserError(...)

Els 3(parking, shelvingFkOut, itemFk) poden ser null a la vega? O faria falta al menys uno? Per si fera falta ficar un if(!parking && !shelvingFkOut && !itemFk) return throw new UserError(...)
Author
Member

Posat

Posat
sergiodt marked this conversation as resolved
alexm requested changes 2024-03-25 06:11:28 +00:00
Dismissed
@ -0,0 +51,4 @@
AND (p.code <> ? OR ? IS NULL)
AND (ish.shelvingFk <> ? OR ? IS NULL)
AND (ish.itemFk <> ? OR ? IS NULL)`,
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
Member

falta gastar la transaccio (...shelvingFkOut, itemFk, itemFk], options)

falta gastar la transaccio (...shelvingFkOut, itemFk, itemFk], options)
Author
Member

Llevat options

Llevat options
Member

Es ficarlo sino no gastarà la transaccio

Es ficarlo sino no gastarà la transaccio
Author
Member

L'he posat però no veia que fera falta...

L'he posat però no veia que fera falta...
sergiodt marked this conversation as resolved
sergiodt added 2 commits 2024-03-25 06:55:02 +00:00
sergiodt requested review from carlosap 2024-03-25 06:56:35 +00:00
sergiodt requested review from alexm 2024-03-25 06:56:36 +00:00
alexm requested changes 2024-03-25 07:10:23 +00:00
Dismissed
@ -0,0 +53,4 @@
AND (p.code <> ? OR ? IS NULL)
AND (ish.shelvingFk <> ? OR ? IS NULL)
AND (ish.itemFk <> ? OR ? IS NULL)`,
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk]);
Member

Aci

Aci
sergiodt marked this conversation as resolved
@ -0,0 +5,4 @@
it('should return false because there are not older items', async() => {
const shelvingFkIn = 'GVC';
const shelvingFkOut = 'HEJ';
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, shelvingFkOut);
Member

Al cridar a la funcio hi ha que seguir el mateix ordre que dalt (async(shelvingFkIn, parking, shelvingFkOut, itemFk, options)

Per tant seria await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut)

Al cridar a la funcio hi ha que seguir el mateix ordre que dalt (`async(shelvingFkIn, parking, shelvingFkOut, itemFk, options`) Per tant seria `await models.ItemShelving.hasItemOlder(shelvingFkIn, null, shelvingFkOut)`
sergiodt marked this conversation as resolved
@ -0,0 +33,4 @@
await itemShelvingBefore.updateAttributes({
itemFk: itemFk
});
const result = await models.ItemShelving.hasItemOlder(shelvingFkIn, parking);
Member

Aci deuries gastar la transaccio
await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions)

Aci deuries gastar la transaccio await models.ItemShelving.hasItemOlder(shelvingFkIn, parking, null, null, myOptions)
Author
Member

Ací si que veig que faltava posar myOptions perquè faig més accions

Ací si que veig que faltava posar myOptions perquè faig més accions
sergiodt marked this conversation as resolved
alexm changed title from 6964_itemOlder to #6964 _ itemOlder 2024-03-25 07:10:36 +00:00
sergiodt added 1 commit 2024-03-25 07:20:15 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
a40234ba9b
refs #6964 feat:hasItemOlder
sergiodt added 1 commit 2024-03-25 07:25:00 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
1b09c5b4ba
Merge branch 'dev' into 6964_itemOlder
sergiodt requested review from alexm 2024-03-25 12:06:48 +00:00
alexm requested changes 2024-03-25 12:17:51 +00:00
Dismissed
@ -0,0 +36,4 @@
});
Self.hasItemOlder = async(shelvingFkIn, parking, shelvingFkOut, itemFk, options) => {
if (!parking && !shelvingFkOut) throw new UserError('Missing data: parking or shelving');
Member

Faltaria la traduccion

Faltaria la traduccion
Author
Member

Afegida

Afegida
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-03-25 15:07:36 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
8b684442f5
refs #6276 hotFix: setUserError and return
sergiodt added 1 commit 2024-03-25 15:07:57 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
e84805508a
Merge branch 'dev' into 6964_itemOlder
sergiodt added 2 commits 2024-03-25 15:09:20 +00:00
alexm requested changes 2024-03-26 07:04:21 +00:00
Dismissed
@ -0,0 +35,4 @@
}
});
Self.hasItemOlder = async(shelvingFkIn, parking, shelvingFkOut, itemFk, options) => {
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
@ -0,0 +53,4 @@
AND (p.code <> ? OR ? IS NULL)
AND (ish.shelvingFk <> ? OR ? IS NULL)
AND (ish.itemFk <> ? OR ? IS NULL)`,
[shelvingFkIn, parking, parking, shelvingFkOut, shelvingFkOut, itemFk, itemFk], options);
Member

myOptions

myOptions
sergiodt marked this conversation as resolved
@ -0,0 +32,4 @@
const itemShelvingBefore = await models.ItemShelving.findOne(filter, myOptions);
await itemShelvingBefore.updateAttributes({
itemFk: itemFk
});
Member

, myOptions

, myOptions
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-03-26 09:24:41 +00:00
sergiodt added 1 commit 2024-03-26 09:30:29 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
678eb2928f
refs #6964 feat:hasItemOlder
sergiodt requested review from alexm 2024-03-26 10:02:35 +00:00
alexm requested changes 2024-03-26 12:15:04 +00:00
Dismissed
@ -0,0 +31,4 @@
try {
const itemShelvingBefore = await models.ItemShelving.findOne(filter, myOptions);
await itemShelvingBefore.updateAttributes({
itemFk: itemFk
Member

, myOptions

, myOptions
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-03-27 06:09:08 +00:00
sergiodt added 1 commit 2024-03-27 06:09:29 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
ff8522cfd1
refs #6964 feat:advice for olderItem
sergiodt requested review from alexm 2024-03-27 06:10:27 +00:00
alexm added 1 commit 2024-03-27 06:30:03 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
5a19c1ebb1
Merge branch 'dev' into 6964_itemOlder
alexm requested changes 2024-03-27 06:33:34 +00:00
Dismissed
alexm left a comment
Member

Tot lo demes okay

Tot lo demes okay
@ -0,0 +22,4 @@
},
{
arg: 'itemFk',
type: 'int',
Member

He buscat y type int no ho hem gastat mai,
Seria type: 'integer',

He buscat y type int no ho hem gastat mai, Seria `type: 'integer',`
Author
Member

vaig mesclant llenguatges :-)

vaig mesclant llenguatges :-)
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-03-27 06:50:01 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
9240732c00
refs #6964 feat:advice for olderItem
sergiodt requested review from alexm 2024-03-27 06:52:00 +00:00
alexm approved these changes 2024-03-27 12:08:20 +00:00
carlosap requested changes 2024-03-27 18:16:36 +00:00
Dismissed
@ -0,0 +46,4 @@
SELECT COUNT(ish.id) countItemOlder
FROM vn.itemShelving ish
JOIN (
SELECT ish.itemFk, created,shelvingFk, p.code
Member

en la subconsulta el p.code y el LEFT JOIN vn.parking p ON p.id = s.parkingFk sirven para algo??

en la subconsulta el p.code y el LEFT JOIN vn.parking p ON p.id = s.parkingFk sirven para algo??
Author
Member

Llevat

Llevat
sergiodt marked this conversation as resolved
sergiodt added 1 commit 2024-03-28 06:15:40 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
7634d82d8b
refs #6964 feat:hasItemOlder
sergiodt added 1 commit 2024-03-28 10:08:59 +00:00
gitea/salix/pipeline/pr-test This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
b62905c5ef
Merge branch 'dev' into 6964_itemOlder
alexm changed target branch from dev to test 2024-03-28 10:46:48 +00:00
alexm changed target branch from test to dev 2024-03-28 10:47:02 +00:00
sergiodt requested review from carlosap 2024-04-04 10:08:00 +00:00
carlosap approved these changes 2024-04-04 10:43:20 +00:00
sergiodt added 1 commit 2024-04-04 13:45:23 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
2ed5237568
Merge branch 'dev' into 6964_itemOlder
sergiodt merged commit cf10ed0f13 into dev 2024-04-04 14:18:20 +00:00
sergiodt deleted branch 6964_itemOlder 2024-04-04 14:18:20 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 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#2197
No description provided.