fix: increasing discount on same tx

This commit is contained in:
Rafael Taranto 2025-01-05 08:51:29 +00:00
parent 51d7878ff7
commit 5a1163e723

View file

@ -102,8 +102,8 @@ function diff (oldTx, newTx) {
} }
function ensureRatchet (oldField, newField, fieldKey) { function ensureRatchet (oldField, newField, fieldKey) {
const monotonic = ['cryptoAtoms', 'fiat', 'send', 'sendConfirmed', 'operatorCompleted', 'timedout', 'txVersion', 'batched'] const monotonic = ['cryptoAtoms', 'fiat', 'send', 'sendConfirmed', 'operatorCompleted', 'timedout', 'txVersion', 'batched', 'discount']
const free = ['sendPending', 'error', 'errorCode', 'customerId'] const free = ['sendPending', 'error', 'errorCode', 'customerId', 'discountSource']
if (_.isNil(oldField)) return true if (_.isNil(oldField)) return true
if (_.includes(fieldKey, monotonic)) return isMonotonic(oldField, newField, fieldKey) if (_.includes(fieldKey, monotonic)) return isMonotonic(oldField, newField, fieldKey)