Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Important Refactor for return default object for both services of Lib #36

Merged
merged 4 commits into from
Sep 25, 2024

Conversation

IvanildoBarauna
Copy link
Member

@IvanildoBarauna IvanildoBarauna commented Sep 24, 2024

Feature History

  • This Pull Request implement the important change in the lib, because now the value returned of get_last_quote method and get_history_quote method are the same object of better development experience.
  • Any bugs fixes
  • Now, you can call the one currency_pair using string, the lists are necessary only in case of two or more currency_pairs

what was it like?

Issue -> #18

how was it?

  • For last_quote method using one currency_code pair
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1727201744,
      "bid_price":"5.4579",
      "ask_price":"5.4589",
      "quote_extracted_at":1727201753
   }
]
  • For hist_quote method using one currency_code pair
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1719440767,
      "bid_price":5.524,
      "ask_price":5.5245,
      "quote_extracted_at":1727201753
   }
]
  • For last_quote method using two or more currency_code pair
[
   {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1727201384,
      "bid_price":"5.4594",
      "ask_price":"5.4599",
      "quote_extracted_at":1727201387
   },
   {
      "currency_pair":"USD-EUR",
      "currency_pair_name":"Dólar Americano/Euro",
      "base_currency_code":"USD",
      "quote_currency_code":"EUR",
      "quote_timestamp":1727201376,
      "bid_price":"0.8957",
      "ask_price":"0.8958",
      "quote_extracted_at":1727201387
   }
]
  • For hist_quote method using two or more currency_code pair
[
    {
      "currency_pair":"USD-BRL",
      "currency_pair_name":"Dólar Americano/Real Brasileiro",
      "base_currency_code":"USD",
      "quote_currency_code":"BRL",
      "quote_timestamp":1719440767,
      "bid_price":5.524,
      "ask_price":5.5245,
      "quote_extracted_at":1727201387
   },
   {
      "currency_pair":"USD-EUR",
      "currency_pair_name":"Dólar Americano/Euro",
      "base_currency_code":"USD",
      "quote_currency_code":"EUR",
      "quote_timestamp":1719446348,
      "bid_price":0.9363,
      "ask_price":0.9364,
      "quote_extracted_at":1727201387
   }
]

Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 98.63014% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.91%. Comparing base (15a373a) to head (6deb8f2).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...c/currency_quote/adapters/outbound/currency_api.py 90.47% 2 Missing ⚠️
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
+ Coverage   94.73%   95.91%   +1.17%     
==========================================
  Files          18       18              
  Lines         209      269      +60     
==========================================
+ Hits          198      258      +60     
  Misses         11       11              
Files with missing lines Coverage Δ
.../currency_quote/adapters/inbound/lib_controller.py 100.00% <100.00%> (ø)
..._quote/adapters/outbound/currency_validator_api.py 100.00% <100.00%> (ø)
.../application/ports/outbound/currency_repository.py 76.92% <100.00%> (+4.19%) ⬆️
...pplication/use_cases/get_history_currency_quote.py 100.00% <100.00%> (ø)
...e/application/use_cases/get_last_currency_quote.py 100.00% <100.00%> (ø)
...y_quote/application/use_cases/validate_currency.py 100.00% <100.00%> (ø)
src/currency_quote/domain/entities/currency.py 100.00% <100.00%> (ø)
...rrency_quote/domain/services/get_currency_quote.py 100.00% <100.00%> (ø)
...urrency_quote/domain/services/validate_currency.py 93.33% <100.00%> (-6.67%) ⬇️
src/tests/test_currency.py 100.00% <100.00%> (ø)
... and 4 more

@IvanildoBarauna IvanildoBarauna merged commit 719731a into main Sep 25, 2024
3 checks passed
@IvanildoBarauna IvanildoBarauna deleted the feature/DevelopmentDataClassForDefaultReturns branch September 25, 2024 01:21
@IvanildoBarauna IvanildoBarauna linked an issue Sep 25, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create default return for last and history quote - Separete responsability Validd Params <> Valid Currency
1 participant