fix: compliance fixes
This commit is contained in:
parent
c45241471e
commit
118852a433
5 changed files with 10 additions and 8 deletions
|
|
@ -45,9 +45,9 @@ function loadSanctions (settings) {
|
|||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const triggers = configManager.getTriggers(settings.config)
|
||||
const compatTriggers = complianceTriggers.getBackwardsCompatibleTriggers(triggers)
|
||||
const hasSanctions = complianceTriggers.hasSanctions(triggers)
|
||||
|
||||
if (!compatTriggers.sanctions) return
|
||||
if (!hasSanctions) return
|
||||
|
||||
logger.info('Loading sanctions DB...')
|
||||
return ofacUpdate.update()
|
||||
|
|
|
|||
|
|
@ -6,4 +6,8 @@ function getBackwardsCompatibleTriggers (triggers) {
|
|||
return _.mapValues(_.compose(_.get('threshold'), _.minBy('threshold')))(grouped)
|
||||
}
|
||||
|
||||
module.exports = { getBackwardsCompatibleTriggers}
|
||||
function hasSanctions (triggers) {
|
||||
return _.some(_.matches({ requirement: 'sanctions' }))(triggers)
|
||||
}
|
||||
|
||||
module.exports = { getBackwardsCompatibleTriggers, hasSanctions }
|
||||
|
|
@ -50,9 +50,9 @@ function initialSanctionsDownload () {
|
|||
|
||||
function updateAndLoadSanctions () {
|
||||
const triggers = configManager.getTriggers(settings().config)
|
||||
const compatTriggers = complianceTriggers.getBackwardsCompatibleTriggers(triggers)
|
||||
const hasSanctions = complianceTriggers.hasSanctions(triggers)
|
||||
|
||||
if (!compatTriggers.sanctions) return Promise.resolve()
|
||||
if (!hasSanctions) return Promise.resolve()
|
||||
|
||||
logger.info('Updating sanctions database...')
|
||||
return sanctionsUpdater.update()
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ function updateCustomer (req, res, next) {
|
|||
// machines before 7.5 expect customer with sanctions result
|
||||
const isOlderMachineVersion = !machineVersion || semver.lt(machineVersion, '7.5.0-beta.0')
|
||||
|
||||
Promise.resolve({})
|
||||
return Promise.resolve({})
|
||||
.then(emptyObj => {
|
||||
if (!isOlderMachineVersion) return Promise.resolve(emptyObj)
|
||||
return compliance.validationPatch(req.deviceId, !!compatTriggers.sanctions, mergedCustomer)
|
||||
|
|
@ -287,7 +287,6 @@ function updateCustomer (req, res, next) {
|
|||
.then(newPatch => customers.updatePhotoCard(id, newPatch))
|
||||
.then(newPatch => customers.updateFrontCamera(id, newPatch))
|
||||
.then(newPatch => customers.update(id, newPatch, null, txId))
|
||||
|
||||
})
|
||||
.then(customer => respond(req, res, { customer }))
|
||||
.catch(next)
|
||||
|
|
|
|||
|
|
@ -89,7 +89,6 @@ const Autocomplete = ({
|
|||
size={size}
|
||||
fullWidth={fullWidth}
|
||||
textAlign={textAlign}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue