@contractspec/example.pocket-family-office 3.7.5 → 3.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +65 -33
- package/dist/browser/index.js +520 -519
- package/dist/browser/operations/index.js +6 -6
- package/dist/browser/telemetry.js +4 -4
- package/dist/browser/workflows/generate-financial-summary.js +1 -1
- package/dist/browser/workflows/generate-openbanking-overview.js +1 -1
- package/dist/browser/workflows/index.js +203 -203
- package/dist/browser/workflows/ingest-email-threads.js +1 -1
- package/dist/browser/workflows/process-uploaded-document.js +1 -1
- package/dist/browser/workflows/refresh-openbanking-balances.js +1 -1
- package/dist/browser/workflows/sync-openbanking-accounts.js +1 -1
- package/dist/browser/workflows/sync-openbanking-transactions.js +1 -1
- package/dist/browser/workflows/upcoming-payments-reminder.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +520 -519
- package/dist/node/index.js +520 -519
- package/dist/node/operations/index.js +6 -6
- package/dist/node/telemetry.js +4 -4
- package/dist/node/workflows/generate-financial-summary.js +1 -1
- package/dist/node/workflows/generate-openbanking-overview.js +1 -1
- package/dist/node/workflows/index.js +203 -203
- package/dist/node/workflows/ingest-email-threads.js +1 -1
- package/dist/node/workflows/process-uploaded-document.js +1 -1
- package/dist/node/workflows/refresh-openbanking-balances.js +1 -1
- package/dist/node/workflows/sync-openbanking-accounts.js +1 -1
- package/dist/node/workflows/sync-openbanking-transactions.js +1 -1
- package/dist/node/workflows/upcoming-payments-reminder.js +1 -1
- package/dist/operations/index.d.ts +1 -1
- package/dist/operations/index.js +6 -6
- package/dist/telemetry.js +4 -4
- package/dist/workflows/generate-financial-summary.js +1 -1
- package/dist/workflows/generate-openbanking-overview.js +1 -1
- package/dist/workflows/index.d.ts +4 -4
- package/dist/workflows/index.js +203 -203
- package/dist/workflows/ingest-email-threads.js +1 -1
- package/dist/workflows/process-uploaded-document.js +1 -1
- package/dist/workflows/refresh-openbanking-balances.js +1 -1
- package/dist/workflows/sync-openbanking-accounts.js +1 -1
- package/dist/workflows/sync-openbanking-transactions.js +1 -1
- package/dist/workflows/upcoming-payments-reminder.js +1 -1
- package/package.json +9 -9
|
@@ -1,260 +1,250 @@
|
|
|
1
|
-
// src/workflows/
|
|
2
|
-
import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
|
|
1
|
+
// src/workflows/generate-financial-summary.ts
|
|
3
2
|
import {
|
|
4
3
|
OwnersEnum,
|
|
5
4
|
StabilityEnum,
|
|
6
5
|
TagsEnum
|
|
7
6
|
} from "@contractspec/lib.contracts-spec";
|
|
8
|
-
|
|
7
|
+
import { defineWorkflow } from "@contractspec/lib.contracts-spec/workflow";
|
|
8
|
+
var generateFinancialSummaryWorkflow = defineWorkflow({
|
|
9
9
|
meta: {
|
|
10
|
-
key: "pfo.workflow.
|
|
10
|
+
key: "pfo.workflow.generate-financial-summary",
|
|
11
11
|
version: "1.0.0",
|
|
12
|
-
title: "
|
|
13
|
-
description: "
|
|
12
|
+
title: "Generate Financial Summary",
|
|
13
|
+
description: "Retrieves the latest financial signals, generates an AI summary, and optionally distributes it by voice or email.",
|
|
14
14
|
domain: "finance",
|
|
15
15
|
owners: [OwnersEnum.PlatformFinance],
|
|
16
|
-
tags: ["
|
|
17
|
-
stability: StabilityEnum.
|
|
16
|
+
tags: ["summary", "ai", TagsEnum.Automation],
|
|
17
|
+
stability: StabilityEnum.Beta
|
|
18
18
|
},
|
|
19
19
|
definition: {
|
|
20
|
-
entryStepId: "
|
|
20
|
+
entryStepId: "summarise",
|
|
21
21
|
steps: [
|
|
22
22
|
{
|
|
23
|
-
id: "
|
|
23
|
+
id: "summarise",
|
|
24
24
|
type: "automation",
|
|
25
|
-
label: "
|
|
26
|
-
description: "
|
|
25
|
+
label: "Generate Summary",
|
|
26
|
+
description: "Run retrieval augmented generation over the knowledge base to produce a household summary.",
|
|
27
27
|
action: {
|
|
28
|
-
operation: { key: "pfo.
|
|
28
|
+
operation: { key: "pfo.summary.generate", version: "1.0.0" }
|
|
29
29
|
},
|
|
30
|
-
requiredIntegrations: ["
|
|
30
|
+
requiredIntegrations: ["primaryLLM", "primaryVectorDb"],
|
|
31
31
|
retry: {
|
|
32
32
|
maxAttempts: 3,
|
|
33
33
|
backoff: "exponential",
|
|
34
|
-
delayMs:
|
|
34
|
+
delayMs: 750
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
|
-
id: "
|
|
39
|
-
type: "
|
|
40
|
-
label: "
|
|
41
|
-
description: "
|
|
38
|
+
id: "distribute",
|
|
39
|
+
type: "automation",
|
|
40
|
+
label: "Distribute Summary",
|
|
41
|
+
description: "Send the generated summary via email and optionally synthesise a voice note.",
|
|
42
|
+
action: {
|
|
43
|
+
operation: { key: "pfo.summary.dispatch", version: "1.0.0" }
|
|
44
|
+
},
|
|
45
|
+
requiredIntegrations: ["emailOutbound"],
|
|
46
|
+
retry: {
|
|
47
|
+
maxAttempts: 2,
|
|
48
|
+
backoff: "linear",
|
|
49
|
+
delayMs: 500
|
|
50
|
+
}
|
|
42
51
|
}
|
|
43
52
|
],
|
|
44
|
-
transitions: [
|
|
45
|
-
{
|
|
46
|
-
from: "store",
|
|
47
|
-
to: "review"
|
|
48
|
-
}
|
|
49
|
-
]
|
|
53
|
+
transitions: [{ from: "summarise", to: "distribute" }]
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
56
|
|
|
53
|
-
// src/workflows/
|
|
54
|
-
import { defineWorkflow as defineWorkflow2 } from "@contractspec/lib.contracts-spec/workflow";
|
|
57
|
+
// src/workflows/generate-openbanking-overview.ts
|
|
55
58
|
import {
|
|
56
59
|
OwnersEnum as OwnersEnum2,
|
|
57
60
|
StabilityEnum as StabilityEnum2,
|
|
58
61
|
TagsEnum as TagsEnum2
|
|
59
62
|
} from "@contractspec/lib.contracts-spec";
|
|
60
|
-
|
|
63
|
+
import { defineWorkflow as defineWorkflow2 } from "@contractspec/lib.contracts-spec/workflow";
|
|
64
|
+
var OPEN_BANKING_CAPABILITIES = [
|
|
65
|
+
{ key: "openbanking.accounts.read", version: "1.0.0" },
|
|
66
|
+
{ key: "openbanking.transactions.read", version: "1.0.0" },
|
|
67
|
+
{ key: "openbanking.balances.read", version: "1.0.0" }
|
|
68
|
+
];
|
|
69
|
+
var generateOpenBankingOverviewWorkflow = defineWorkflow2({
|
|
61
70
|
meta: {
|
|
62
|
-
key: "pfo.workflow.
|
|
71
|
+
key: "pfo.workflow.generate-openbanking-overview",
|
|
63
72
|
version: "1.0.0",
|
|
64
|
-
title: "
|
|
65
|
-
description: "
|
|
73
|
+
title: "Generate Open Banking Overview",
|
|
74
|
+
description: "Produces a derived financial overview and stores it in the operational knowledge space.",
|
|
66
75
|
domain: "finance",
|
|
67
76
|
owners: [OwnersEnum2.PlatformFinance],
|
|
68
|
-
tags: ["
|
|
69
|
-
stability: StabilityEnum2.
|
|
77
|
+
tags: ["open-banking", "summary", TagsEnum2.Automation],
|
|
78
|
+
stability: StabilityEnum2.Experimental
|
|
70
79
|
},
|
|
71
80
|
definition: {
|
|
72
|
-
entryStepId: "
|
|
81
|
+
entryStepId: "generate-overview",
|
|
73
82
|
steps: [
|
|
74
83
|
{
|
|
75
|
-
id: "
|
|
76
|
-
type: "human",
|
|
77
|
-
label: "Review Upcoming Bill",
|
|
78
|
-
description: "Confirm amount, due date, and preferred delivery channels before scheduling reminder."
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: "schedule",
|
|
84
|
+
id: "generate-overview",
|
|
82
85
|
type: "automation",
|
|
83
|
-
label: "
|
|
86
|
+
label: "Generate Overview",
|
|
87
|
+
description: "Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",
|
|
84
88
|
action: {
|
|
85
89
|
operation: {
|
|
86
|
-
key: "pfo.
|
|
90
|
+
key: "pfo.openbanking.generate-overview",
|
|
87
91
|
version: "1.0.0"
|
|
88
92
|
}
|
|
89
93
|
},
|
|
90
|
-
requiredIntegrations: [
|
|
91
|
-
|
|
92
|
-
"smsNotifications",
|
|
93
|
-
"calendarScheduling"
|
|
94
|
-
],
|
|
94
|
+
requiredIntegrations: ["primaryOpenBanking"],
|
|
95
|
+
requiredCapabilities: OPEN_BANKING_CAPABILITIES,
|
|
95
96
|
retry: {
|
|
96
|
-
maxAttempts:
|
|
97
|
-
backoff: "
|
|
98
|
-
delayMs:
|
|
97
|
+
maxAttempts: 3,
|
|
98
|
+
backoff: "exponential",
|
|
99
|
+
delayMs: 1500
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
],
|
|
102
|
-
transitions: [
|
|
103
|
-
{
|
|
104
|
-
from: "collect",
|
|
105
|
-
to: "schedule",
|
|
106
|
-
condition: "output?.confirmed === true",
|
|
107
|
-
label: "Reminder confirmed"
|
|
108
|
-
}
|
|
109
|
-
]
|
|
103
|
+
transitions: []
|
|
110
104
|
}
|
|
111
105
|
});
|
|
112
106
|
|
|
113
|
-
// src/workflows/
|
|
114
|
-
import { defineWorkflow as defineWorkflow3 } from "@contractspec/lib.contracts-spec/workflow";
|
|
107
|
+
// src/workflows/ingest-email-threads.ts
|
|
115
108
|
import {
|
|
116
109
|
OwnersEnum as OwnersEnum3,
|
|
117
110
|
StabilityEnum as StabilityEnum3,
|
|
118
111
|
TagsEnum as TagsEnum3
|
|
119
112
|
} from "@contractspec/lib.contracts-spec";
|
|
120
|
-
|
|
113
|
+
import { defineWorkflow as defineWorkflow3 } from "@contractspec/lib.contracts-spec/workflow";
|
|
114
|
+
var ingestEmailThreadsWorkflow = defineWorkflow3({
|
|
121
115
|
meta: {
|
|
122
|
-
key: "pfo.workflow.
|
|
116
|
+
key: "pfo.workflow.ingest-email-threads",
|
|
123
117
|
version: "1.0.0",
|
|
124
|
-
title: "
|
|
125
|
-
description: "
|
|
126
|
-
domain: "
|
|
127
|
-
owners: [OwnersEnum3.
|
|
128
|
-
tags: ["
|
|
129
|
-
stability: StabilityEnum3.
|
|
118
|
+
title: "Ingest Email Threads",
|
|
119
|
+
description: "Synchronises Gmail threads tagged with finance labels and indexes them into operational knowledge spaces.",
|
|
120
|
+
domain: "communications",
|
|
121
|
+
owners: [OwnersEnum3.PlatformMessaging],
|
|
122
|
+
tags: ["gmail", "knowledge", TagsEnum3.Automation],
|
|
123
|
+
stability: StabilityEnum3.Experimental
|
|
130
124
|
},
|
|
131
125
|
definition: {
|
|
132
|
-
entryStepId: "
|
|
126
|
+
entryStepId: "sync",
|
|
133
127
|
steps: [
|
|
134
128
|
{
|
|
135
|
-
id: "
|
|
129
|
+
id: "sync",
|
|
136
130
|
type: "automation",
|
|
137
|
-
label: "
|
|
138
|
-
description: "
|
|
131
|
+
label: "Sync Gmail Threads",
|
|
132
|
+
description: "Fetches Gmail threads and transforms them into knowledge fragments before vector indexing.",
|
|
139
133
|
action: {
|
|
140
|
-
operation: { key: "pfo.
|
|
134
|
+
operation: { key: "pfo.email.sync-threads", version: "1.0.0" }
|
|
141
135
|
},
|
|
142
|
-
requiredIntegrations: ["
|
|
136
|
+
requiredIntegrations: ["emailInbound", "primaryVectorDb"],
|
|
143
137
|
retry: {
|
|
144
138
|
maxAttempts: 3,
|
|
145
139
|
backoff: "exponential",
|
|
146
|
-
delayMs:
|
|
140
|
+
delayMs: 1000
|
|
147
141
|
}
|
|
148
142
|
},
|
|
149
143
|
{
|
|
150
|
-
id: "
|
|
151
|
-
type: "
|
|
152
|
-
label: "
|
|
153
|
-
description: "
|
|
154
|
-
action: {
|
|
155
|
-
operation: { key: "pfo.summary.dispatch", version: "1.0.0" }
|
|
156
|
-
},
|
|
157
|
-
requiredIntegrations: ["emailOutbound"],
|
|
158
|
-
retry: {
|
|
159
|
-
maxAttempts: 2,
|
|
160
|
-
backoff: "linear",
|
|
161
|
-
delayMs: 500
|
|
162
|
-
}
|
|
144
|
+
id: "triage",
|
|
145
|
+
type: "human",
|
|
146
|
+
label: "Triage Exceptions",
|
|
147
|
+
description: "Operators can resolve sync failures or tag important threads for follow-up."
|
|
163
148
|
}
|
|
164
149
|
],
|
|
165
|
-
transitions: [
|
|
150
|
+
transitions: [
|
|
151
|
+
{
|
|
152
|
+
from: "sync",
|
|
153
|
+
to: "triage",
|
|
154
|
+
condition: "output?.syncedThreads === 0",
|
|
155
|
+
label: "No new threads"
|
|
156
|
+
}
|
|
157
|
+
]
|
|
166
158
|
}
|
|
167
159
|
});
|
|
168
160
|
|
|
169
|
-
// src/workflows/
|
|
170
|
-
import { defineWorkflow as defineWorkflow4 } from "@contractspec/lib.contracts-spec/workflow";
|
|
161
|
+
// src/workflows/process-uploaded-document.ts
|
|
171
162
|
import {
|
|
172
163
|
OwnersEnum as OwnersEnum4,
|
|
173
164
|
StabilityEnum as StabilityEnum4,
|
|
174
165
|
TagsEnum as TagsEnum4
|
|
175
166
|
} from "@contractspec/lib.contracts-spec";
|
|
176
|
-
|
|
167
|
+
import { defineWorkflow as defineWorkflow4 } from "@contractspec/lib.contracts-spec/workflow";
|
|
168
|
+
var processUploadedDocumentWorkflow = defineWorkflow4({
|
|
177
169
|
meta: {
|
|
178
|
-
key: "pfo.workflow.
|
|
170
|
+
key: "pfo.workflow.process-uploaded-document",
|
|
179
171
|
version: "1.0.0",
|
|
180
|
-
title: "
|
|
181
|
-
description: "
|
|
182
|
-
domain: "
|
|
183
|
-
owners: [OwnersEnum4.
|
|
184
|
-
tags: ["
|
|
172
|
+
title: "Process Uploaded Document",
|
|
173
|
+
description: "Stores an uploaded invoice/contract, queues ingestion, and records any follow-up reminders.",
|
|
174
|
+
domain: "finance",
|
|
175
|
+
owners: [OwnersEnum4.PlatformFinance],
|
|
176
|
+
tags: ["documents", "ingestion", TagsEnum4.Automation],
|
|
185
177
|
stability: StabilityEnum4.Experimental
|
|
186
178
|
},
|
|
187
179
|
definition: {
|
|
188
|
-
entryStepId: "
|
|
180
|
+
entryStepId: "store",
|
|
189
181
|
steps: [
|
|
190
182
|
{
|
|
191
|
-
id: "
|
|
183
|
+
id: "store",
|
|
192
184
|
type: "automation",
|
|
193
|
-
label: "
|
|
194
|
-
description: "
|
|
185
|
+
label: "Store and Queue Ingestion",
|
|
186
|
+
description: "Persist the document to storage and enqueue the knowledge ingestion pipeline.",
|
|
195
187
|
action: {
|
|
196
|
-
operation: { key: "pfo.
|
|
188
|
+
operation: { key: "pfo.documents.upload", version: "1.0.0" }
|
|
197
189
|
},
|
|
198
|
-
requiredIntegrations: ["
|
|
190
|
+
requiredIntegrations: ["primaryStorage", "primaryVectorDb"],
|
|
199
191
|
retry: {
|
|
200
192
|
maxAttempts: 3,
|
|
201
193
|
backoff: "exponential",
|
|
202
|
-
delayMs:
|
|
194
|
+
delayMs: 500
|
|
203
195
|
}
|
|
204
196
|
},
|
|
205
197
|
{
|
|
206
|
-
id: "
|
|
198
|
+
id: "review",
|
|
207
199
|
type: "human",
|
|
208
|
-
label: "
|
|
209
|
-
description: "
|
|
200
|
+
label: "Optional Human Classification",
|
|
201
|
+
description: "Finance lead can categorise the document while ingestion completes."
|
|
210
202
|
}
|
|
211
203
|
],
|
|
212
204
|
transitions: [
|
|
213
205
|
{
|
|
214
|
-
from: "
|
|
215
|
-
to: "
|
|
216
|
-
condition: "output?.syncedThreads === 0",
|
|
217
|
-
label: "No new threads"
|
|
206
|
+
from: "store",
|
|
207
|
+
to: "review"
|
|
218
208
|
}
|
|
219
209
|
]
|
|
220
210
|
}
|
|
221
211
|
});
|
|
222
212
|
|
|
223
|
-
// src/workflows/
|
|
224
|
-
import { defineWorkflow as defineWorkflow5 } from "@contractspec/lib.contracts-spec/workflow";
|
|
213
|
+
// src/workflows/refresh-openbanking-balances.ts
|
|
225
214
|
import {
|
|
226
215
|
OwnersEnum as OwnersEnum5,
|
|
227
216
|
StabilityEnum as StabilityEnum5,
|
|
228
217
|
TagsEnum as TagsEnum5
|
|
229
218
|
} from "@contractspec/lib.contracts-spec";
|
|
230
|
-
|
|
231
|
-
|
|
219
|
+
import { defineWorkflow as defineWorkflow5 } from "@contractspec/lib.contracts-spec/workflow";
|
|
220
|
+
var BALANCE_CAPABILITY = {
|
|
221
|
+
key: "openbanking.balances.read",
|
|
232
222
|
version: "1.0.0"
|
|
233
223
|
};
|
|
234
|
-
var
|
|
224
|
+
var refreshOpenBankingBalancesWorkflow = defineWorkflow5({
|
|
235
225
|
meta: {
|
|
236
|
-
key: "pfo.workflow.
|
|
226
|
+
key: "pfo.workflow.refresh-openbanking-balances",
|
|
237
227
|
version: "1.0.0",
|
|
238
|
-
title: "
|
|
239
|
-
description: "
|
|
228
|
+
title: "Refresh Open Banking Balances",
|
|
229
|
+
description: "Refreshes balances for synced accounts to surface the latest cash positions in dashboards.",
|
|
240
230
|
domain: "finance",
|
|
241
231
|
owners: [OwnersEnum5.PlatformFinance],
|
|
242
232
|
tags: ["open-banking", "powens", TagsEnum5.Automation],
|
|
243
233
|
stability: StabilityEnum5.Experimental
|
|
244
234
|
},
|
|
245
235
|
definition: {
|
|
246
|
-
entryStepId: "
|
|
236
|
+
entryStepId: "refresh-balances",
|
|
247
237
|
steps: [
|
|
248
238
|
{
|
|
249
|
-
id: "
|
|
239
|
+
id: "refresh-balances",
|
|
250
240
|
type: "automation",
|
|
251
|
-
label: "
|
|
252
|
-
description: "
|
|
241
|
+
label: "Refresh Balances",
|
|
242
|
+
description: "Trigger the Powens provider to obtain current and available balances.",
|
|
253
243
|
action: {
|
|
254
|
-
operation: { key: "openbanking.
|
|
244
|
+
operation: { key: "openbanking.balances.refresh", version: "1.0.0" }
|
|
255
245
|
},
|
|
256
246
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
257
|
-
requiredCapabilities: [
|
|
247
|
+
requiredCapabilities: [BALANCE_CAPABILITY],
|
|
258
248
|
retry: {
|
|
259
249
|
maxAttempts: 3,
|
|
260
250
|
backoff: "exponential",
|
|
@@ -262,15 +252,15 @@ var syncOpenBankingAccountsWorkflow = defineWorkflow5({
|
|
|
262
252
|
}
|
|
263
253
|
},
|
|
264
254
|
{
|
|
265
|
-
id: "fetch-
|
|
255
|
+
id: "fetch-balances",
|
|
266
256
|
type: "automation",
|
|
267
|
-
label: "Fetch
|
|
268
|
-
description: "
|
|
257
|
+
label: "Fetch Balances",
|
|
258
|
+
description: "Load the canonical balance snapshots for downstream workflows and dashboards.",
|
|
269
259
|
action: {
|
|
270
|
-
operation: { key: "openbanking.
|
|
260
|
+
operation: { key: "openbanking.balances.get", version: "1.0.0" }
|
|
271
261
|
},
|
|
272
262
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
273
|
-
requiredCapabilities: [
|
|
263
|
+
requiredCapabilities: [BALANCE_CAPABILITY],
|
|
274
264
|
retry: {
|
|
275
265
|
maxAttempts: 2,
|
|
276
266
|
backoff: "linear",
|
|
@@ -278,181 +268,191 @@ var syncOpenBankingAccountsWorkflow = defineWorkflow5({
|
|
|
278
268
|
}
|
|
279
269
|
}
|
|
280
270
|
],
|
|
281
|
-
transitions: [{ from: "
|
|
271
|
+
transitions: [{ from: "refresh-balances", to: "fetch-balances" }]
|
|
282
272
|
}
|
|
283
273
|
});
|
|
284
274
|
|
|
285
|
-
// src/workflows/sync-openbanking-
|
|
286
|
-
import { defineWorkflow as defineWorkflow6 } from "@contractspec/lib.contracts-spec/workflow";
|
|
275
|
+
// src/workflows/sync-openbanking-accounts.ts
|
|
287
276
|
import {
|
|
288
277
|
OwnersEnum as OwnersEnum6,
|
|
289
278
|
StabilityEnum as StabilityEnum6,
|
|
290
279
|
TagsEnum as TagsEnum6
|
|
291
280
|
} from "@contractspec/lib.contracts-spec";
|
|
292
|
-
|
|
293
|
-
|
|
281
|
+
import { defineWorkflow as defineWorkflow6 } from "@contractspec/lib.contracts-spec/workflow";
|
|
282
|
+
var ACCOUNT_CAPABILITY = {
|
|
283
|
+
key: "openbanking.accounts.read",
|
|
294
284
|
version: "1.0.0"
|
|
295
285
|
};
|
|
296
|
-
var
|
|
286
|
+
var syncOpenBankingAccountsWorkflow = defineWorkflow6({
|
|
297
287
|
meta: {
|
|
298
|
-
key: "pfo.workflow.sync-openbanking-
|
|
288
|
+
key: "pfo.workflow.sync-openbanking-accounts",
|
|
299
289
|
version: "1.0.0",
|
|
300
|
-
title: "Synchronise Open Banking
|
|
301
|
-
description: "
|
|
290
|
+
title: "Synchronise Open Banking Accounts",
|
|
291
|
+
description: "Validates Powens connectivity and synchronises bank account metadata into the canonical ledger.",
|
|
302
292
|
domain: "finance",
|
|
303
293
|
owners: [OwnersEnum6.PlatformFinance],
|
|
304
294
|
tags: ["open-banking", "powens", TagsEnum6.Automation],
|
|
305
295
|
stability: StabilityEnum6.Experimental
|
|
306
296
|
},
|
|
307
297
|
definition: {
|
|
308
|
-
entryStepId: "sync-
|
|
298
|
+
entryStepId: "sync-accounts",
|
|
309
299
|
steps: [
|
|
310
300
|
{
|
|
311
|
-
id: "sync-
|
|
301
|
+
id: "sync-accounts",
|
|
312
302
|
type: "automation",
|
|
313
|
-
label: "Sync
|
|
314
|
-
description: "
|
|
303
|
+
label: "Sync Accounts",
|
|
304
|
+
description: "Refresh linked bank accounts via Powens and upsert canonical BankAccount records.",
|
|
315
305
|
action: {
|
|
316
|
-
operation: { key: "openbanking.
|
|
306
|
+
operation: { key: "openbanking.accounts.sync", version: "1.0.0" }
|
|
317
307
|
},
|
|
318
308
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
319
|
-
requiredCapabilities: [
|
|
309
|
+
requiredCapabilities: [ACCOUNT_CAPABILITY],
|
|
320
310
|
retry: {
|
|
321
|
-
maxAttempts:
|
|
311
|
+
maxAttempts: 3,
|
|
322
312
|
backoff: "exponential",
|
|
323
|
-
delayMs:
|
|
313
|
+
delayMs: 1000
|
|
324
314
|
}
|
|
325
315
|
},
|
|
326
316
|
{
|
|
327
|
-
id: "
|
|
317
|
+
id: "fetch-accounts",
|
|
328
318
|
type: "automation",
|
|
329
|
-
label: "
|
|
330
|
-
description: "Retrieve the canonical
|
|
319
|
+
label: "Fetch Accounts",
|
|
320
|
+
description: "Retrieve the latest canonical account snapshot for downstream consumers.",
|
|
331
321
|
action: {
|
|
332
|
-
operation: { key: "openbanking.
|
|
322
|
+
operation: { key: "openbanking.accounts.list", version: "1.0.0" }
|
|
333
323
|
},
|
|
334
324
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
335
|
-
requiredCapabilities: [
|
|
325
|
+
requiredCapabilities: [ACCOUNT_CAPABILITY],
|
|
336
326
|
retry: {
|
|
337
327
|
maxAttempts: 2,
|
|
338
328
|
backoff: "linear",
|
|
339
|
-
delayMs:
|
|
329
|
+
delayMs: 750
|
|
340
330
|
}
|
|
341
331
|
}
|
|
342
332
|
],
|
|
343
|
-
transitions: [{ from: "sync-
|
|
333
|
+
transitions: [{ from: "sync-accounts", to: "fetch-accounts" }]
|
|
344
334
|
}
|
|
345
335
|
});
|
|
346
336
|
|
|
347
|
-
// src/workflows/
|
|
348
|
-
import { defineWorkflow as defineWorkflow7 } from "@contractspec/lib.contracts-spec/workflow";
|
|
337
|
+
// src/workflows/sync-openbanking-transactions.ts
|
|
349
338
|
import {
|
|
350
339
|
OwnersEnum as OwnersEnum7,
|
|
351
340
|
StabilityEnum as StabilityEnum7,
|
|
352
341
|
TagsEnum as TagsEnum7
|
|
353
342
|
} from "@contractspec/lib.contracts-spec";
|
|
354
|
-
|
|
355
|
-
|
|
343
|
+
import { defineWorkflow as defineWorkflow7 } from "@contractspec/lib.contracts-spec/workflow";
|
|
344
|
+
var TRANSACTION_CAPABILITY = {
|
|
345
|
+
key: "openbanking.transactions.read",
|
|
356
346
|
version: "1.0.0"
|
|
357
347
|
};
|
|
358
|
-
var
|
|
348
|
+
var syncOpenBankingTransactionsWorkflow = defineWorkflow7({
|
|
359
349
|
meta: {
|
|
360
|
-
key: "pfo.workflow.
|
|
350
|
+
key: "pfo.workflow.sync-openbanking-transactions",
|
|
361
351
|
version: "1.0.0",
|
|
362
|
-
title: "
|
|
363
|
-
description: "
|
|
352
|
+
title: "Synchronise Open Banking Transactions",
|
|
353
|
+
description: "Fetches recent transactions from Powens for each linked account and stores them in the canonical ledger.",
|
|
364
354
|
domain: "finance",
|
|
365
355
|
owners: [OwnersEnum7.PlatformFinance],
|
|
366
356
|
tags: ["open-banking", "powens", TagsEnum7.Automation],
|
|
367
357
|
stability: StabilityEnum7.Experimental
|
|
368
358
|
},
|
|
369
359
|
definition: {
|
|
370
|
-
entryStepId: "
|
|
360
|
+
entryStepId: "sync-transactions",
|
|
371
361
|
steps: [
|
|
372
362
|
{
|
|
373
|
-
id: "
|
|
363
|
+
id: "sync-transactions",
|
|
374
364
|
type: "automation",
|
|
375
|
-
label: "
|
|
376
|
-
description: "
|
|
365
|
+
label: "Sync Transactions",
|
|
366
|
+
description: "Call the Powens provider to pull incremental transactions for active accounts.",
|
|
377
367
|
action: {
|
|
378
|
-
operation: { key: "openbanking.
|
|
368
|
+
operation: { key: "openbanking.transactions.sync", version: "1.0.0" }
|
|
379
369
|
},
|
|
380
370
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
381
|
-
requiredCapabilities: [
|
|
371
|
+
requiredCapabilities: [TRANSACTION_CAPABILITY],
|
|
382
372
|
retry: {
|
|
383
|
-
maxAttempts:
|
|
373
|
+
maxAttempts: 4,
|
|
384
374
|
backoff: "exponential",
|
|
385
|
-
delayMs:
|
|
375
|
+
delayMs: 1500
|
|
386
376
|
}
|
|
387
377
|
},
|
|
388
378
|
{
|
|
389
|
-
id: "
|
|
379
|
+
id: "list-transactions",
|
|
390
380
|
type: "automation",
|
|
391
|
-
label: "
|
|
392
|
-
description: "
|
|
381
|
+
label: "List Transactions",
|
|
382
|
+
description: "Retrieve the canonical transaction list for reporting and downstream analytics.",
|
|
393
383
|
action: {
|
|
394
|
-
operation: { key: "openbanking.
|
|
384
|
+
operation: { key: "openbanking.transactions.list", version: "1.0.0" }
|
|
395
385
|
},
|
|
396
386
|
requiredIntegrations: ["primaryOpenBanking"],
|
|
397
|
-
requiredCapabilities: [
|
|
387
|
+
requiredCapabilities: [TRANSACTION_CAPABILITY],
|
|
398
388
|
retry: {
|
|
399
389
|
maxAttempts: 2,
|
|
400
390
|
backoff: "linear",
|
|
401
|
-
delayMs:
|
|
391
|
+
delayMs: 1000
|
|
402
392
|
}
|
|
403
393
|
}
|
|
404
394
|
],
|
|
405
|
-
transitions: [{ from: "
|
|
395
|
+
transitions: [{ from: "sync-transactions", to: "list-transactions" }]
|
|
406
396
|
}
|
|
407
397
|
});
|
|
408
398
|
|
|
409
|
-
// src/workflows/
|
|
410
|
-
import { defineWorkflow as defineWorkflow8 } from "@contractspec/lib.contracts-spec/workflow";
|
|
399
|
+
// src/workflows/upcoming-payments-reminder.ts
|
|
411
400
|
import {
|
|
412
401
|
OwnersEnum as OwnersEnum8,
|
|
413
402
|
StabilityEnum as StabilityEnum8,
|
|
414
403
|
TagsEnum as TagsEnum8
|
|
415
404
|
} from "@contractspec/lib.contracts-spec";
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
{ key: "openbanking.transactions.read", version: "1.0.0" },
|
|
419
|
-
{ key: "openbanking.balances.read", version: "1.0.0" }
|
|
420
|
-
];
|
|
421
|
-
var generateOpenBankingOverviewWorkflow = defineWorkflow8({
|
|
405
|
+
import { defineWorkflow as defineWorkflow8 } from "@contractspec/lib.contracts-spec/workflow";
|
|
406
|
+
var upcomingPaymentsReminderWorkflow = defineWorkflow8({
|
|
422
407
|
meta: {
|
|
423
|
-
key: "pfo.workflow.
|
|
408
|
+
key: "pfo.workflow.upcoming-payments-reminder",
|
|
424
409
|
version: "1.0.0",
|
|
425
|
-
title: "
|
|
426
|
-
description: "
|
|
410
|
+
title: "Schedule Upcoming Payment Reminder",
|
|
411
|
+
description: "Collects payment metadata and schedules multi-channel reminders for bills that are due soon.",
|
|
427
412
|
domain: "finance",
|
|
428
413
|
owners: [OwnersEnum8.PlatformFinance],
|
|
429
|
-
tags: ["
|
|
430
|
-
stability: StabilityEnum8.
|
|
414
|
+
tags: ["payments", "reminders", TagsEnum8.Automation],
|
|
415
|
+
stability: StabilityEnum8.Beta
|
|
431
416
|
},
|
|
432
417
|
definition: {
|
|
433
|
-
entryStepId: "
|
|
418
|
+
entryStepId: "collect",
|
|
434
419
|
steps: [
|
|
435
420
|
{
|
|
436
|
-
id: "
|
|
421
|
+
id: "collect",
|
|
422
|
+
type: "human",
|
|
423
|
+
label: "Review Upcoming Bill",
|
|
424
|
+
description: "Confirm amount, due date, and preferred delivery channels before scheduling reminder."
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
id: "schedule",
|
|
437
428
|
type: "automation",
|
|
438
|
-
label: "
|
|
439
|
-
description: "Aggregate balances, cashflow, and category breakdowns into a knowledge entry.",
|
|
429
|
+
label: "Schedule Reminder",
|
|
440
430
|
action: {
|
|
441
431
|
operation: {
|
|
442
|
-
key: "pfo.
|
|
432
|
+
key: "pfo.reminders.schedule-payment",
|
|
443
433
|
version: "1.0.0"
|
|
444
434
|
}
|
|
445
435
|
},
|
|
446
|
-
requiredIntegrations: [
|
|
447
|
-
|
|
436
|
+
requiredIntegrations: [
|
|
437
|
+
"emailOutbound",
|
|
438
|
+
"smsNotifications",
|
|
439
|
+
"calendarScheduling"
|
|
440
|
+
],
|
|
448
441
|
retry: {
|
|
449
|
-
maxAttempts:
|
|
450
|
-
backoff: "
|
|
451
|
-
delayMs:
|
|
442
|
+
maxAttempts: 2,
|
|
443
|
+
backoff: "linear",
|
|
444
|
+
delayMs: 1000
|
|
452
445
|
}
|
|
453
446
|
}
|
|
454
447
|
],
|
|
455
|
-
transitions: [
|
|
448
|
+
transitions: [
|
|
449
|
+
{
|
|
450
|
+
from: "collect",
|
|
451
|
+
to: "schedule",
|
|
452
|
+
condition: "output?.confirmed === true",
|
|
453
|
+
label: "Reminder confirmed"
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
456
|
}
|
|
457
457
|
});
|
|
458
458
|
export {
|