Skip to content

Commit

Permalink
Merge branch '644-context-type-order' of https://github.com/nemery-fl…
Browse files Browse the repository at this point in the history
…extrade/FDC3 into nemery-flextrade-644-context-type-order
  • Loading branch information
mistryvinay committed Mar 22, 2023
2 parents ab3660d + 342173f commit aab2b9e
Show file tree
Hide file tree
Showing 9 changed files with 524 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
42 changes: 42 additions & 0 deletions docs/context/ref/Order.md
Original file line number Diff line number Diff line change
@@ -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


56 changes: 56 additions & 0 deletions docs/context/ref/OrderLeg.md
Original file line number Diff line number Diff line change
@@ -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'}`
2 changes: 2 additions & 0 deletions src/context/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
44 changes: 44 additions & 0 deletions src/context/schemas/order.schema.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
166 changes: 166 additions & 0 deletions src/context/schemas/orderLeg.schema.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
2 changes: 2 additions & 0 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
44 changes: 44 additions & 0 deletions website/static/schemas/next/order.schema.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
Loading

0 comments on commit aab2b9e

Please sign in to comment.