Skip to content

Commit

Permalink
update transaction result based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
milindchidrawar committed Jul 6, 2022
1 parent c05af21 commit c1a30b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
6 changes: 4 additions & 2 deletions docs/context/ref/TransactionResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ https://fdc3.finos.org/schemas/next/transactionresult.schema.json

| Property | Type | Required | Example Value |
|-------------|---------|----------|-------------------|
| `type` | string | Yes | `'fdc3.transactionResult'` |
| `type` | Context | Yes | See Below |
| `status` | string | Yes | `'Updated'` |
| `context` | string | Yes | See Below |
| `message` | string | No | See Below |

## Example

Expand Down Expand Up @@ -52,6 +53,7 @@ Console log will display:
"id": {
"email": "jane.doe@mail.com"
}
}
},
"message": "record with id jane.doe@mail.com was updated"
}
```
1 change: 1 addition & 0 deletions src/context/ContextType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum ContextTypes {
Country = 'fdc3.country',
Currency = 'fdc3.currency',
Email = 'fdc3.email',
Interaction = 'fdc3.interaction',
Instrument = 'fdc3.instrument',
InstrumentList = 'fdc3.instrumentList',
Organization = 'fdc3.organization',
Expand Down
7 changes: 7 additions & 0 deletions src/context/ContextTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ export interface Nothing {
type: string;
}

export interface TransactionResult {
status: ("Created" | "Deleted" | "Updated" | "Failed") | string;
type: 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
5 changes: 4 additions & 1 deletion src/context/schemas/transactionresult.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"anyOf": [
{
"type": "string",
"enum": ["Created", "Deleted", "Updated"]
"enum": ["Created", "Deleted", "Updated", "Failed"]
},
{
"type": "string"
Expand All @@ -19,5 +19,8 @@
},
"context": { "$ref": "context.schema.json#" }
},
"message": {
"type": "string"
},
"required": ["status", "context"]
}
2 changes: 1 addition & 1 deletion src/intents/Intents.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export enum Intents {
CreateInteraction = 'CreateInteraction',
StartCall = 'StartCall',
StartChat = 'StartChat',
StartEmail = 'StartEmail',
Expand All @@ -13,5 +14,4 @@ export enum Intents {
ViewProfile = 'ViewProfile',
ViewQuote = 'ViewQuote',
ViewResearch = 'ViewResearch',
CreateInteraction = 'CreateInteraction',
}

0 comments on commit c1a30b8

Please sign in to comment.