Skip to content

Commit

Permalink
Merge pull request #708 from finos/651-currency-context
Browse files Browse the repository at this point in the history
651 adding a context representing a Currency: fdc3.currency
  • Loading branch information
kriswest authored May 20, 2022
2 parents 8b30b9e + 0471f5c commit 9b627f6
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
38 changes: 38 additions & 0 deletions docs/context/ref/Currency.md
Original file line number Diff line number Diff line change
@@ -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"
}
```
1 change: 1 addition & 0 deletions src/context/ContextType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions src/context/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
13 changes: 13 additions & 0 deletions src/context/schemas/currency.schema.json
Original file line number Diff line number Diff line change
@@ -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"]
}
1 change: 1 addition & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions website/static/schemas/next/currency.schema.json
Original file line number Diff line number Diff line change
@@ -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"]
}

0 comments on commit 9b627f6

Please sign in to comment.