fix: migrate hardlimit to suspend

This commit is contained in:
José Oliveira 2021-02-23 21:04:05 +00:00 committed by Josh Harvey
parent 2bfd26d13c
commit 28ee05a24a

View file

@ -348,21 +348,24 @@ function migrateComplianceTriggers (config) {
idPhoto: 'idCardPhoto',
facePhoto: 'facephoto',
sanctions: 'sanctions',
block: 'block'
suspend: 'suspend'
}
function createTrigger (
requirement,
threshold
) {
return {
const triggerConfig = {
id: uuid.v4(),
cashDirection: 'both',
direction: 'both',
suspensionDays: null,
threshold,
thresholdDays: 1,
triggerType: triggerTypes.amount,
triggerType: triggerTypes.volume,
requirement
}
if (requirement === 'suspend') triggerConfig.suspensionDays = 1
return triggerConfig
}
const codes = [
@ -413,7 +416,7 @@ function migrateComplianceTriggers (config) {
}
if (global.hardLimitVerificationActive && _.isNumber(global.hardLimitVerificationThreshold)) {
triggers.push(
createTrigger(requirements.block, global.hardLimitVerificationThreshold)
createTrigger(requirements.suspend, global.hardLimitVerificationThreshold)
)
}
return {