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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃彈 Change API Property - currency #65

Open
sthiepaan opened this issue Oct 30, 2020 · 0 comments
Open

馃彈 Change API Property - currency #65

sthiepaan opened this issue Oct 30, 2020 · 0 comments

Comments

@sthiepaan
Copy link
Collaborator

sthiepaan commented Oct 30, 2020

Currently currency Property contains only its entity. I think that we could make change to that property so it contains more useful information. Using ISO 4217 Standard we could extend it to also have:

  • Alphabetic code - 3-letters {String} (for most cases this is a combination of ISO 3166- 1 alpha-2 and first letter of currency entity itself)
  • Numeric code - 3-letters {String}
  • Entity - currency name {String}

After changes, each Country {Object} should contain:

{
  "country": "poland",
  "capital": "warsaw",
  // CHANGES start
  "currency": {
    "code": "pln",
    "numeric": "985",
    "entity": "polish zloty",
  },
  // CHANGES end
  "native_language": ["polish"],
  "famous_for": "pierogi and potatoes",
  "phone_code": "+48",
  "flag": "https://flagpedia.net/data/flags/h80/pl.png",
  "drive_direction": "right",
  "alcohol_prohibition": "none",
  "area": {
    "km2": 312696,
    "mi2": 120733
  },
  "continent": "eu",
  "iso": {
    "numeric": "616",
    "alpha_2": "pl",
    "alpha_3": "pol"
  },
  "tld": ".pl",
  "constitutional_form": "republic",
  "language_codes": ["pl-PL"],
  "is_landlocked": false
},

Additionally to that, we chould create a new method to use that data:

  • getCountriesByCurrency(name, type)
    • type {String} is optional and by default would be currency.code
    • Returned data is Country[] (some currencies are in multiple countries)
  • 鉂楋笍This would be a breaking change since it will change existing property

Let me know what you think 鉁岋笍

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

No branches or pull requests

1 participant