Skip to content

Commit

Permalink
Merge pull request #1359 from finos/591-CreateOrUpdateProfile
Browse files Browse the repository at this point in the history
591 - Adding CreateOrUpdateProfile intent
  • Loading branch information
kriswest authored Oct 14, 2024
2 parents fffcb33 + 83c5ecc commit 594224d
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 37 deletions.
6 changes: 3 additions & 3 deletions docs/intents/ref/CreateInteraction.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ Create a record documenting an interaction (calls, meetings, etc.) between a lis

## Possible Contexts

* [ContactList](../../context/ref/ContactList)
* [Interaction](../../context/ref/Interaction)
- [ContactList](../../context/ref/ContactList)
- [Interaction](../../context/ref/Interaction)

SHOULD return context as a result:

* [TransactionResult](../../context/ref/TransactionResult)
- [TransactionResult](../../context/ref/TransactionResult)

## Example

Expand Down
69 changes: 69 additions & 0 deletions docs/intents/ref/CreateOrUpdateProfile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
id: CreateOrUpdateProfile
sidebar_label: CreateOrUpdateProfile
title: CreateOrUpdateProfile
hide_title: true
---
# `CreateOrUpdateProfile`

Create a record or update an existing profile record with information for the individual or organization provided as context.

## Intent Name

`CreateOrUpdateProfile`

## Display Name

`Create or Update Profile`

## Possible Contexts

- [Contact](../../context/ref/Contact)
- [Organization](../../context/ref/Organization)

SHOULD return context as a result:

- [TransactionResult](../../context/ref/TransactionResult)

## Example

```js
const organization = {
"type": "fdc3.organization",
"name": "Cargill, Incorporated",
"id": {
"LEI": "QXZYQNMR4JZ5RIRN4T31",
"FDS_ID": "00161G-E"
}
};

const intentResolution = await fdc3.raiseIntent('CreateOrUpdateProfile', organization);
const result = await intentResolution.getResult();
console.log(result);
```

Console log might display:

```js
{
type: 'fdc3.transactionResult',
status: 'Created',
context: {
"type": "fdc3.organization",
"name": "Cargill, Incorporated",
"id": {
"LEI": "QXZYQNMR4JZ5RIRN4T31",
"FDS_ID": "00161G-E",
"internalId": "al983020303a_23"
}
},
message: 'record with id "al983020303a_23" was created'
}
```

## See Also

- [ViewProfile](../../intents/ref/ViewProfile)
- [Contact](../../context/ref/Contact)
- [Organization](../../context/ref/Organisation)
- [TransactionResult](../../context/ref/TransactionResult)
8 changes: 4 additions & 4 deletions docs/intents/ref/SendChatMessage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Send a message to an existing chat room.

## Possible Contexts

* [ChatMessage](../../context/ref/ChatMessage)
- [ChatMessage](../../context/ref/ChatMessage)

## Example

Expand Down Expand Up @@ -59,6 +59,6 @@ Context
- [ChatRoom](../../context/ref/ChatRoom)

Intents
* [StartChat](StartChat)
* [StartCall](StartCall)
* [StartEmail](StartEmail)
- [StartChat](StartChat)
- [StartCall](StartCall)
- [StartEmail](StartEmail)
20 changes: 10 additions & 10 deletions docs/intents/ref/ViewChat.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ Open an existing chat room.

## Possible Contexts

* [ChatRoom](../../context/ref/ChatRoom)
* [Contact](../../context/ref/Contact): It will open the **direct** chat where there is the current user and the contact
* [ContactList](../../context/ref/ContactList): It will open the **room** where there is the current user and the listed contacts. Contact List may need to display search results if there are multiple matches.
- [ChatRoom](../../context/ref/ChatRoom)
- [Contact](../../context/ref/Contact): It will open the **direct** chat where there is the current user and the contact
- [ContactList](../../context/ref/ContactList): It will open the **room** where there is the current user and the listed contacts. Contact List may need to display search results if there are multiple matches.

## Output

This intent returns as output:
* If the chat doesn't exist, will display a modal to create a chat
* if the chat gets created, return its ChatRoom context
* if none is created return void
- If the chat doesn't exist, will display a modal to create a chat
- if the chat gets created, return its ChatRoom context
- if none is created return void

## Example: ChatRoom

Expand Down Expand Up @@ -94,10 +94,10 @@ const chatRoom = intentResolution.getResult(): // A chatRoom will be returned as

Context

* [ChatRoom](../../context/ref/ChatRoom)
* [Contact](../../context/ref/Contact)
* [ContactList](../../context/ref/ContactList)
- [ChatRoom](../../context/ref/ChatRoom)
- [Contact](../../context/ref/Contact)
- [ContactList](../../context/ref/ContactList)

Intents

* [StartChat](StartChat)
- [StartChat](StartChat)
33 changes: 17 additions & 16 deletions docs/intents/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,23 @@ For more details on FDC3 Standards compliance (including the versioning, depreca

A list of standardized intents are defined in the following pages:

* [`CreateInteraction`](ref/CreateInteraction)
* [`StartCall`](ref/StartCall)
* [`StartChat`](ref/StartChat)
* [`StartEmail`](ref/StartEmail)
* [`ViewAnalysis`](ref/ViewAnalysis)
* [`ViewChat`](ref/ViewChat)
* [`ViewChart`](ref/ViewChart)
* [`ViewHoldings`](ref/ViewHoldings)
* [`ViewInstrument`](ref/ViewInstrument)
* [`ViewInteractions`](ref/ViewInteractions)
* [`ViewMessages`](ref/ViewMessages)
* [`ViewNews`](ref/ViewNews)
* [`ViewOrders`](ref/ViewOrders)
* [`ViewProfile`](ref/ViewProfile)
* [`ViewQuote`](ref/ViewQuote)
* [`ViewResearch`](ref/ViewResearch)
- [`CreateInteraction`](ref/CreateInteraction)
- [`CreateOrUpdateProfile`](ref/CreateOrUpdateProfile)
- [`StartCall`](ref/StartCall)
- [`StartChat`](ref/StartChat)
- [`StartEmail`](ref/StartEmail)
- [`ViewAnalysis`](ref/ViewAnalysis)
- [`ViewChat`](ref/ViewChat)
- [`ViewChart`](ref/ViewChart)
- [`ViewHoldings`](ref/ViewHoldings)
- [`ViewInstrument`](ref/ViewInstrument)
- [`ViewInteractions`](ref/ViewInteractions)
- [`ViewMessages`](ref/ViewMessages)
- [`ViewNews`](ref/ViewNews)
- [`ViewOrders`](ref/ViewOrders)
- [`ViewProfile`](ref/ViewProfile)
- [`ViewQuote`](ref/ViewQuote)
- [`ViewResearch`](ref/ViewResearch)

### Deprecated Intents

Expand Down
2 changes: 2 additions & 0 deletions src/intents/Intents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
export type StandardIntent =
| 'CreateInteraction'
| 'CreateOrUpdateProfile'
| 'SendChatMessage'
| 'StartCall'
| 'StartChat'
Expand Down Expand Up @@ -38,6 +39,7 @@ export type Intent = StandardIntent | (string & {});
*/
export enum Intents {
CreateInteraction = 'CreateInteraction',
CreateOrUpdateProfile = 'CreateOrUpdateProfile',
SendChatMessage = 'SendChatMessage',
StartCall = 'StartCall',
StartChat = 'StartChat',
Expand Down
1 change: 1 addition & 0 deletions src/intents/standard intents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"intents": [
"CreateInteraction",
"CreateOrUpdateProfile",
"SendChatMessage",
"StartCall",
"StartChat",
Expand Down
1 change: 1 addition & 0 deletions src/internal/intentConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { exhaustiveStringTuple } from './typeHelpers';

const STANDARD_INTENTS = exhaustiveStringTuple<StandardIntent>()(
'CreateInteraction',
'CreateOrUpdateProfile',
'SendChatMessage',
'StartCall',
'StartChat',
Expand Down
9 changes: 5 additions & 4 deletions website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
"items": [
"intents/spec",
"intents/ref/CreateInteraction",
"intents/ref/CreateOrUpdateProfile",
"intents/ref/SendChatMessage",
"intents/ref/StartCall",
"intents/ref/StartChat",
"intents/ref/StartEmail",
"intents/ref/SendChatMessage",
"intents/ref/ViewAnalysis",
"intents/ref/ViewChat",
"intents/ref/ViewChart",
"intents/ref/ViewChat",
"intents/ref/ViewContact",
"intents/ref/ViewHoldings",
"intents/ref/ViewInstrument",
"intents/ref/ViewInteractions",
Expand All @@ -54,8 +56,7 @@
"intents/ref/ViewOrders",
"intents/ref/ViewProfile",
"intents/ref/ViewQuote",
"intents/ref/ViewResearch",
"intents/ref/ViewContact"
"intents/ref/ViewResearch"
]
},
{
Expand Down

0 comments on commit 594224d

Please sign in to comment.