From 03ae3b74e75b77ec6bad9e7be35b79ef27aece22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Oliveira?= Date: Wed, 4 May 2022 17:00:58 +0100 Subject: [PATCH] fix: set new risk score errors as passable error codes --- lib/customers.js | 2 +- lib/tx.js | 3 +-- test/stress/queries-performance-analyzer.js | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/customers.js b/lib/customers.js index 0f68f1ed..576a7626 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -25,7 +25,7 @@ const sms = require('./sms') const settingsLoader = require('./new-settings-loader') const logger = require('./logger') -const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel'] +const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel', 'scoreThresholdReached', 'ciphertraceError'] /** * Add new customer diff --git a/lib/tx.js b/lib/tx.js index 01085b75..3061be4a 100644 --- a/lib/tx.js +++ b/lib/tx.js @@ -69,7 +69,6 @@ function cancel (txId) { }) } - function customerHistory (customerId, thresholdDays) { const sql = `SELECT * FROM ( SELECT txIn.id, txIn.created, txIn.fiat, 'cashIn' AS direction, @@ -84,7 +83,7 @@ function customerHistory (customerId, thresholdDays) { FROM cash_out_txs txOut WHERE txOut.customer_id = $1 AND txOut.created > now() - interval $2 - AND error_code IS DISTINCT FROM 'operatorCancel' + AND error_code NOT IN ('operatorCancel', 'scoreThresholdReached', 'ciphertraceError') AND fiat > 0 ) ch WHERE NOT ch.expired ORDER BY ch.created` diff --git a/test/stress/queries-performance-analyzer.js b/test/stress/queries-performance-analyzer.js index 714743e1..c0ab7441 100644 --- a/test/stress/queries-performance-analyzer.js +++ b/test/stress/queries-performance-analyzer.js @@ -4,7 +4,7 @@ const _ = require('lodash/fp') const cashInTx = require('../../lib/cash-in/cash-in-tx') const { CASH_OUT_TRANSACTION_STATES, REDEEMABLE_AGE } = require('../../lib/cash-out/cash-out-helper') -const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel'] +const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel', 'scoreThresholdReached', 'ciphertraceError'] function filterTransaction () { const sql = `EXPLAIN ANALYZE