Skip to content

Commit

Permalink
fix: requirements order
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelTaranto committed Oct 8, 2024
1 parent e9314b6 commit ba53046
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/brain.js
Original file line number Diff line number Diff line change
Expand Up @@ -2556,7 +2556,9 @@ Brain.prototype.requiredTiers = function requiredTiers (triggers, history, trigg

// Custom trigger is identified by its uuid and should be pushed to last
const orderedWithRequired = [].concat(requiredAuth, ORDERED_REQUIREMENTS)
const requiredTiers = _.sortBy(name => uuid4Validate(name) ? Infinity : _.indexOf(name, orderedWithRequired))(unorderedTiers)
const requiredTiers = _.sortBy(name => {
return _.indexOf(uuid4Validate(name) ? REQUIREMENTS.CUSTOM : name, orderedWithRequired)
})(unorderedTiers)

this.requirementAmountTriggered = getLowestAmountPerRequirement(triggeredFormatted)
return requiredTiers
Expand Down
1 change: 1 addition & 0 deletions lib/compliance/triggers/consts.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const ORDERED_REQUIREMENTS = [
REQUIREMENTS.SUSPEND,
REQUIREMENTS.BLOCK,
REQUIREMENTS.US_SSN,
REQUIREMENTS.CUSTOM,
REQUIREMENTS.EXTERNAL
]

Expand Down

0 comments on commit ba53046

Please sign in to comment.