fix: soft rework Customers pages

This commit is contained in:
Taranto 2020-08-07 18:56:31 +01:00 committed by Josh Harvey
parent 246f736fa8
commit b853f366f1
27 changed files with 658 additions and 306 deletions

View file

@ -1,7 +1,7 @@
const _ = require('lodash/fp')
function getBackwardsCompatibleTriggers (triggers) {
const filtered = _.filter(_.matches({ triggerType: 'amount', cashDirection: 'both' }))(triggers)
const filtered = _.filter(_.matches({ triggerType: 'txAmount', cashDirection: 'both' }))(triggers)
const grouped = _.groupBy(_.prop('requirement'))(filtered)
return _.mapValues(_.compose(_.get('threshold'), _.minBy('threshold')))(grouped)
}