test: refs #8361 enhance exchangeRateUpdate specs with additional scenarios #3340

Merged
jgallego merged 4 commits from 8361-exchangeRateUpdateWithFestiveDays into dev 2025-01-16 08:10:10 +00:00
Owner
No description provided.
jgallego added 1 commit 2025-01-07 09:46:34 +00:00
jgallego added 1 commit 2025-01-07 10:06:19 +00:00
jgallego requested review from carlosap 2025-01-07 10:22:49 +00:00
jgallego requested review from alexm 2025-01-07 10:22:49 +00:00
alexm requested changes 2025-01-07 11:18:40 +00:00
Dismissed
@ -27,1 +21,3 @@
const maxDateRecord = await models.ReferenceRate.findOne({order: 'dated DESC'});
let createdTx = false;
if (!myOptions.transaction) {
myOptions.transaction = await Self.beginTransaction({});
Member

Soles gastar esta forma

         tx = await Self.beginTransaction({});
            myOptions.transaction = tx;

Podriem gastar esta forma:

myOptions.transaction ?= await Self.beginTransaction({});

i despres fer

await myOptions.transaction?.commit();

Soles gastar esta forma ``` tx = await Self.beginTransaction({}); myOptions.transaction = tx; ``` Podriem gastar esta forma: ``` myOptions.transaction ?= await Self.beginTransaction({}); ``` i despres fer `await myOptions.transaction?.commit();`
jgallego marked this conversation as resolved
@ -36,0 +55,4 @@
myOptions
);
if (!currency)
throw new UserError(`Currency not found for code: ${code}`);
Member

Falta la traduccio (si se vol)

Falta la traduccio (si se vol)
jgallego marked this conversation as resolved
@ -75,1 +98,4 @@
}
if (createdTx)
await myOptions.transaction.commit();
Member

Aixina despres es if (tx) await tx.commit();

Aixina despres es if (tx) await tx.commit();
jgallego marked this conversation as resolved
jgallego added 1 commit 2025-01-07 13:53:36 +00:00
jgallego requested review from alexm 2025-01-07 13:54:11 +00:00
alexm approved these changes 2025-01-07 13:55:27 +00:00
carlosap requested changes 2025-01-10 06:30:47 +00:00
Dismissed
@ -36,0 +51,4 @@
if (!maxDate || xmlDateWithoutTime > maxDate) {
if (lastProcessedDate && xmlDateWithoutTime > lastProcessedDate) {
for (const code of ['USD', 'CNY', 'GBP']) {
Member

Se puede hacer dinámico (no se si vale la pena) haciendo un DISTINCT currencyFk de la tabla referenceRate

Se puede hacer dinámico (no se si vale la pena) haciendo un DISTINCT currencyFk de la tabla referenceRate
Author
Owner

No se quieren importar todas las monedas que hay en currency

No se quieren importar todas las monedas que hay en currency
Member

Añadiendo una columna a la tabla currencyFk o bien una nueva tabla de 'configuración'
Más que nada porque si en un futuro se requiere añadir o eliminar una moneda no tener que cambiar código

Añadiendo una columna a la tabla currencyFk o bien una nueva tabla de 'configuración' Más que nada porque si en un futuro se requiere añadir o eliminar una moneda no tener que cambiar código
jgallego requested review from carlosap 2025-01-10 14:21:26 +00:00
jgallego added 1 commit 2025-01-14 08:07:12 +00:00
jgallego removed review request for carlosap 2025-01-14 08:08:30 +00:00
jgallego requested review from carlosap 2025-01-14 08:08:32 +00:00
carlosap approved these changes 2025-01-14 11:59:29 +00:00
jgallego merged commit b8dbaec46c into dev 2025-01-16 08:10:10 +00:00
jgallego deleted branch 8361-exchangeRateUpdateWithFestiveDays 2025-01-16 08:10:10 +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#3340
No description provided.