fix: migrate old error codes
This commit is contained in:
parent
501da5f54a
commit
ea92fa5c6d
4 changed files with 16 additions and 7 deletions
|
|
@ -82,7 +82,7 @@ function customerHistory (customerId, thresholdDays) {
|
||||||
FROM cash_out_txs txOut
|
FROM cash_out_txs txOut
|
||||||
WHERE txOut.customer_id = $1
|
WHERE txOut.customer_id = $1
|
||||||
AND txOut.created > now() - interval $2
|
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
|
AND fiat > 0
|
||||||
) ch WHERE NOT ch.expired ORDER BY ch.created`
|
) ch WHERE NOT ch.expired ORDER BY ch.created`
|
||||||
|
|
||||||
|
|
|
||||||
13
migrations/1716974904249-ciphertrace-error-code.js
Normal file
13
migrations/1716974904249-ciphertrace-error-code.js
Normal 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()
|
||||||
|
}
|
||||||
|
|
@ -185,11 +185,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
|
||||||
|
|
||||||
const hasChainAnalysisError = tx =>
|
const hasChainAnalysisError = tx =>
|
||||||
!R.isNil(tx.errorCode) &&
|
!R.isNil(tx.errorCode) &&
|
||||||
R.includes(tx.errorCode, [
|
R.includes(tx.errorCode, ['scoreThresholdReached', 'walletScoringError'])
|
||||||
'scoreThresholdReached',
|
|
||||||
'walletScoringError',
|
|
||||||
'ciphertraceError'
|
|
||||||
])
|
|
||||||
|
|
||||||
const errorElements = (
|
const errorElements = (
|
||||||
<>
|
<>
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ const _ = require('lodash/fp')
|
||||||
const cashInTx = require('../../lib/cash-in/cash-in-tx')
|
const cashInTx = require('../../lib/cash-in/cash-in-tx')
|
||||||
const { CASH_OUT_TRANSACTION_STATES, REDEEMABLE_AGE } = require('../../lib/cash-out/cash-out-helper')
|
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 () {
|
function filterTransaction () {
|
||||||
const sql = `EXPLAIN ANALYZE
|
const sql = `EXPLAIN ANALYZE
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue