NewPath-Consulting / warm

Pro Reports for Wild Apricot is a Google Data Studio connector that helps Wild Apricot administrators understand your organization’s membership engagement, renewal rates, and demographics. Trend your revenue and get expense analyses. Whatever your question, enjoy all the organized data you need at your fingertips to make the business decisions want.
https://newpathconsulting.com/warm
GNU General Public License v3.0
6 stars 4 forks source link

Support the currency semantic type for all currency fields #15

Closed asirota closed 4 years ago

asirota commented 4 years ago

When adding an extra charge or currency field in the schema add the currency type to the meta data on the schema. The currently set currency is available in the /accounts endpoint in this structure:

"Currency": {
      "Code": "string",
      "Name": "string",
      "Symbol": "string"
    }

The values are encoded as followed and could be mapped to equivalent currency semantic type in GDS

Code | stringCurrency code according to [ISO4217](https://en.wikipedia.org/wiki/ISO_4217#Active_codes)
Name | stringHuman-readable currency name
Symbol | stringCurrency symbol like $ or €
miasmos commented 4 years ago

Made api token global so it's only fetched once. Currency semanticType in any schema now dynamically matches the currency code on the user's account.

asirota commented 4 years ago

@stephenpoole are currently hard-coded CURRENCY_CAD in objects like Contact now dynamically switched to the right currency type? There are several that have been hard coded and should be altered to the right system currency type. Example: { name: "Balance", label: "Balance", dataType: "NUMBER", semantics: { conceptType: "DIMENSION", semanticGroup: "CURRENCY", semanticType: "CURRENCY_CAD" }

miasmos commented 4 years ago

Even though they exist in schema, they're replaced at runtime. Could probably just remove them if it's confusing.

asirota commented 4 years ago

@stephenpoole that's ok -- it's not a problem.