Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

592 771 context proposal TransactionResult #761

Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9f6294f
add-create-interaction-intent
milindchidrawar Jun 7, 2022
6accbc1
add-create-interaction-intent
milindchidrawar Jun 7, 2022
10f1e44
add-create-interaction-intent
milindchidrawar Jun 7, 2022
d74f407
Interaction context added
pauldyson Jun 8, 2022
6abb14d
update CreateInteraction to use origin instead of source
milindchidrawar Jun 9, 2022
1c37ad0
partial implementation of transaction results
milindchidrawar Jun 22, 2022
2213c26
Example code for TransactionResult
pauldyson Jun 22, 2022
c05af21
complete implementation of transaction result
milindchidrawar Jun 22, 2022
c1a30b8
update transaction result based on feedback
milindchidrawar Jul 6, 2022
003fb7d
resolve alphabetical sorting for create interaction
milindchidrawar Aug 3, 2022
0db3dfa
updated transactionresult schema and context description
milindchidrawar Aug 3, 2022
453f61d
Merge branch 'master' into 592-intent-proposal-create-transaction-result
milindchidrawar Aug 4, 2022
aca7d8b
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Aug 4, 2022
76d57a5
resolve alphabetical sort
milindchidrawar Aug 4, 2022
48f0de0
transaction result context field should be of type Context
milindchidrawar Aug 4, 2022
af6ccfb
update transaction result description
milindchidrawar Aug 4, 2022
b601840
Adjusting definition of TransactionResult
kriswest Sep 1, 2022
5b0ccbf
Adding note about intents that return data and TransactionResult to I…
kriswest Sep 1, 2022
c5fc7cf
Merge pull request #8 from kriswest/592-create-transaction-result-KW-…
milindchidrawar Sep 22, 2022
bc8b160
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Sep 22, 2022
6178a3e
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Oct 18, 2022
3d27bbc
updates to context and intent descriptions and cleanup ContextTypes.ts
milindchidrawar Oct 18, 2022
ff18e75
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Oct 27, 2022
849d350
include an example transactionresult for create interaction with an id
milindchidrawar Oct 27, 2022
d77fc27
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Nov 1, 2022
2799e39
support new id types for interaction
milindchidrawar Nov 1, 2022
f1aec8a
full upper case for sourced id types
milindchidrawar Nov 1, 2022
70e83a8
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
0b898eb
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
2054efb
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
2b27c99
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
5a2246c
Update docs/context/ref/Interaction.md
milindchidrawar Nov 22, 2022
a7a0631
Update docs/intents/ref/CreateInteraction.md
milindchidrawar Nov 22, 2022
c43c6a0
Update src/context/schemas/interaction.schema.json
milindchidrawar Nov 22, 2022
f34e5fa
Merge branch 'finos:master' into 592-intent-proposal-create-transacti…
milindchidrawar Nov 22, 2022
9d8d14a
added change log item and updated incorrect contacts label. removed l…
milindchidrawar Nov 22, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/context/ref/Contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Intents
- [ViewResearch](../../intents/ref/ViewResearch)
- [ViewInteractions](../../intents/ref/ViewInteractions)
- [ViewOrders](../../intents/ref/ViewOrders)
- [CreateInteraction](../../intents/ref/CreateInteraction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alpha sort or rebase PR so this change isn't in here. If you've fixed in the other PR you can merge it into this to bring across - although we prefer clean PRs based off master (rather than branches used in other PRs)


FINOS Financial Objects
- [Contact](https://fo.finos.org/docs/objects/contact)
1 change: 1 addition & 0 deletions docs/context/ref/ContactList.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ Other Types
Intents
- [StartChat](../../intents/ref/StartChat)
- [StartCall](../../intents/ref/StartCall)
- [CreateInteraction](../../intents/ref/CreateInteraction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alpha sort or rebase PR so this change isn't in here. If you've fixed in the other PR you can merge it into this to bring across - although we prefer clean PRs based off master (rather than branches used in other PRs)


FINOS Financial Objects
- [ContactList](https://fo.finos.org/docs/objects/contactlist)
87 changes: 87 additions & 0 deletions docs/context/ref/Interaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
id: Interaction
sidebar_label: Interaction
title: Interaction
hide_title: true
---
# `Interaction`

An interaction is a significant direct exchange of ideas or information between a Sell Side party and one or more Buy Side parties. An interaction might be a call, a meeting (physical or virtual), an IM or the preparation of some specialist data.

Notes:

- interactionType SHOULD be one of 'Instant Message', 'Email', 'Call', or 'Meeting' although other values can be provided
- origin indicates the application or service that the interaction was created from to aid in tracing the source of the interaction

## Type

`fdc3.interaction`

## Schema

https://fdc3.finos.org/schemas/next/interaction.schema.json

## Details

| Property | Type | Required | Example Value |
|-------------|---------|----------|---------------------|
| `type` | string | Yes | `fdc3.interaction` |
| `participants` | fdc3.contactList | Yes | See below |
| `timeRange` | fdc3.timeRange | Yes | See below |
| `interactionType` | string | Yes | `Instant Message` |
| `description` | string | Yes | `Blah, blah, blah` |
| `initiator` | fdc3.contact | No | See below |
| `origin` | string | No | `Outlook` |

## Example

```js
const interaction = {
type: 'fdc3.interaction',
participants: {
type: 'fdc3.contactList',
contacts: [
{
type: 'fdc3.contact',
name: 'Jane Doe',
id: {
email: 'jane.doe@mail.com'
}
},
{
type: 'fdc3.contact',
name: 'John Doe',
id: {
email: 'john.doe@mail.com'
}
},
]
},
interactionType: 'Instant Message',
timeRange: {
type: 'fdc3.timeRange',
startTime: '2022-02-10T15:12:00Z'
},
description: 'Laboris libero dapibus fames elit adipisicing eu, fermentum, dignissimos laboriosam, erat, risus qui deserunt. Praesentium! Reiciendis. Hic harum nostrud, harum potenti amet? Mauris. Pretium aliquid animi, eget eiusmod integer proident. Architecto ipsum blandit ducimus, possimus illum sunt illum necessitatibus ab litora sed, nonummy integer minus corrupti ducimus iste senectus accumsan, fugiat nostrud? Pede vero dictumst excepturi, iure earum consequuntur voluptatum',
initiator: {
type: 'fdc3.contact',
name: 'Jane Doe',
id: {
email: 'jane.doe@mail.com'
}
},
origin: 'Outlook'
}

fdc3.raiseIntent('CreateInteraction', interaction)
```

## See Also

Other Types
- [Contact](Contact)
- [ContactList](ContactList)
- [TimeRange](TimeRange)
milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions docs/context/ref/TimeRange.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,6 @@ const timeRange = {
Other Types

- [Chart](Chart)

Intents
- [CreateInteraction](../../intents/ref/CreateInteraction)
59 changes: 59 additions & 0 deletions docs/context/ref/TransactionResult.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
id: TransactionResult
sidebar_label: TransactionResult
title: TransactionResult
hide_title: true
---
# `TransactionResult`

The result of any given create, update or delete intent.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets discuss this description (and other docs required) at next meeting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neither @pauldyson or I are available to join tomorrow's context and intents discussion meeting I'm afraid.

I'm out on annual leave from tomorrow but if you could share your feedback on the description, I will take a look on my return (22nd July). Thanks

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heres a start on a deeper description. We'll also need to add something to the Intents overview doc describing the same. I'd suggest adding a new section at the bottom of https://fdc3.finos.org/docs/next/intents/spec for now, called something like:

Returning a status For transactional Intents

Suggested change
The result of any given create, update or delete intent.
`TransactionResult` is intended to be returned as an [`IntentResult`](../../api/Types#intentresult) by intents that create, retrieve, update or delete content or records in another application. Its purpose is to provide a status and message (where needed) for the transaction and MAY wrap a returned context object.


## Type

`fdc3.transactionResult`

## Schema

https://fdc3.finos.org/schemas/next/transactionresult.schema.json

## Details

| Property | Type | Required | Example Value |
|-------------|---------|----------|-------------------|
| `type` | Context | Yes | See Below |
| `status` | string | Yes | `'Updated'` |
| `context` | string | Yes | See Below |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type should be Context, which will allow any other FDC3 context to be wrapped

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been updated now

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not seeing the change... however the type filed is now Context... will add a suggestion to correct both

Copy link
Contributor

@kriswest kriswest Jul 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `type` | Context | Yes | See Below |
| `status` | string | Yes | `'Updated'` |
| `context` | string | Yes | See Below |
| `type` | string | Yes | 'fdc3.transactionResult' |
| `status` | string | Yes | `'Updated'` |
| `context` | Context | Yes | See Below |

| `message` | string | No | See Below |

## Example

```js
const contact = {
type: "fdc3.contact",
name: "Jane Doe",
id: {
email: "jane.doe@mail.com"
}
}

const resolution = await window.fdc3.raiseIntent('CreateOrUpdateProfile', contact);
const result = await resolution.getResult();
console.log(JSON.stringify(result));
```

Console log will display:

```json
{
"type": "fdc3.transactionResult",
"status": "Updated",
"context": {
"type": "fdc3.contact",
"name": "Jane Doe",
"id": {
"email": "jane.doe@mail.com"
}
},
"message": "record with id jane.doe@mail.com was updated"
}
```
2 changes: 2 additions & 0 deletions docs/context/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,15 @@ The following are standard FDC3 context types:
- [`fdc3.country`](ref/Country) ([schema](/schemas/next/country.schema.json))
- [`fdc3.currency`](ref/Currency) ([schema](/schemas/next/currency.schema.json))
- [`fdc3.email`](ref/Email) ([schema](/schemas/next/email.schema.json))
- [`fdc3.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.schema.json))
- [`fdc3.instrument`](ref/Instrument) ([schema](/schemas/next/instrument.schema.json))
- [`fdc3.instrumentList`](ref/InstrumentList) ([schema](/schemas/next/instrumentList.schema.json))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move after the fdc3.instrument* types

Suggested change
- [`fdc3.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.schema.json))
- [`fdc3.instrument`](ref/Instrument) ([schema](/schemas/next/instrument.schema.json))
- [`fdc3.instrumentList`](ref/InstrumentList) ([schema](/schemas/next/instrumentList.schema.json))
- [`fdc3.instrument`](ref/Instrument) ([schema](/schemas/next/instrument.schema.json))
- [`fdc3.instrumentList`](ref/InstrumentList) ([schema](/schemas/next/instrumentList.schema.json))
- [`fdc3.interaction`](ref/Interaction) ([schema](/schemas/next/interaction.schema.json))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather do so in PR #747 - added suggestion there

- [`fdc3.organization`](ref/Organization) ([schema](/schemas/next/organization.schema.json))
- [`fdc3.portfolio`](ref/Portfolio) ([schema](/schemas/next/portfolio.schema.json))
- [`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.
Expand Down
69 changes: 69 additions & 0 deletions docs/intents/ref/CreateInteraction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
id: CreateInteraction
sidebar_label: CreateInteraction
title: CreateInteraction
hide_title: true
---
# `CreateInteraction`

Create an interaction with a list of contacts.

## Intent Name

`CreateInteraction`

## Display Name

`Create Interaction`

## Possible Contexts

* [ContactList](../../context/ref/ContactList)
kriswest marked this conversation as resolved.
Show resolved Hide resolved

## Example

```js
const interaction = {
type: 'fdc3.interaction',
contacts: {
type: 'fdc3.contactList',
contacts: [
{
type: 'fdc3.contact',
name: 'Jane Doe',
id: {
email: 'jane.doe@mail.com'
}
},
{
type: 'fdc3.contact',
name: 'John Doe',
id: {
email: 'john.doe@mail.com'
}
},
]
},
interactionType: 'Instant Message',
timeRange: {
type: 'fdc3.timeRange',
startTime: '2022-02-10T15:12:00Z'
},
description: 'Laboris libero dapibus fames elit adipisicing eu, fermentum, dignissimos laboriosam, erat, risus qui deserunt. Praesentium! Reiciendis. Hic harum nostrud, harum potenti amet? Mauris. Pretium aliquid animi, eget eiusmod integer proident. Architecto ipsum blandit ducimus, possimus illum sunt illum necessitatibus ab litora sed, nonummy integer minus corrupti ducimus iste senectus accumsan, fugiat nostrud? Pede vero dictumst excepturi, iure earum consequuntur voluptatum',
initiator: {
type: 'fdc3.contact',
name: 'Jane Doe',
id: {
email: 'jane.doe@mail.com'
}
},
origin: 'Outlook'
}

fdc3.raiseIntent('CreateInteraction', interaction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to see this example show the returned TransactionResult context

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps with a wrapped Interaction object that now contains an ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kriswest I've just submitted another change that includes an example TransactionResult for CreateInteraction.

The Interaction context didn't have an id property and so I've introduced one. This should allow a system that creates an interaction to return an id as part of the TransactionResult.

This change is pending internal review, but please feel free to take a look and let me know what you think.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @kriswest - after going through this with @pauldyson, I've updated Interaction.md to support application specific identifiers (e.g.- id.SINGLETRACK, id.SALESFORCE).

The example TransactionResult in CreateInteraction.md uses a Singletrack ID.

I've also added 'id.URI' so that an application can pass a link to an interaction record. Although Singletrack automatically opens its interaction logger when an interaction is created, other applications may not. Returning a URI would give an originating application the flexibility to open the created record.

Happy to discuss further on this Thursday's call.

milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved
```

## See Also

Context
- [Interaction](../../context/ref/Interaction)
milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions docs/intents/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ A list of standardized intents are defined in the following pages:
* [`ViewProfile`](ref/ViewProfile)
* [`ViewQuote`](ref/ViewQuote)
* [`ViewResearch`](ref/ViewResearch)
* [`CreateInteraction`](ref/CreateInteraction)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetical order pls


### Deprecated Intents

Expand Down
2 changes: 2 additions & 0 deletions src/context/ContextType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export enum ContextTypes {
Country = 'fdc3.country',
Currency = 'fdc3.currency',
Email = 'fdc3.email',
Interaction = 'fdc3.interaction',
Instrument = 'fdc3.instrument',
InstrumentList = 'fdc3.instrumentList',
Organization = 'fdc3.organization',
Portfolio = 'fdc3.portfolio',
Position = 'fdc3.position',
Nothing = 'fdc3.nothing',
TimeRange = 'fdc3.timerange',
TransactionResult = 'fdc3.transactionResult',
kriswest marked this conversation as resolved.
Show resolved Hide resolved
Valuation = 'fdc3.valuation',
}

Expand Down
18 changes: 18 additions & 0 deletions src/context/ContextTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ export interface Email {
richTextBody?: object;
}

export interface Interaction {
kriswest marked this conversation as resolved.
Show resolved Hide resolved
id?: { [key: string]: string };
type: string;
participants: ContactList;
timeRange: TimeRange;
interactionType: ("Instant Message" | "Email" | "Call" | "Meeting") | string;
description: string;
initiator?: Contact;
origin?: string;
}

export interface InstrumentList {
instruments: Instrument[];
type: string;
Expand Down Expand Up @@ -115,6 +126,13 @@ export interface Nothing {
type: string;
}

export interface TransactionResult {
status: ("Created" | "Deleted" | "Updated" | "Failed") | string;
type: string;
context: Context;
message: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional fields...

Suggested change
context: Context;
message: string;
context?: Context;
message?: string;

}

// Converts JSON strings to/from your types
// and asserts the results of JSON.parse at runtime
export class Convert {
Expand Down
2 changes: 2 additions & 0 deletions src/context/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"],
"Currency": ["https://fdc3.finos.org/schemas/next/currency.schema.json"],
"Email": ["https://fdc3.finos.org/schemas/next/email.schema.json"],
"Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"],
"Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"],
"InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"],
"Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"],
"InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"],
"Instrument": ["https://fdc3.finos.org/schemas/next/instrument.schema.json"],
"InstrumentList": ["https://fdc3.finos.org/schemas/next/instrumentList.schema.json"],
"Interaction": ["https://fdc3.finos.org/schemas/next/interaction.schema.json"],

"Country": ["https://fdc3.finos.org/schemas/next/country.schema.json"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste error? This is already on line 7

Expand All @@ -17,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"]
}
37 changes: 37 additions & 0 deletions src/context/schemas/interaction.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://fdc3.finos.org/schemas/next/interaction.schema.json",
"type": "object",
"title": "Interaction",
"allOf": [{ "$ref": "context.schema.json#" }],
"properties": {
"type": { "const": "fdc3.interaction" },
"participants": {
"$ref": "contactList.schema.json#"
},
"timeRange": {
"$ref": "timerange.schema.json#"
},
"interactionType": {
"anyOf": [
{
"type": "string",
"enum": ["Instant Message", "Email", "Call", "Meeting"]
},
{
"type": "string"
}
]
},
"description": {
"type": "string"
},
"initiator": {
"$ref": "contact.schema.json#"
},
"origin": {
"type": "string"
}
},
"required": ["contacts", "timeRange", "interactionType", "description"]
milindchidrawar marked this conversation as resolved.
Show resolved Hide resolved
}
26 changes: 26 additions & 0 deletions src/context/schemas/transactionresult.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$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", "Failed"]
},
{
"type": "string"
}
]
},
"context": { "$ref": "context.schema.json#" }
kriswest marked this conversation as resolved.
Show resolved Hide resolved
},
"message": {
"type": "string"
},
"required": ["status", "context"]
}
Loading