fix: add operator cancel error as cancelled tx state

This commit is contained in:
Sérgio Salgado 2021-11-21 22:06:00 +00:00
parent 86e9204a28
commit 66f79481a2
2 changed files with 3 additions and 2 deletions

View file

@ -19,7 +19,7 @@ const WALLET_SCORE_THRESHOLD = 10
const TRANSACTION_STATES = ` const TRANSACTION_STATES = `
case case
when operator_completed then 'Cancelled' when operator_completed and error = 'Operator cancel' then 'Cancelled'
when error is not null then 'Error' when error is not null then 'Error'
when send_confirmed then 'Sent' when send_confirmed then 'Sent'
when ((not send_confirmed) and (created <= now() - interval '${PENDING_INTERVAL}')) then 'Expired' when ((not send_confirmed) and (created <= now() - interval '${PENDING_INTERVAL}')) then 'Expired'

View file

@ -7,7 +7,8 @@ const BN = require('../bn')
const REDEEMABLE_AGE = T.day const REDEEMABLE_AGE = T.day
const CASH_OUT_TRANSACTION_STATES = ` const CASH_OUT_TRANSACTION_STATES = `
case case
when error = 'Operator cancel' then 'Cancelled'
when error is not null then 'Error' when error is not null then 'Error'
when dispense then 'Success' when dispense then 'Success'
when (extract(epoch from (now() - greatest(created, confirmed_at))) * 1000) >= ${REDEEMABLE_AGE} then 'Expired' when (extract(epoch from (now() - greatest(created, confirmed_at))) * 1000) >= ${REDEEMABLE_AGE} then 'Expired'