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

add moneyLost.methodOther field to analyst report #1647

Merged
merged 3 commits into from
Mar 13, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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