Skip to content

Commit

Permalink
feature #4 - update error message and dto of get exchange rate use case
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeniosales committed Oct 16, 2022
1 parent 7a50dde commit 7d949b7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/2-business/constants/errors/exchangeRateList.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const exchangeRateNotFoundError = {
code: 'EXR-001',
message: 'Exchange Rate not found for the base',
message: 'Exchange Rate not found for the base currency',
shortMessage: 'exchangeRateNotFound'
}
2 changes: 1 addition & 1 deletion src/2-business/dto/exchangeRate/getExchangeRateInputDto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CurrencyEnum } from '../../enums/currencyEnum'

export interface GetExchangeRateInputDto {
base: CurrencyEnum
baseCurrency: CurrencyEnum
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export class GetExchangeRateUseCase {
async execute (input: GetExchangeRateInputDto): Promise<ExchangeRate> {
console.log(`${this.logPrefix} :: start`)
try {
const { base } = input
const exchangeRate: ExchangeRate = await this.exchangeRateRepository.get(base)
const { baseCurrency } = input
const exchangeRate: ExchangeRate = await this.exchangeRateRepository.get(baseCurrency)

if (!exchangeRate) {
throw new ExchangeRateError(exchangeRateNotFoundError)
Expand Down

0 comments on commit 7d949b7

Please sign in to comment.