fix: set new risk score errors as passable error codes

This commit is contained in:
José Oliveira 2022-05-04 17:00:58 +01:00
parent 4d520f2c24
commit 03ae3b74e7
3 changed files with 3 additions and 4 deletions

View file

@ -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

View file

@ -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`

View file

@ -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