feat: refs #6636 Modified updateClaim, model and tests #2256

Merged
guillermo merged 10 commits from 6636-pickup into dev 2024-04-09 08:01:28 +00:00
Member
No description provided.
guillermo added 1 commit 2024-04-04 12:14:18 +00:00
guillermo added 1 commit 2024-04-04 12:14:26 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
fcb4fe92e8
Merge branch 'dev' into 6636-pickup
guillermo requested review from alexm 2024-04-04 12:21:53 +00:00
guillermo reviewed 2024-04-04 12:22:37 +00:00
@ -36,0 +35,4 @@
"type": "string",
"mysql": {
"columnName": "pickup",
"dataType": "ENUM('agency', 'delivery')",
Author
Member

No se si cuando es ENUM, poneis eso o no...

No se si cuando es ENUM, poneis eso o no...
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-04-05 05:29:28 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
ac658fb6af
Merge branch 'dev' into 6636-pickup
guillermo added 2 commits 2024-04-05 05:40:32 +00:00
alexm requested changes 2024-04-05 05:55:09 +00:00
Dismissed
alexm left a comment
Member

Tot lo demes OK

Tot lo demes OK
@ -75,3 +75,1 @@
let changedHasToPickUp = false;
if (args.hasToPickUp)
changedHasToPickUp = true;
let changedPickup;
Member

Les 3 linies se poden refactoritzar per const changedPickup = args.pickup != claim.pickup

Les 3 linies se poden refactoritzar per `const changedPickup = args.pickup != claim.pickup`
Author
Member

Muy bien visto

Muy bien visto
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-04-05 06:17:09 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
16a6e3d8a6
feat: refs #6636 Requested change
guillermo added 1 commit 2024-04-05 08:59:29 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
6c1e44638e
feat: refs #6636 Added getEnumValue method
guillermo requested review from alexm 2024-04-05 09:00:49 +00:00
guillermo added 1 commit 2024-04-08 05:18:37 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
e27279e20e
Merge branch 'dev' into 6636-pickup
alexm reviewed 2024-04-08 06:12:00 +00:00
@ -0,0 +51,4 @@
if (!result) throw new UserError(`No results found`);
const regex = /'([^']*)'/g;
return result.COLUMN_TYPE.match(regex).map(match => match.slice(1, -1));
Member

Per curiositat aci com ho retorna, vuic dir com venen les dades en el result per a que fasa falta fer un .match

Per curiositat aci com ho retorna, vuic dir com venen les dades en el result per a que fasa falta fer un `.match`
Author
Member

Retorna enum('valor1', 'valor2', 'valor3', ...), ho faig per a que meu splite, de forma que tinc array['valor1', 'valor2', ...]

Retorna `enum('valor1', 'valor2', 'valor3', ...)`, ho faig per a que meu splite, de forma que tinc array['valor1', 'valor2', ...]
guillermo marked this conversation as resolved
alexm reviewed 2024-04-08 06:14:13 +00:00
@ -0,0 +35,4 @@
}
});
Self.getEnumValues = async(schema, table, column) => {
Member

Per a traure els tipos del enum valdria la pena comprovar si tens access a ixe camp? (En la funcio que fe carlosap, myUser_hasPriv) @jgallego

Per a traure els tipos del enum valdria la pena comprovar si tens access a ixe camp? (En la funcio que fe carlosap, `myUser_hasPriv`) @jgallego
Owner

ahi no poden haver dades sensibles, jo crec que no cal.

ahi no poden haver dades sensibles, jo crec que no cal.
guillermo marked this conversation as resolved
alexm approved these changes 2024-04-08 06:15:34 +00:00
Dismissed
alexm requested review from jgallego 2024-04-08 06:15:40 +00:00
alexm requested changes 2024-04-08 06:16:16 +00:00
Dismissed
@ -0,0 +1,56 @@
const ParameterizedSQL = require('loopback-connector').ParameterizedSQL;
const UserError = require('vn-loopback/util/user-error');
module.exports = Self => {
Member

Igual si que tiraria en falta algun test

Igual si que tiraria en falta algun test
Author
Member

Clar, pero en quin faig el test per a no crear dependencia?

O cree una taula en una columna en un enum per als tests?

Clar, pero en quin faig el test per a no crear dependencia? O cree una taula en una columna en un enum per als tests?
Author
Member
@alexm
Member

Pots ferte un rawSql on te crees una taula per al test (i desferla en rollbacks)
Paregut a aço: loopback/common/methods/application/spec/execute.spec.js

Pots ferte un rawSql on te crees una taula per al test (i desferla en rollbacks) Paregut a aço: `loopback/common/methods/application/spec/execute.spec.js`
guillermo marked this conversation as resolved
jgallego requested changes 2024-04-08 06:49:23 +00:00
Dismissed
@ -30,2 +30,2 @@
arg: 'hasToPickUp',
type: 'boolean'
arg: 'pickup',
type: 'any'
Owner

any es molt genèric, en addTimeEntry esta direction que es un enum i s'ha gastat 'string'

any es molt genèric, en addTimeEntry esta direction que es un enum i s'ha gastat 'string'
Author
Member

He tingut que ficar any, perque tame puc pasar-lo a null, i si ho fique com a string dona error.

He tingut que ficar any, perque tame puc pasar-lo a null, i si ho fique com a string dona error.
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-04-09 07:43:32 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
449a06c85c
feat: refs #6636 Added tests
guillermo added 1 commit 2024-04-09 07:43:53 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
c42e00f11e
Merge branch 'dev' into 6636-pickup
guillermo requested review from alexm 2024-04-09 07:43:54 +00:00
guillermo requested review from jgallego 2024-04-09 07:43:55 +00:00
jgallego approved these changes 2024-04-09 07:54:16 +00:00
alexm approved these changes 2024-04-09 07:59:03 +00:00
guillermo merged commit 9ab71318a9 into dev 2024-04-09 08:01:28 +00:00
guillermo deleted branch 6636-pickup 2024-04-09 08:01:28 +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#2256
No description provided.