chore: deprecate backwards compatibility code

This commit is contained in:
Rafael Taranto 2025-04-11 07:39:21 +01:00
parent 8221701d99
commit 737672c07a
6 changed files with 8 additions and 262 deletions

View file

@ -59,10 +59,7 @@ function matchOfac (deviceId, customer) {
})
}
// BACKWARDS_COMPATIBILITY 7.5
// machines before 7.5 need to test sanctionsActive here
function validateOfac (deviceId, sanctionsActive, customer) {
if (!sanctionsActive) return Promise.resolve(true)
function validateOfac (deviceId, customer) {
if (customer.sanctionsOverride === 'blocked') return Promise.resolve(false)
if (customer.sanctionsOverride === 'verified') return Promise.resolve(true)
@ -70,8 +67,8 @@ function validateOfac (deviceId, sanctionsActive, customer) {
.then(didMatch => !didMatch)
}
function validationPatch (deviceId, sanctionsActive, customer) {
return validateOfac(deviceId, sanctionsActive, customer)
function validationPatch (deviceId, customer) {
return validateOfac(deviceId, customer)
.then(sanctions =>
_.isNil(customer.sanctions) || customer.sanctions !== sanctions ?
{ sanctions } :