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