diff --git a/CHANGELOG.md b/CHANGELOG.md index ed1354d4a..5bf9bb482 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). * Added a new experimental features policy, which exempts features designated as experimental from the versioning and deprecation policies, to the FDC3 compliance page ([#549](https://github.com/finos/FDC3/pull/549)) * Add `IntentDeliveryFailed` to the `ResolveError` enumeration to be used when delivery of an intent and context to a targetted app or instance fails. ([#601](https://github.com/finos/FDC3/pull/601)) * Added a context type representing a range of time (`fdc3.timerange`). ([#706](https://github.com/finos/FDC3/pull/706)) +* Added a context type representing a Currency. ([#708](https://github.com/finos/FDC3/pull/708)) * Addition of `ViewProfile` and deprecation of `ViewContact`. Changes based on ([#619](https://github.com/finos/FDC3/pull/619)) * Added a new context type `ChatInitSettings` to initialize a chat creation with new optional parameters ([#620](https://github.com/finos/FDC3/pull/620)) * Added a `ViewResearch` Intent to be used when a user wants to see the latest research on a particular stock ([#623](https://github.com/finos/FDC3/pull/623)) diff --git a/docs/context/ref/Currency.md b/docs/context/ref/Currency.md new file mode 100644 index 000000000..8760d12c6 --- /dev/null +++ b/docs/context/ref/Currency.md @@ -0,0 +1,38 @@ +--- +id: Currency +sidebar_label: Currency +title: Currency +hide_title: true +--- + +# `Currency` + +A context representing an individual Currency. + +## Type + +`fdc3.currency` + +## Schema + +https://fdc3.finos.org/schemas/next/currency.schema.json + +## Details + +| Property | Type | Required | Example Value | +|----------------------|---------|----------|-------------------| +| `type` | string | Yes | `'fdc3.currency'` | +| `name` | string | No | `'US Dollar'` | +| `CURRENCY_ISOCODE` * | string | Yes | `'USD'` | + +\* The `CURRENCY_ISOCODE` should conform to 3 character alphabetic codes defined in [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html). + +## Example + +```js +const currency = { + type: 'fdc3.currency', + name: 'US Dollar', + CURRENCY_ISOCODE: "USD" +} +``` diff --git a/src/context/ContextType.ts b/src/context/ContextType.ts index 55e22cd54..b794e29aa 100644 --- a/src/context/ContextType.ts +++ b/src/context/ContextType.ts @@ -2,6 +2,7 @@ export enum ContextTypes { Contact = 'fdc3.contact', ContactList = 'fdc3.contactList', Country = 'fdc3.country', + Currency = 'fdc3.currency', Instrument = 'fdc3.instrument', InstrumentList = 'fdc3.instrumentList', Organization = 'fdc3.organization', diff --git a/src/context/schemas.json b/src/context/schemas.json index 453e0b939..4e70ca928 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -5,6 +5,7 @@ "Context": ["https://fdc3.finos.org/schemas/next/context.schema.json"], "Contact": ["https://fdc3.finos.org/schemas/next/contact.schema.json"], "ContactList": ["https://fdc3.finos.org/schemas/next/contactList.schema.json"], + "Currency": ["https://fdc3.finos.org/schemas/next/currency.schema.json"], "Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"], "InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"], "Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"], diff --git a/src/context/schemas/currency.schema.json b/src/context/schemas/currency.schema.json new file mode 100644 index 000000000..286bcb62a --- /dev/null +++ b/src/context/schemas/currency.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/currency.schema.json", + "type": "object", + "title": "Currency", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.currency" }, + "name": { "type": "string" }, + "CURRENCY_ISOCODE": { "type": "string", "pattern": "^[A-Z]{3}$"} + }, + "required": ["CURRENCY_ISOCODE"] +} diff --git a/website/sidebars.json b/website/sidebars.json index b44f66683..4d269a218 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -62,6 +62,7 @@ "context/ref/Contact", "context/ref/ContactList", "context/ref/Country", + "context/ref/Currency", "context/ref/Instrument", "context/ref/InstrumentList", "context/ref/Nothing", diff --git a/website/static/schemas/next/currency.schema.json b/website/static/schemas/next/currency.schema.json new file mode 100644 index 000000000..286bcb62a --- /dev/null +++ b/website/static/schemas/next/currency.schema.json @@ -0,0 +1,13 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/currency.schema.json", + "type": "object", + "title": "Currency", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.currency" }, + "name": { "type": "string" }, + "CURRENCY_ISOCODE": { "type": "string", "pattern": "^[A-Z]{3}$"} + }, + "required": ["CURRENCY_ISOCODE"] +}