refactor: suspensionDays only on suspend triggers
This commit is contained in:
parent
ca86a70d42
commit
dd7dc68323
1 changed files with 3 additions and 4 deletions
|
|
@ -357,19 +357,18 @@ function migrateComplianceTriggers (config) {
|
||||||
function createTrigger (
|
function createTrigger (
|
||||||
requirement,
|
requirement,
|
||||||
threshold,
|
threshold,
|
||||||
suspensionDays = null
|
suspensionDays
|
||||||
) {
|
) {
|
||||||
const triggerConfig = {
|
const triggerConfig = {
|
||||||
id: uuid.v4(),
|
id: uuid.v4(),
|
||||||
direction: 'both',
|
direction: 'both',
|
||||||
suspensionDays: suspensionDays,
|
|
||||||
threshold,
|
threshold,
|
||||||
thresholdDays: 1,
|
thresholdDays: 1,
|
||||||
triggerType: triggerTypes.volume,
|
triggerType: triggerTypes.volume,
|
||||||
requirement
|
requirement
|
||||||
}
|
}
|
||||||
|
if (!requirement === 'suspend') return triggerConfig
|
||||||
return triggerConfig
|
return _.assign(triggerConfig, { suspensionDays })
|
||||||
}
|
}
|
||||||
|
|
||||||
const codes = [
|
const codes = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue