test: refs #8361 enhance exchangeRateUpdate specs with additional scenarios #3340
Labels
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: verdnatura/salix#3340
Loading…
Reference in New Issue
No description provided.
Delete Branch "8361-exchangeRateUpdateWithFestiveDays"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -27,1 +21,3 @@
const maxDateRecord = await models.ReferenceRate.findOne({order: 'dated DESC'});
let createdTx = false;
if (!myOptions.transaction) {
myOptions.transaction = await Self.beginTransaction({});
Soles gastar esta forma
Podriem gastar esta forma:
i despres fer
await myOptions.transaction?.commit();
@ -36,0 +55,4 @@
myOptions
);
if (!currency)
throw new UserError(`Currency not found for code: ${code}`);
Falta la traduccio (si se vol)
@ -75,1 +98,4 @@
}
if (createdTx)
await myOptions.transaction.commit();
Aixina despres es if (tx) await tx.commit();
@ -36,0 +51,4 @@
if (!maxDate || xmlDateWithoutTime > maxDate) {
if (lastProcessedDate && xmlDateWithoutTime > lastProcessedDate) {
for (const code of ['USD', 'CNY', 'GBP']) {
Se puede hacer dinámico (no se si vale la pena) haciendo un DISTINCT currencyFk de la tabla referenceRate
No se quieren importar todas las monedas que hay en currency
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