refactor: pass suspension days as param
This commit is contained in:
parent
28ee05a24a
commit
ca86a70d42
1 changed files with 8 additions and 4 deletions
|
|
@ -335,6 +335,9 @@ function migrateTermsAndConditions (config) {
|
|||
}
|
||||
|
||||
function migrateComplianceTriggers (config) {
|
||||
|
||||
const suspensionDays = 1
|
||||
|
||||
const triggerTypes = {
|
||||
amount: 'txAmount',
|
||||
velocity: 'txVelocity',
|
||||
|
|
@ -353,18 +356,19 @@ function migrateComplianceTriggers (config) {
|
|||
|
||||
function createTrigger (
|
||||
requirement,
|
||||
threshold
|
||||
threshold,
|
||||
suspensionDays = null
|
||||
) {
|
||||
const triggerConfig = {
|
||||
id: uuid.v4(),
|
||||
direction: 'both',
|
||||
suspensionDays: null,
|
||||
suspensionDays: suspensionDays,
|
||||
threshold,
|
||||
thresholdDays: 1,
|
||||
triggerType: triggerTypes.volume,
|
||||
requirement
|
||||
}
|
||||
if (requirement === 'suspend') triggerConfig.suspensionDays = 1
|
||||
|
||||
return triggerConfig
|
||||
}
|
||||
|
||||
|
|
@ -416,7 +420,7 @@ function migrateComplianceTriggers (config) {
|
|||
}
|
||||
if (global.hardLimitVerificationActive && _.isNumber(global.hardLimitVerificationThreshold)) {
|
||||
triggers.push(
|
||||
createTrigger(requirements.suspend, global.hardLimitVerificationThreshold)
|
||||
createTrigger(requirements.suspend, global.hardLimitVerificationThreshold, suspensionDays)
|
||||
)
|
||||
}
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue