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