From c05af21e7f860069151c8d72562eae39c4600a67 Mon Sep 17 00:00:00 2001 From: Milind Chidrawar Date: Wed, 22 Jun 2022 14:56:52 +0100 Subject: [PATCH] complete implementation of transaction result --- docs/context/spec.md | 1 + src/context/ContextType.ts | 1 + src/context/schemas.json | 1 + .../schemas/transactionresult.schema.json | 23 +++++++++++++++++++ website/sidebars.json | 1 + 5 files changed, 27 insertions(+) create mode 100644 src/context/schemas/transactionresult.schema.json diff --git a/docs/context/spec.md b/docs/context/spec.md index 146fa432e..36e4f8661 100644 --- a/docs/context/spec.md +++ b/docs/context/spec.md @@ -154,6 +154,7 @@ The following are standard FDC3 context types: - [`fdc3.position`](ref/Position) ([schema](/schemas/next/position.schema.json)) - [`fdc3.nothing`](ref/Nothing) ([schema](/schemas/next/nothing.schema.json)) - [`fdc3.timerange`](ref/TimeRange) ([schema](/schemas/next/timerange.schema.json)) +- [`fdc3.transactionResult`](ref/TransactionResult) ([schema](/schemas/next/transactionresult.schema.json)) - [`fdc3.valuation`](ref/Valuation) ([schema](/schemas/next/valuation.schema.json)) __Note:__ The below examples show how the base context data interface can be used to define specific context data objects. diff --git a/src/context/ContextType.ts b/src/context/ContextType.ts index 5f31fb843..1dacede66 100644 --- a/src/context/ContextType.ts +++ b/src/context/ContextType.ts @@ -13,6 +13,7 @@ export enum ContextTypes { Position = 'fdc3.position', Nothing = 'fdc3.nothing', TimeRange = 'fdc3.timerange', + TransactionResult = 'fdc3.transactionResult', Valuation = 'fdc3.valuation', } diff --git a/src/context/schemas.json b/src/context/schemas.json index 6288341b8..021142591 100644 --- a/src/context/schemas.json +++ b/src/context/schemas.json @@ -18,5 +18,6 @@ "Position": ["https://fdc3.finos.org/schemas/next/position.schema.json"], "Nothing": ["https://fdc3.finos.org/schemas/next/nothing.schema.json"], "TimeRange": ["https://fdc3.finos.org/schemas/next/timerange.schema.json"], + "TransactionResult": ["https://fdc3.finos.org/schemas/next/transactionresult.schema.json"], "Valuation": ["https://fdc3.finos.org/schemas/next/valuation.schema.json"] } diff --git a/src/context/schemas/transactionresult.schema.json b/src/context/schemas/transactionresult.schema.json new file mode 100644 index 000000000..06a4821cc --- /dev/null +++ b/src/context/schemas/transactionresult.schema.json @@ -0,0 +1,23 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://fdc3.finos.org/schemas/next/transactionresult.schema.json", + "type": "object", + "title": "TransactionResult", + "allOf": [{ "$ref": "context.schema.json#" }], + "properties": { + "type": { "const": "fdc3.transactionResult" }, + "status": { + "anyOf": [ + { + "type": "string", + "enum": ["Created", "Deleted", "Updated"] + }, + { + "type": "string" + } + ] + }, + "context": { "$ref": "context.schema.json#" } + }, + "required": ["status", "context"] +} diff --git a/website/sidebars.json b/website/sidebars.json index 38ac9b792..90b3f53a4 100644 --- a/website/sidebars.json +++ b/website/sidebars.json @@ -78,6 +78,7 @@ "context/ref/Portfolio", "context/ref/Position", "context/ref/TimeRange", + "context/ref/TransactionResult", "context/ref/Valuation" ] }