Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
add moneyLost.methodOther field to analyst report (#1647)
Browse files Browse the repository at this point in the history
  • Loading branch information
sastels authored Mar 13, 2020
1 parent 407146d commit 3087d4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion f2/src/utils/formatAnalystEmail.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,16 @@ const formatSuspectDetails = data => {
}

const formatFinancialTransactions = data => {
const paymentString = data.moneyLost.methodPayment
const methods =
data.moneyLost.methodOther && data.moneyLost.methodOther.length > 0
? data.moneyLost.methodPayment.concat([data.moneyLost.methodOther])
: data.moneyLost.methodPayment

const paymentString = methods
.filter(method => method !== 'methodPayment.other')
.map(method => method.replace('methodPayment.', ''))
.join(', ')

const transactionDate = formatDate(
data.moneyLost.transactionDay,
data.moneyLost.transactionMonth,
Expand All @@ -177,6 +184,7 @@ const formatFinancialTransactions = data => {
formatLine('Method of payment: ', paymentString) +
formatLine('Transaction date: ', transactionDate)

delete data.moneyLost.methodOther
delete data.moneyLost.methodPayment
delete data.moneyLost.demandedMoney
delete data.moneyLost.moneyTaken
Expand Down

0 comments on commit 3087d4d

Please sign in to comment.