rewoking getCommissionPercentage function
This commit is contained in:
parent
03279c8d2c
commit
5815a606f2
3 changed files with 16 additions and 8 deletions
|
|
@ -17,11 +17,15 @@ function post (tx, pi) {
|
|||
}
|
||||
|
||||
function massage (tx, pi) {
|
||||
const direction = _.get('direction', tx)
|
||||
const cryptoCode = _.get('cryptoCode', tx)
|
||||
const isDateField = r => r === 'created' || _.endsWith('_time', r)
|
||||
const transformDate = (v, k) => isDateField(k) ? new Date(v) : v
|
||||
const mapValuesWithKey = _.mapValues.convert({'cap': false})
|
||||
const transformDates = r => mapValuesWithKey(transformDate, r)
|
||||
const logCommission = r => _.assign(r, {commissionPercentage: pi.getCommissionForTx(tx)})
|
||||
const logCommission = r => _.assign(r, {
|
||||
commissionPercentage: _.get(direction, pi.getCommissionPercentage(cryptoCode))
|
||||
})
|
||||
|
||||
const mapBN = r => {
|
||||
const update = r.direction === 'cashIn'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue