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

Commit

Permalink
fix: fix eslint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkamyshev committed Jul 16, 2019
1 parent af8385a commit 574635a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions back/src/mind/application/adviser/RecurrentPaymentAdviser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ export class RecurrentPaymentAdviser implements Adviser {
GroupBy.Month,
)

const outcomes = history.map(({ outcomes }) => outcomes)
const transactions = history.map(({ outcomes }) => outcomes)

return {
thisMonth: last(outcomes),
previousMonths: dropRight(outcomes, 1),
thisMonth: last(transactions),
previousMonths: dropRight(transactions, 1),
}
}

Expand Down
10 changes: 6 additions & 4 deletions back/src/money/application/CurrencyConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,18 @@ export class CurrencyConverter {
}

private async getExistRateFromReverse(
from: Currency,
to: Currency,
originalFrom: Currency,
originalTo: Currency,
when: Date,
): Promise<number> {
const revert = ({ to, from, collectAt, rate }: ExchangeRate) =>
new ExchangeRate(to, from, collectAt, 1 / rate)

return this.getOrThrow(
this.exchangeRateRepo.find(to, from, when).then(rate => rate.map(revert)),
new ConversationFailedException(from, to, when),
this.exchangeRateRepo
.find(originalTo, originalFrom, when)
.then(rate => rate.map(revert)),
new ConversationFailedException(originalFrom, originalTo, when),
)
}

Expand Down

0 comments on commit 574635a

Please sign in to comment.