diff --git a/CHANGELOG.md b/CHANGELOG.md index 719e37e22..7b21b5ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Added * Added `CreateInteraction` intent. To be used when a user wants to record an interaction into a system. New context `Interaction` also introduced. An interaction might be a call, IM, email, a meeting (physical or virtual) or the preparation of some specialist data. ([#747](https://github.com/finos/FDC3/pull/747)) -* Added `TransactionResult` context. A context type representing the result of a transaction initiated via FDC3. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object. ([#761] (https://github.com/finos/FDC3/pull/761)) - +* Added `TransactionResult` context. A context type representing the result of a transaction initiated via FDC3. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object. ([#761](https://github.com/finos/FDC3/pull/761)) +* Added `Order` (`fdc3.order`) context type representing the details of an order, which may be used to transmit a new order to a third party or share details of an existing order. ([#824](https://github.com/finos/FDC3/pull/824)) ### Changed diff --git a/docs/context/ref/Order.md b/docs/context/ref/Order.md new file mode 100644 index 000000000..1769c01ac --- /dev/null +++ b/docs/context/ref/Order.md @@ -0,0 +1,42 @@ +--- +id: Order +sidebar_label: Order +title: Order +hide_title: true +--- +# `Order` + +:::caution Experimental + +**Note:** This feature has been designated as experimental to indicate that its design may change in the future. To read more about the FDC3 experimental policy pleae visit our [Experimental Features](https://fdc3.finos.org/docs/fdc3-compliance#experimental-features) page. + +::: + +A context type representing the details of an order, which may be used to transmit a new order to a third party or share details of an existing order. + +When the intent is to create an Order in a downstream system at least one OrderLeg MUST be populated. + +When the intent is to lookup an Order in a downstream system at least one entry MUST be populated in the id field and other fields are not required. + +## Type + +`fdc3.order` + +## Schema + +https://fdc3.finos.org/scehmas/next/order.schema.json + +## Details + +| Property| Type| Required| Example +| -| -| -| - +| `id` | object | Yes | `{'OMS': '123456789'}` +| `id.OMS` | string | No | `'123456789'` +| `id.EMS` | string | No | `'EMSID1234'` +| `id.PMS` | string | No | `'PMS12345'` +| `sendingTime` | string | Yes | `'2022-03-30T15:44:44+00:00'` +| `timeInForce` | fdc3.timeRange| No | `{type: "fdc3.timeRange", startTime: "2020-09-01T08:00:00.000Z", endTime: "2020-10-31T08:00:00.000Z"}` +| `orderLegs` | fdc3.orderLeg[] | Yes | +| `notes` | String | No + + diff --git a/docs/context/ref/OrderLeg.md b/docs/context/ref/OrderLeg.md new file mode 100644 index 000000000..121000e14 --- /dev/null +++ b/docs/context/ref/OrderLeg.md @@ -0,0 +1,56 @@ +--- +id: OrderLeg +sidebar_label: OrderLeg +title: OrderLeg +hide_title: true +--- +# `OrderLeg` + +:::caution Experimental + +**Note:** This feature has been designated as experimental to indicate that its design may change in the future. To read more about the FDC3 experimental policy pleae visit our [Experimental Features](https://fdc3.finos.org/docs/fdc3-compliance#experimental-features) page. + +::: + +A context type representing the details of an individual order leg, which MAY be used as part of an Order context when creating a new Order and MAY be transmitted separately to look up details of an existing OrderLeg. + +When the OrderLeg is part of an Order context with the intent to CREATE a new Order fields MUST be populated as indicated. + +When the intent is to lookup an OrderLeg in a downstream system at least one entry MUST be populated in the id field and other fields are NOT required. + +## Type + +`fdc3.orderLeg` + +## Schema + +https://fdc3.finos.org/scehmas/next/orderLeg.schema.json + +| Property| Type| Required| Example +| -| -| -| - +| `type` | String | Yes | `fdc3.orderLeg` +| `id` | object | Yes | `{'OMS': '123456789-leg1'}` +| `product` | object | Yes | `{'instrument': {'ticker':'MSFT'}} \| {'productDefinition': '...'}` +| `product.instrument` | fdc3.Instrument | No | `{'instrument': {'ticker':'MSFT'}}` +| `product.productDefinition` | object | No | `{'productDefinition': '...'}` +| `quantity` | object | Yes | `{'units': 100000.00}` +| `quantity.units` | double | No | `1000000.00` +| `quantity.cashValue` | double | No | `5000000.00` +| `quantity.proceedsFrom` | string | No | `{'OMS': '123456789-leg2'}` +| `currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'US Dollar', id: {CURRENCY_ISOCODE: "USD"}}` +| `side` | string | Yes | `'B' \| 'S' \| 'P' \| 'R'...` +| `price` | object | Yes | `{'orderType': 'limit', 'limitPrice': 123.45}` +| `price.priceType` | string | No | `'absolute' \| 'percentage' \| 'yield' \| 'spread'...` +| `price.orderType` | string | Yes | `'limit' \| 'market' \| 'stopMarket' \| 'stopLimit'...` +| `price.limitPrice` | double | No | `1.15` +| `price.stopPrice` | double | No | `1.20` +| `settlement` | object | No | `{currency: {type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}, 'date': '2022-03-30T15:44:44+00:00'}` +| `settlement.currency` | fdc3.currency | No | `{type: 'fdc3.currency', name: 'Pound Sterling', id: {CURRENCY_ISOCODE: "GBP"}` +| `settlement.date` | string | No | `'2022-03-30T15:44:44+00:00'` +| `allocations` | object[] | No | `[{'account': 'TRADEACCOUNT1', 'quantity': 1000000.00, 'positionEffect': 'O'}]` +| `allocations[i].account` | string | Yes | `TRADEACCOUNT1` +| `allocations[i].quantity` | double | No | `1000000.00` +| `allocations[i].positionEffect` | string | No | `'O' \| 'C'` +| `partyIdentifiers` | object[] | No | `[{'role': 'executingFirm', 'id': {'LEI': '549300UO56I4KIWC0U51'}]` +| `partyIdentifiers[i].role` | string | Yes | `'executingFirm'` +| `partyIdentifiers[i].id` | string | Yes | `{'LEI': '549300UO56I4KIWC0U51'}` diff --git a/src/context/schemas.json b/src/context/schemas.json index 13e9aa447..77ba1de5f 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -11,6 +11,8 @@ "InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"], "Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"], "Nothing": ["https://fdc3.finos.org/schemas/next/nothing.schema.json"], + "Order": ["https://fdc3.finos.org/schemas/next/order.schema.json"], + "OrderLeg": ["https://fdc3.finos.org/schemas/next/orderLeg.schema.json"], "Organization": ["https://fdc3.finos.org/schemas/next/organization.schema.json"], "Portfolio": ["https://fdc3.finos.org/schemas/next/portfolio.schema.json"], "Position": ["https://fdc3.finos.org/schemas/next/position.schema.json"], diff --git a/src/context/schemas/order.schema.json b/src/context/schemas/order.schema.json new file mode 100644 index 000000000..ccbf58ad5 --- /dev/null +++ b/src/context/schemas/order.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "sendingTime": { + "type": "string" + }, + "timeInForce": { + "$ref": "timerange.schema.json#" + }, + "orderLegs": { + "type": "array", + "items": { + "$ref": "orderLeg.schema.json#" + } + }, + "notes": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/src/context/schemas/orderLeg.schema.json b/src/context/schemas/orderLeg.schema.json new file mode 100644 index 000000000..f4642eba2 --- /dev/null +++ b/src/context/schemas/orderLeg.schema.json @@ -0,0 +1,166 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderLeg.schema.json", + "type": "object", + "title": "orderLeg", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.orderLeg" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "product": { + "type": "object", + "properties": { + "oneof": { + "instrument": { + "$ref": "instrument.schema.json#" + }, + "productDefinition": { + "type": "object" + } + } + } + }, + "quantity": { + "type": "object", + "properties": { + "oneof": { + "units": { + "type": "number" + }, + "cashValue": { + "type": "number" + }, + "proceedsFrom": { + "type": "string" + } + } + } + }, + "currency": { + "$ref": "currency.schema.json#" + }, + "side": { + "type": "string", + "enum": [ + "B", + "S", + "P", + "R", + "BS", + "SS" + ] + }, + "price": { + "type": "object", + "properties": { + "orderType": { + "type": "string", + "enum": [ + "limit", + "market", + "stopMarket", + "stopLimit" + ] + }, + "limitPrice": { + "type": "number" + }, + "stopPrice": { + "type": "number" + }, + "priceType": { + "type": "string", + "enum": [ + "absolute", + "percentage", + "yield", + "spread" + ] + } + }, + "required": [ + "orderType" + ] + }, + "settlement": { + "type": "object", + "properties": { + "currency": { + "$ref": "currency.schema.json#" + }, + "date": { + "type": "string" + } + } + }, + "allocations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "positionEffect": { + "type": "string", + "enum": [ + "O", + "C" + ] + } + }, + "required": [ + "account" + ] + } + }, + "partyIdentifiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "LEI": { + "type": "string" + } + } + } + } + } + } + }, + "required": [ + "type", + "id", + "price", + "side", + "product", + "quantity" + ] +} \ No newline at end of file diff --git a/website/sidebars.json b/website/sidebars.json index c76b9a9bc..550676a93 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -72,6 +72,8 @@ "context/ref/InstrumentList", "context/ref/Interaction", "context/ref/Nothing", + "context/ref/Order", + "context/ref/OrderLeg", "context/ref/Organization", "context/ref/Portfolio", "context/ref/Position", diff --git a/website/static/schemas/next/order.schema.json b/website/static/schemas/next/order.schema.json new file mode 100644 index 000000000..ccbf58ad5 --- /dev/null +++ b/website/static/schemas/next/order.schema.json @@ -0,0 +1,44 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/order.schema.json", + "type": "object", + "title": "Order", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.order" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "sendingTime": { + "type": "string" + }, + "timeInForce": { + "$ref": "timerange.schema.json#" + }, + "orderLegs": { + "type": "array", + "items": { + "$ref": "orderLeg.schema.json#" + } + }, + "notes": { + "type": "string" + } + } +} \ No newline at end of file diff --git a/website/static/schemas/next/orderLeg.schema.json b/website/static/schemas/next/orderLeg.schema.json new file mode 100644 index 000000000..f4642eba2 --- /dev/null +++ b/website/static/schemas/next/orderLeg.schema.json @@ -0,0 +1,166 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/orderLeg.schema.json", + "type": "object", + "title": "orderLeg", + "allOf": [ + { + "$ref": "context.schema.json#" + } + ], + "properties": { + "type": { + "const": "fdc3.orderLeg" + }, + "id": { + "properties": { + "EMS": { + "type": "string" + }, + "OMS": { + "type": "string" + }, + "PMS": { + "type": "string" + } + } + }, + "product": { + "type": "object", + "properties": { + "oneof": { + "instrument": { + "$ref": "instrument.schema.json#" + }, + "productDefinition": { + "type": "object" + } + } + } + }, + "quantity": { + "type": "object", + "properties": { + "oneof": { + "units": { + "type": "number" + }, + "cashValue": { + "type": "number" + }, + "proceedsFrom": { + "type": "string" + } + } + } + }, + "currency": { + "$ref": "currency.schema.json#" + }, + "side": { + "type": "string", + "enum": [ + "B", + "S", + "P", + "R", + "BS", + "SS" + ] + }, + "price": { + "type": "object", + "properties": { + "orderType": { + "type": "string", + "enum": [ + "limit", + "market", + "stopMarket", + "stopLimit" + ] + }, + "limitPrice": { + "type": "number" + }, + "stopPrice": { + "type": "number" + }, + "priceType": { + "type": "string", + "enum": [ + "absolute", + "percentage", + "yield", + "spread" + ] + } + }, + "required": [ + "orderType" + ] + }, + "settlement": { + "type": "object", + "properties": { + "currency": { + "$ref": "currency.schema.json#" + }, + "date": { + "type": "string" + } + } + }, + "allocations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "account": { + "type": "string" + }, + "quantity": { + "type": "number" + }, + "positionEffect": { + "type": "string", + "enum": [ + "O", + "C" + ] + } + }, + "required": [ + "account" + ] + } + }, + "partyIdentifiers": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string" + }, + "id": { + "type": "object", + "properties": { + "LEI": { + "type": "string" + } + } + } + } + } + } + }, + "required": [ + "type", + "id", + "price", + "side", + "product", + "quantity" + ] +} \ No newline at end of file