fix: migrate old error codes

This commit is contained in:
Rafael Taranto 2024-05-29 10:33:03 +01:00
parent 501da5f54a
commit ea92fa5c6d
4 changed files with 16 additions and 7 deletions

View file

@ -82,7 +82,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 NULL OR error_code NOT IN ('operatorCancel', 'scoreThresholdReached', 'walletScoringError', 'ciphertraceError'))
AND (error_code IS NULL OR error_code NOT IN ('operatorCancel', 'scoreThresholdReached', 'walletScoringError'))
AND fiat > 0
) ch WHERE NOT ch.expired ORDER BY ch.created`

View file

@ -0,0 +1,13 @@
const db = require('./db')
exports.up = function (next) {
let sql = [
`UPDATE cash_out_txs SET error_code = 'walletScoringError' WHERE error_code = 'ciphertraceError'`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}

View file

@ -185,11 +185,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
const hasChainAnalysisError = tx =>
!R.isNil(tx.errorCode) &&
R.includes(tx.errorCode, [
'scoreThresholdReached',
'walletScoringError',
'ciphertraceError'
])
R.includes(tx.errorCode, ['scoreThresholdReached', 'walletScoringError'])
const errorElements = (
<>

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', 'scoreThresholdReached', 'ciphertraceError']
const TX_PASSTHROUGH_ERROR_CODES = ['operatorCancel', 'scoreThresholdReached']
function filterTransaction () {
const sql = `EXPLAIN ANALYZE