From 5e085056bc31a35d168af66f7526ed081fa881b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Tue, 16 Apr 2024 17:52:05 +0200 Subject: [PATCH 1/6] feat: Turn problems into calculated columns refs#7213 --- config/queues.yml | 161 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 161 insertions(+) diff --git a/config/queues.yml b/config/queues.yml index c335982..bf4fd4f 100644 --- a/config/queues.yml +++ b/config/queues.yml @@ -105,3 +105,164 @@ stock: orderRow: query: CALL stock.log_refreshOrder(:table, :id) key: id +ticketRequest: + query: CALL vn.ticket_getRequestProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + ticket: + key: id + columns: + - id + ticketRequest: + key: ticketFk + columns: + - ticketFk + - isOk +ticketFreeze: + query: CALL vn.ticket_getFreezeProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + client: + key: id + columns: + - id + - isFreezed + events: + - updaterows + ticket: + key: clientFk + columns: + - id + - clientFk +ticketIsTaxDataChecked: + query: CALL vn.ticket_getTaxDataCheckedProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + client: + key: id + columns: + - id + - isTaxDataChecked + events: + - updaterows + ticket: + key: id + columns: + - id + - clientFk +ticketIsTooLittle: + query: CALL vn.ticket_getTooLittleProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + ticket: + key: id + columns: + - id + - totalWithoutVat + - warehouseFk + events: + - updaterows + sale: + key: ticketFk + columns: + - id + - ticketFk + - itemFk + - quantity +ticketIsTooLittleItemCost: + query: CALL vn.ticket_getTooLittleProblemItemCost(:itemFk) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + itemCost: + key: itemFk + columns: + - itemFk + - warehouseFk + - cm3delivery + events: + - updaterows +ticketIsTooLittleConfig: + query: CALL vn.ticket_getTooLittleProblemConfig() + mode: fk + flushInterval: 5000 + includeSchema: + vn: + volumeConfig: + columns: + - minTicketVolume + - minTicketValue +saleComponentLack: + query: CALL vn.sale_getComponentLackProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + sale: + key: id + columns: + - id + saleComponent: + key: saleFk + columns: + - id + - saleFk + - componentFk +saleComponentLackComponent: + query: CALL vn.sale_getComponentLackProblem(:id) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + component: + key: id + columns: + - isRequired +clientRisk: + query: CALL vn.client_risk(:clientFk) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + ticket: + key: clientFk + columns: + - id + - clientFk + - shipped + - totalWithtVat + - refFk + receipt: + key: clientFk + columns: + - payed + - clientFk + - amountPaid + hedera: + tpvTransaction: + key: clientFk + columns: + - clientFk + - amount + - status + - receiptFk +ticketRisk: + query: CALL vn.ticket_getRiskProblem(:clientFk) + mode: fk + flushInterval: 5000 + includeSchema: + vn: + ticket: + key: clientFk + columns: + - clientFk + - risk \ No newline at end of file From ddf1d7cb9bb93615fd652757808cc781eec7cb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Wed, 22 May 2024 14:34:26 +0200 Subject: [PATCH 2/6] feat: problems in colums ticket and sale refs #7213 --- config/consumer.yml | 10 +- config/queues.yml | 268 ------------------------------ queues/clientRisk.yml | 30 ++++ queues/saleComponentLack.yml | 21 +++ queues/saleRounding.yml | 17 ++ queues/ticketFreeze.yml | 15 ++ queues/ticketIsTaxDataChecked.yml | 15 ++ queues/ticketIsTooLittle.yml | 38 +++++ queues/ticketRequest.yml | 16 ++ queues/ticketRisk.yml | 10 ++ 10 files changed, 170 insertions(+), 270 deletions(-) delete mode 100644 config/queues.yml create mode 100644 queues/clientRisk.yml create mode 100644 queues/saleComponentLack.yml create mode 100644 queues/saleRounding.yml create mode 100644 queues/ticketFreeze.yml create mode 100644 queues/ticketIsTaxDataChecked.yml create mode 100644 queues/ticketIsTooLittle.yml create mode 100644 queues/ticketRequest.yml create mode 100644 queues/ticketRisk.yml diff --git a/config/consumer.yml b/config/consumer.yml index 97d7e8e..a450698 100644 --- a/config/consumer.yml +++ b/config/consumer.yml @@ -12,5 +12,11 @@ db: password: password database: util pollQueues: - - queue1 - - queue2 + - ticketFreeze + - ticketIsTaxDataChecked + - ticketRequest + - ticketIsTooLittle + - clientRisk + - ticketRisk + - saleRounding + - saleComponentLack \ No newline at end of file diff --git a/config/queues.yml b/config/queues.yml deleted file mode 100644 index 9a4763a..0000000 --- a/config/queues.yml +++ /dev/null @@ -1,268 +0,0 @@ -orderTotal: - query: CALL hedera.order_recalc(:id) - mode: fk - flushInterval: 5000 - includeSchema: - hedera: - order: - key: id - columns: - - id - - address_id - - company_id - - date_send - - customer_id - events: - - updaterows - orderRow: - key: orderFk - columns: - - id - - orderFk - - itemFk - - warehouseFk - - shipment - - amount -ticketTotal: - query: CALL vn.ticket_recalc(:id, NULL) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - ticket: - key: id - columns: - - id - - shipped - - warehouseFk - - clientFk - events: - - updaterows - sale: - key: ticketFk - columns: - - id - - ticketFk - - itemFk - - quantity - - price -stock: - mode: id - includeSchema: - vn: - travel: - query: CALL stock.log_refreshBuy(:table, :id) - key: id - entry: - query: CALL stock.log_refreshBuy(:table, :id) - key: id - columns: - - id - - travelFk - - isRaid - events: - - updaterows - buy: - query: CALL stock.log_refreshBuy(:table, :id) - key: id - columns: - - id - - entryFk - - itemFk - - quantity - - created - ticket: - query: CALL stock.log_refreshSale(:table, :id) - key: id - columns: - - id - - warehouseFk - - shipped - events: - - updaterows - sale: - query: CALL stock.log_refreshSale(:table, :id) - key: id - columns: - - id - - ticketFk - - itemFk - - quantity - - created - - isPicked - hedera: - order: - query: CALL stock.log_refreshOrder(:table, :id) - key: id - columns: - - id - - date_send - - address_id - - company_id - - customer_id - events: - - updaterows - orderRow: - query: CALL stock.log_refreshOrder(:table, :id) - key: id -ticketRequest: - query: CALL vn.ticket_getRequestProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - ticket: - key: id - columns: - - id - ticketRequest: - key: ticketFk - columns: - - ticketFk - - isOk -ticketFreeze: - query: CALL vn.ticket_getFreezeProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - client: - key: id - columns: - - id - - isFreezed - events: - - updaterows - ticket: - key: clientFk - columns: - - id - - clientFk -ticketIsTaxDataChecked: - query: CALL vn.ticket_getTaxDataCheckedProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - client: - key: id - columns: - - id - - isTaxDataChecked - events: - - updaterows - ticket: - key: id - columns: - - id - - clientFk -ticketIsTooLittle: - query: CALL vn.ticket_getTooLittleProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - ticket: - key: id - columns: - - id - - totalWithoutVat - - warehouseFk - events: - - updaterows - sale: - key: ticketFk - columns: - - id - - ticketFk - - itemFk - - quantity -ticketIsTooLittleItemCost: - query: CALL vn.ticket_getTooLittleProblemItemCost(:itemFk) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - itemCost: - key: itemFk - columns: - - itemFk - - warehouseFk - - cm3delivery - events: - - updaterows -ticketIsTooLittleConfig: - query: CALL vn.ticket_getTooLittleProblemConfig() - mode: fk - flushInterval: 5000 - includeSchema: - vn: - volumeConfig: - columns: - - minTicketVolume - - minTicketValue -saleComponentLack: - query: CALL vn.sale_getComponentLackProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - sale: - key: id - columns: - - id - saleComponent: - key: saleFk - columns: - - id - - saleFk - - componentFk -saleComponentLackComponent: - query: CALL vn.sale_getComponentLackProblem(:id) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - component: - key: id - columns: - - isRequired -clientRisk: - query: CALL vn.client_risk(:clientFk) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - ticket: - key: clientFk - columns: - - id - - clientFk - - shipped - - totalWithtVat - - refFk - receipt: - key: clientFk - columns: - - payed - - clientFk - - amountPaid - hedera: - tpvTransaction: - key: clientFk - columns: - - clientFk - - amount - - status - - receiptFk -ticketRisk: - query: CALL vn.ticket_getRiskProblem(:clientFk) - mode: fk - flushInterval: 5000 - includeSchema: - vn: - ticket: - key: clientFk - columns: - - clientFk - - risk diff --git a/queues/clientRisk.yml b/queues/clientRisk.yml new file mode 100644 index 0000000..dcbb7ea --- /dev/null +++ b/queues/clientRisk.yml @@ -0,0 +1,30 @@ +query: + ticket: CALL vn.ticket_setRisk(:clientFk) +includeSchema: + vn: + ticket: + key: clientFk + columns: + - id + - clientFk + - shipped + - totalWithVat + - refFk + receipt: + key: clientFk + scope: ticket + columns: + - payed + - clientFk + - amountPaid + hedera: + tpvTransaction: + key: clientFk + scope: ticket + columns: + - clientFk + - amount + - status + - receiptFk + + diff --git a/queues/saleComponentLack.yml b/queues/saleComponentLack.yml new file mode 100644 index 0000000..42c3dcc --- /dev/null +++ b/queues/saleComponentLack.yml @@ -0,0 +1,21 @@ +query: + sale: CALL vn.sale_setProblemComponentLack(:id) + component: CALL vn.sale_setProblemComponentLackByComponent(:id) +includeSchema: + vn: + sale: + key: id + columns: + - id + saleComponent: + key: saleFk + scope: sale + columns: + - id + - saleFk + - componentFk + component: + key: id + columns: + - id + - isRequired \ No newline at end of file diff --git a/queues/saleRounding.yml b/queues/saleRounding.yml new file mode 100644 index 0000000..ec1ea41 --- /dev/null +++ b/queues/saleRounding.yml @@ -0,0 +1,17 @@ +query: + ticket: CALL vn.ticket_setProblemRounding(:id) + sale: CALL vn.sale_setProblemRounding(:id) +includeSchema: + vn: + ticket: + key: id + columns: + - id + - warehouseFk + - shipped + sale: + key: id + columns: + - id + - quantity + - itemFk \ No newline at end of file diff --git a/queues/ticketFreeze.yml b/queues/ticketFreeze.yml new file mode 100644 index 0000000..51bdf70 --- /dev/null +++ b/queues/ticketFreeze.yml @@ -0,0 +1,15 @@ +query: + client: CALL vn.ticket_setProblemFreeze(:id) +includeSchema: + vn: + client: + key: id + columns: + - id + - isFreezed + ticket: + key: clientFk + scope: client + columns: + - id + - clientFk \ No newline at end of file diff --git a/queues/ticketIsTaxDataChecked.yml b/queues/ticketIsTaxDataChecked.yml new file mode 100644 index 0000000..27b3e19 --- /dev/null +++ b/queues/ticketIsTaxDataChecked.yml @@ -0,0 +1,15 @@ +query: + client: CALL vn.ticket_setProblemTaxDataChecked(:id) +includeSchema: + vn: + client: + key: id + columns: + - id + - isTaxDataChecked + ticket: + key: clientFk + scope: client + columns: + - id + - clientFk \ No newline at end of file diff --git a/queues/ticketIsTooLittle.yml b/queues/ticketIsTooLittle.yml new file mode 100644 index 0000000..852b4b6 --- /dev/null +++ b/queues/ticketIsTooLittle.yml @@ -0,0 +1,38 @@ +query: + ticket: CALL vn.ticket_setProblemTooLittle(:id) + item: CALL vn.ticket_setProblemTooLittleItemCost(:itemFk) + config: CALL vn.ticket_setProblemTooLittleItemCost(NULL) +includeSchema: + vn: + ticket: + key: id + columns: + - id + - totalWithoutVat + - warehouseFk + events: + - updaterows + sale: + key: ticketFk + scope: ticket + columns: + - id + - ticketFk + - itemFk + - quantity + itemCost: + key: itemFk + scope: item + columns: + - itemFk + - warehouseFk + - cm3delivery + events: + - updaterows + volumeConfig: + scope: config + columns: + - minTicketValue + - minTicketVolume + events: + - updaterows \ No newline at end of file diff --git a/queues/ticketRequest.yml b/queues/ticketRequest.yml new file mode 100644 index 0000000..fcfd7dc --- /dev/null +++ b/queues/ticketRequest.yml @@ -0,0 +1,16 @@ +query: + ticket: CALL vn.ticket_setProblemRequest(:id) +includeSchema: + vn: + ticket: + key: id + columns: + - id + events: + - updaterows + ticketRequest: + key: ticketFk + scope: ticket + columns: + - ticketFk + - isOk \ No newline at end of file diff --git a/queues/ticketRisk.yml b/queues/ticketRisk.yml new file mode 100644 index 0000000..c46bc31 --- /dev/null +++ b/queues/ticketRisk.yml @@ -0,0 +1,10 @@ +query: + ticket: CALL vn.ticket_setProblemRisk(:id) +includeSchema: + vn: + ticket: + key: id + columns: + - id + - clientFk + - risk \ No newline at end of file From 90dfabe8e9370fb89902a57ba6e7185f6ff1c75e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 23 May 2024 18:27:39 +0200 Subject: [PATCH 3/6] feat: problems in colums ticket and sale refs #7213 --- config/consumer.yml | 10 ++-------- queues/clientRisk.yml | 4 +--- queues/ticketIsTooLittle.yml | 2 -- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/config/consumer.yml b/config/consumer.yml index a450698..97d7e8e 100644 --- a/config/consumer.yml +++ b/config/consumer.yml @@ -12,11 +12,5 @@ db: password: password database: util pollQueues: - - ticketFreeze - - ticketIsTaxDataChecked - - ticketRequest - - ticketIsTooLittle - - clientRisk - - ticketRisk - - saleRounding - - saleComponentLack \ No newline at end of file + - queue1 + - queue2 diff --git a/queues/clientRisk.yml b/queues/clientRisk.yml index dcbb7ea..100c36c 100644 --- a/queues/clientRisk.yml +++ b/queues/clientRisk.yml @@ -25,6 +25,4 @@ includeSchema: - clientFk - amount - status - - receiptFk - - + - receiptFk \ No newline at end of file diff --git a/queues/ticketIsTooLittle.yml b/queues/ticketIsTooLittle.yml index 852b4b6..0596b9a 100644 --- a/queues/ticketIsTooLittle.yml +++ b/queues/ticketIsTooLittle.yml @@ -27,8 +27,6 @@ includeSchema: - itemFk - warehouseFk - cm3delivery - events: - - updaterows volumeConfig: scope: config columns: From 33da9404972036da9f3debc656101d48c4efa3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s?= Date: Thu, 6 Jun 2024 17:25:48 +0200 Subject: [PATCH 4/6] Change version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 42eda9c..96a514a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mycdc", - "version": "0.0.14", + "version": "0.0.15", "author": "Verdnatura Levante SL", "description": "Asynchronous DB calculations reading the binary log", "license": "GPL-3.0", From 7d7df16e65f649413f9ef84da1858b8af0575a3f Mon Sep 17 00:00:00 2001 From: Guillermo Bonet Date: Tue, 25 Jun 2024 12:42:47 +0000 Subject: [PATCH 5/6] Actualizar queues/clientRisk.yml --- queues/clientRisk.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues/clientRisk.yml b/queues/clientRisk.yml index 100c36c..bdc6c66 100644 --- a/queues/clientRisk.yml +++ b/queues/clientRisk.yml @@ -1,5 +1,5 @@ query: - ticket: CALL vn.ticket_setRisk(:clientFk) + ticket: CALL vn.ticket_setRisk(:id) includeSchema: vn: ticket: From c13f46b0788f64f681582219c97200033be72c8d Mon Sep 17 00:00:00 2001 From: Guillermo Bonet Date: Wed, 3 Jul 2024 10:18:53 +0000 Subject: [PATCH 6/6] Fix --- queues/ticketIsTooLittle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/queues/ticketIsTooLittle.yml b/queues/ticketIsTooLittle.yml index 0596b9a..9c94753 100644 --- a/queues/ticketIsTooLittle.yml +++ b/queues/ticketIsTooLittle.yml @@ -1,6 +1,6 @@ query: ticket: CALL vn.ticket_setProblemTooLittle(:id) - item: CALL vn.ticket_setProblemTooLittleItemCost(:itemFk) + item: CALL vn.ticket_setProblemTooLittleItemCost(:id) config: CALL vn.ticket_setProblemTooLittleItemCost(NULL) includeSchema: vn: