Skip to content

🏗 Change API Property - currency #65

Open
@sthiepaan

Description

@sthiepaan

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 ✌️

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions