refs #6184 saveCmr #1788

Merged
guillermo merged 58 commits from 6184-saveCmr into dev 2024-02-13 06:47:06 +00:00
Member
No description provided.
guillermo added 4 commits 2023-10-11 12:23:15 +00:00
gitea/salix/pipeline/head This commit looks good Details
3e522b08b6
refs #6184 Added saveCmr
gitea/salix/pipeline/head This commit looks good Details
d9339af87e
refs #6184 Insert in ticketCmr
gitea/salix/pipeline/head This commit looks good Details
c0089b1fa0
refs #6184 Added cmrFk in ticket model
gitea/salix/pipeline/head This commit looks good Details
3e70cb07e0
refs #6184 Changes
guillermo added 1 commit 2023-10-11 12:23:45 +00:00
gitea/salix/pipeline/head This commit looks good Details
c79f706cdc
Merge branch 'dev' into 6184-saveCmr
jgallego requested changes 2023-11-09 09:22:55 +00:00
@ -0,0 +61,4 @@
companyId: ticket.companyFk,
dmsTypeId: dmsType.id,
reference: '',
description: `Documento comprimido - CMR ${ticket.cmrFk}`,
Owner

al ser el tipo cmr, no es neceario poner cmr, pueden buscar por tipo
quitar texto en español.
Propuesta: poner cmr: cmrFk, ticket: ticketFk

al ser el tipo cmr, no es neceario poner cmr, pueden buscar por tipo quitar texto en español. Propuesta: poner cmr: cmrFk, ticket: ticketFk
guillermo marked this conversation as resolved
guillermo added 1 commit 2023-11-09 13:13:27 +00:00
gitea/salix/pipeline/head This commit looks good Details
0771548ef1
refs #6184 Requested changes
guillermo requested review from jgallego 2023-11-09 13:13:28 +00:00
guillermo added 1 commit 2023-11-09 13:14:28 +00:00
gitea/salix/pipeline/head This commit looks good Details
05a7498219
Merge branch 'dev' into 6184-saveCmr
jgallego requested review from alexm 2023-11-09 16:11:08 +00:00
alexm reviewed 2023-11-10 06:35:56 +00:00
@ -51,1 +51,4 @@
if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large');
const baseUrl = (ctx.req.headers.origin)
? `${ctx.req.headers.origin}/api`
Member

No he gastat mai .referer, pero crec que es millor gastar la funcio que crea pablo encomter de ctx.req.headers.origin
back/methods/url/getUrl.js

No he gastat mai .referer, pero crec que es millor gastar la funcio que crea pablo encomter de ctx.req.headers.origin back/methods/url/getUrl.js
Author
Member

El problema es que no quiero el "/#!/", ya que quiero apuntar a la API

El problema es que no quiero el "/#!/", ya que quiero apuntar a la API
guillermo marked this conversation as resolved
alexm approved these changes 2023-11-10 06:37:37 +00:00
Dismissed
alexm left a comment
Member

He possat ixe comentari pq ns si ja ho sabies i per aixo has ficat lo del .referer

He possat ixe comentari pq ns si ja ho sabies i per aixo has ficat lo del .referer
jgallego requested changes 2023-11-13 06:33:11 +00:00
@ -0,0 +35,4 @@
const ticket = await models.Ticket.findById(ticketId, myOptions);
if (ticket.cmrFk) {
const dmsType = await models.DmsType.findOne({
Owner

Este el cree cada vegada pero es el mateix id per a tots. Pujal fora del for
El nom jo posaría dmsTypeCmr

Este el cree cada vegada pero es el mateix id per a tots. Pujal fora del for El nom jo posaría dmsTypeCmr
guillermo marked this conversation as resolved
@ -0,0 +53,4 @@
if (!hasDmsCmr.dms()) {
const zip = await models.Route.downloadCmrsZip(ctx, ticket.cmrFk.toString(), myOptions);
let ctxUploadFile;
Owner

const

const
Author
Member

En eixe cas te que ser let, fijat baix.
Per a que siga const he tingut que juntar-ho.

En eixe cas te que ser let, fijat baix. Per a que siga const he tingut que juntar-ho.
guillermo marked this conversation as resolved
@ -0,0 +60,4 @@
warehouseId: ticket.warehouseFk,
companyId: ticket.companyFk,
dmsTypeId: dmsType.id,
reference: '',
Owner

si es dms, en reference posa ticket.cmrFk

si es dms, en reference posa ticket.cmrFk
guillermo marked this conversation as resolved
@ -63,6 +63,9 @@
},
"weight": {
"type": "number"
},
Owner

si el poses baix, ací dalt no cal. A no ser que vullgueres posar alguna propietat mes del tipo required..que no es el cas

si el poses baix, ací dalt no cal. A no ser que vullgueres posar alguna propietat mes del tipo required..que no es el cas
Author
Member

Lo he tenido que poner ya que si no no me detecta ese campo.

Lo he tenido que poner ya que si no no me detecta ese campo.
guillermo marked this conversation as resolved
guillermo added 1 commit 2023-11-13 07:35:22 +00:00
gitea/salix/pipeline/head This commit looks good Details
2792efa9cd
perf: refs #6184 Requested changes
guillermo dismissed alexm’s review 2023-11-13 07:35:23 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

guillermo added 1 commit 2023-11-13 08:56:40 +00:00
gitea/salix/pipeline/head This commit looks good Details
64ca72b1f4
refactor refs #6184 Changed downloadCmrsZip
guillermo added 1 commit 2023-11-13 09:44:14 +00:00
gitea/salix/pipeline/head This commit looks good Details
4003e161ce
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-17 09:43:33 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
f1b84ee7a0
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-17 12:07:01 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
45fd96cee6
feat: #6184 Modified uploadFile
guillermo added 1 commit 2024-01-17 13:18:04 +00:00
gitea/salix/pipeline/head This commit looks good Details
1a52e58eaa
feat: #6184 Created generateCmrPdf
guillermo added 1 commit 2024-01-17 13:30:32 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
85a0f8b323
feat: #6184 Minor change
guillermo added 1 commit 2024-01-17 13:42:11 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
a486b7f2d4
feat: #6184 Minor change
guillermo requested review from jgallego 2024-01-17 13:43:27 +00:00
jgallego requested changes 2024-01-18 06:17:37 +00:00
jgallego left a comment
Owner

Excepte el comentari esta ok, ara faltarien els test de back dels archius, si saps els fas si no pots derivar la tarea a algú de salix.

Excepte el comentari esta ok, ara faltarien els test de back dels archius, si saps els fas si no pots derivar la tarea a algú de salix.
@ -0,0 +41,4 @@
Object.assign(myOptions, options);
const zipConfig = await models.ZipConfig.findOne(null, myOptions);
let totalSize = 0;
Owner

totalSize per a que es gasta?

totalSize per a que es gasta?
Author
Member

Para nada, lo voy a quitar, ya no tiene sentido que esté ahí, bien visto

Para nada, lo voy a quitar, ya no tiene sentido que esté ahí, bien visto
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-01-18 06:46:31 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
ce5a2ada62
feat: #6184 Requested changes
guillermo added 1 commit 2024-01-18 09:55:09 +00:00
gitea/salix/pipeline/head This commit looks good Details
9faf889833
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-22 09:07:37 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
6701f70a33
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-23 10:05:14 +00:00
guillermo added 1 commit 2024-01-23 10:05:26 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
43bfb3cfde
Merge branch 'dev' into 6184-saveCmr
guillermo added 2 commits 2024-01-23 13:13:08 +00:00
guillermo added 1 commit 2024-01-25 12:56:16 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
9005975f1c
feat: #6184 Modified email cmr
guillermo changed title from 6184-saveCmr to refs #6184 saveCmr 2024-01-25 13:03:42 +00:00
guillermo added 1 commit 2024-01-26 09:04:52 +00:00
gitea/salix/pipeline/head This commit looks good Details
5828fa9657
feat: #6184 Refactor saveSign
guillermo added 1 commit 2024-01-26 09:14:16 +00:00
gitea/salix/pipeline/head This commit looks good Details
dec795d902
feat: #6184 Minor changes
guillermo added 1 commit 2024-01-26 09:43:32 +00:00
gitea/salix/pipeline/head This commit looks good Details
d5a145ba1b
feat: #6184 Minor changes
guillermo added 1 commit 2024-01-26 11:24:28 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
25fa154f60
feat: #6184 Minor changes
guillermo added 1 commit 2024-01-26 11:40:09 +00:00
gitea/salix/pipeline/head Build queued... Details
567e480e3b
feat: #6184 Minor changes
guillermo added 1 commit 2024-01-26 11:56:49 +00:00
gitea/salix/pipeline/head This commit looks good Details
49a08a96da
Merge branch 'dev' into 6184-saveCmr
guillermo requested review from jgallego 2024-01-26 11:58:06 +00:00
guillermo added 2 commits 2024-01-29 07:13:59 +00:00
guillermo added 1 commit 2024-01-29 07:24:25 +00:00
gitea/salix/pipeline/head This commit looks good Details
65756f98ad
fix: #6184 Minor changes
guillermo added 1 commit 2024-01-29 13:37:38 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
ed43b6be2d
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-30 06:31:50 +00:00
gitea/salix/pipeline/head This commit looks good Details
65268487b9
fix: #6184 Now creates only one dms in saveSign
guillermo added 1 commit 2024-01-30 06:42:22 +00:00
gitea/salix/pipeline/head This commit looks good Details
1fe6818a0f
fix: #6184 Minor changes
guillermo added 1 commit 2024-01-30 07:14:25 +00:00
gitea/salix/pipeline/head This commit looks good Details
0f3ffcfa61
fix: refs #6184 Upload sign
guillermo added 1 commit 2024-01-30 07:27:39 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
13b8964e3d
Merge branch 'dev' into 6184-saveCmr
Author
Member

El PR ya está listo para ser revisado.

El PR ya está listo para ser revisado.
alexm requested changes 2024-01-30 08:06:50 +00:00
@ -3069,0 +3072,4 @@
(2,'123456N','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',69,3,4,2,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet'),
(3,'123456B','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet',567,5,6,69,'Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet','Lorem ipsum dolor sit amet');
UPDATE `vn`.`ticket` SET `cmrFk`= 1 WHERE `id`= 1;
Member

Diria que es mejor enfoque poner el valor en el propio insert en ticket si es posible.
Asi luego para buscar fixtures o cambiarlas es mas facil

Diria que es mejor enfoque poner el valor en el propio insert en ticket si es posible. Asi luego para buscar fixtures o cambiarlas es mas facil
guillermo marked this conversation as resolved
@ -0,0 +46,4 @@
const recipient = ticket.client().email;
if (!recipient)
throw new UserError('Client does not have an email');
Member

Ya esta la traduccion There is no assigned email for this client por si te vale y asi no tenemos 2 casi iguales

Ya esta la traduccion `There is no assigned email for this client` por si te vale y asi no tenemos 2 casi iguales
guillermo marked this conversation as resolved
@ -0,0 +71,4 @@
if (!dms) throw new UserError('Cmr file does not exist');
const response = await models.Dms.downloadFile(ctx, dms.id);
const email = new Email('cmr', params);
Member

Si solo se usa una vez params se puede poner directamente el objeto o si se quiere variable poner inmediatamente arriba asi facilita la lectura

Si solo se usa una vez params se puede poner directamente el objeto o si se quiere variable poner inmediatamente arriba asi facilita la lectura
guillermo marked this conversation as resolved
@ -69,0 +45,4 @@
for (const id of ids) {
ctx.args = ctx.args || {};
ctx.args.id = Number(id);
const data = await models.Route.cmr(ctx, myOptions);
Member

En javascript se puede hacer const [data] = ... y cojera el primer valor de la array
Asi luego puedes hacer zip.file(`${id}.pdf`, data, {binary: true});

En javascript se puede hacer `const [data] = ...` y cojera el primer valor de la array Asi luego puedes hacer ```zip.file(`${id}.pdf`, data, {binary: true});```
@ -0,0 +1,22 @@
const models = require('vn-loopback/server/server').models;
Member

No acabo de ver el enfoque de este test. Al final lo que estas haciendo es mockear la funcion para que devuelva lo que quieres. Realmente no esta testeando nada.

Veria mejor enfoque mockear generateNodeStream que es lo que supongo que debes evitar hacer.

Recuerda usar rollback

No acabo de ver el enfoque de este test. Al final lo que estas haciendo es mockear la funcion para que devuelva lo que quieres. Realmente no esta testeando nada. Veria mejor enfoque mockear generateNodeStream que es lo que supongo que debes evitar hacer. _Recuerda usar rollback_
Member

Falta esta parte

Falta esta parte
guillermo marked this conversation as resolved
@ -0,0 +19,4 @@
await tx.rollback();
}
expect(error).toBeDefined();
Member

Aixina no sabries si realment esta fallant lo que esperes o es altre error.
Millor possar expect(error.message).toBe(`MyTextError`);

Aixina no sabries si realment esta fallant lo que esperes o es altre error. Millor possar ```expect(error.message).toBe(`MyTextError`);```
Author
Member

Jo lo que vuic saber es genéricament si falla o no, ja que no deuría

Jo lo que vuic saber es genéricament si falla o no, ja que no deuría
Member

En salix soles testejar el fallos en concret sino pot ser que falle per cualsevol cosa i cregues que te falla per lo q volies

En salix soles testejar el fallos en concret sino pot ser que falle per cualsevol cosa i cregues que te falla per lo q volies
guillermo added 1 commit 2024-01-30 08:43:33 +00:00
gitea/salix/pipeline/head This commit looks good Details
1e56e741e2
fix: #6184 Requested changes
guillermo added 1 commit 2024-01-30 08:44:11 +00:00
gitea/salix/pipeline/head This commit looks good Details
34f7345315
Merge branch 'dev' into 6184-saveCmr
guillermo added 2 commits 2024-01-30 08:50:16 +00:00
guillermo requested review from alexm 2024-01-30 08:50:16 +00:00
guillermo added 1 commit 2024-01-30 09:25:35 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
ae7fb12b53
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-01-31 08:17:49 +00:00
gitea/salix/pipeline/head There was a failure building this commit Details
a47276c86a
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-01 06:23:27 +00:00
guillermo added 1 commit 2024-02-01 07:11:35 +00:00
guillermo added 1 commit 2024-02-01 07:42:25 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
3fa49a259c
Merge branch 'dev' into 6184-saveCmr
alexm requested changes 2024-02-02 07:30:45 +00:00
alexm left a comment
Member

Dos comentarios y arreglar conflictos

Dos comentarios y arreglar conflictos
guillermo added 1 commit 2024-02-02 11:23:46 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
1d596b63a0
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-02 11:25:07 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
eec36300ad
refactor: refs #6184 Minor changes
guillermo requested review from alexm 2024-02-02 11:25:10 +00:00
Member

Faltan por corregir los dos comentarios de:
modules/route/back/methods/route/specs/saveCmr.spec.js
modules/route/back/methods/route/specs/downloadCmrsZip.spec.js

Faltan por corregir los dos comentarios de: modules/route/back/methods/route/specs/saveCmr.spec.js modules/route/back/methods/route/specs/downloadCmrsZip.spec.js
alexm requested changes 2024-02-05 07:40:57 +00:00
alexm left a comment
Member

.

.
guillermo added 1 commit 2024-02-06 05:39:07 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
d6ae1fd1f8
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-06 07:03:35 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
f2946e4168
fix: refs #6184 Requested changes
guillermo added 1 commit 2024-02-06 07:05:29 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
92abc3fb78
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-06 11:12:00 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
2cab007f57
fix: refs #6184 Requested changes
guillermo requested review from alexm 2024-02-06 11:12:12 +00:00
guillermo added 1 commit 2024-02-06 11:13:05 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
f4feb6e8b7
Merge branch 'dev' into 6184-saveCmr
alexm added 1 commit 2024-02-07 06:17:37 +00:00
gitea/salix/pipeline/pr-dev There was a failure building this commit Details
87864593b2
Merge branch 'dev' into 6184-saveCmr
alexm requested changes 2024-02-07 06:22:20 +00:00
@ -0,0 +35,4 @@
await tx.rollback();
} catch (e) {
await tx.rollback();
throw e;
Member

Si el titul del test es 'should throw error if the cmr can't save' el test deuria de testejar que falle la peticio

Si el titul del test es 'should throw error if the cmr can't save' el test deuria de testejar que falle la peticio
guillermo marked this conversation as resolved
guillermo added 1 commit 2024-02-07 09:28:56 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
ffa9212861
fix: refs #6184 Requested changes
guillermo requested review from alexm 2024-02-07 09:29:04 +00:00
alexm approved these changes 2024-02-07 09:29:36 +00:00
guillermo added 1 commit 2024-02-08 06:06:04 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
21d047c21f
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-08 11:25:25 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
cd613c770c
Merge branch 'dev' into 6184-saveCmr
guillermo added 1 commit 2024-02-13 06:34:18 +00:00
gitea/salix/pipeline/pr-dev This commit looks good Details
97f02187e3
Merge branch 'dev' into 6184-saveCmr
jgallego approved these changes 2024-02-13 06:45:34 +00:00
guillermo merged commit 8f4b901818 into dev 2024-02-13 06:47:06 +00:00
guillermo deleted branch 6184-saveCmr 2024-02-13 06:47:06 +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#1788
No description provided.