@firela/api-types 0.0.0-canary.b1a4abae → 0.0.0-canary.b59261c8
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/dist/index.d.mts +4050 -2768
- package/dist/index.d.ts +4050 -2768
- package/dist/index.js +33 -5
- package/dist/index.mjs +33 -5
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +2243 -1003
- package/src/generated/services.gen.ts +1339 -739
- package/src/generated/types.gen.ts +7296 -3188
|
@@ -6,18 +6,12 @@ export const $CreateAccountDto = {
|
|
|
6
6
|
path: {
|
|
7
7
|
type: 'string',
|
|
8
8
|
description: 'Account path (hierarchical, colon-separated)',
|
|
9
|
-
example: 'Assets:CN:
|
|
10
|
-
},
|
|
11
|
-
displayName: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
description:
|
|
14
|
-
'Display name to distinguish accounts at the same path (default: "")',
|
|
15
|
-
example: '工资卡'
|
|
9
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
16
10
|
},
|
|
17
11
|
openDate: {
|
|
18
12
|
format: 'date-time',
|
|
19
13
|
type: 'string',
|
|
20
|
-
description: 'Account open date',
|
|
14
|
+
description: 'Account open date (server defaults to today)',
|
|
21
15
|
example: '2024-01-01'
|
|
22
16
|
},
|
|
23
17
|
currencies: {
|
|
@@ -45,26 +39,22 @@ export const $CreateAccountDto = {
|
|
|
45
39
|
templatePath: {
|
|
46
40
|
type: 'string',
|
|
47
41
|
description: 'Reference to account-standards template path',
|
|
48
|
-
example: 'Assets:CN:
|
|
42
|
+
example: 'Assets:CN:Checking'
|
|
49
43
|
},
|
|
50
44
|
isCustom: {
|
|
51
45
|
type: 'boolean',
|
|
52
46
|
description: 'Whether this is a custom (user-created) account',
|
|
53
47
|
default: false
|
|
54
48
|
},
|
|
55
|
-
i18nKey: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'i18n key for display name (overrides template)',
|
|
58
|
-
example: 'account.custom.mybank'
|
|
59
|
-
},
|
|
60
49
|
icon: {
|
|
61
50
|
type: 'string',
|
|
62
51
|
description: 'Icon identifier (overrides template)',
|
|
63
52
|
example: 'bank-custom'
|
|
64
53
|
},
|
|
65
|
-
|
|
54
|
+
openDirectiveMeta: {
|
|
66
55
|
type: 'object',
|
|
67
|
-
description:
|
|
56
|
+
description:
|
|
57
|
+
'Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)',
|
|
68
58
|
example: {
|
|
69
59
|
branch: 'Downtown',
|
|
70
60
|
accountNumber: '1234'
|
|
@@ -76,7 +66,7 @@ export const $CreateAccountDto = {
|
|
|
76
66
|
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
77
67
|
}
|
|
78
68
|
},
|
|
79
|
-
required: ['path'
|
|
69
|
+
required: ['path']
|
|
80
70
|
} as const;
|
|
81
71
|
|
|
82
72
|
export const $AccountResponseDto = {
|
|
@@ -90,13 +80,7 @@ export const $AccountResponseDto = {
|
|
|
90
80
|
path: {
|
|
91
81
|
type: 'string',
|
|
92
82
|
description: 'Account path (hierarchical, colon-separated)',
|
|
93
|
-
example: 'Assets:CN:
|
|
94
|
-
},
|
|
95
|
-
displayName: {
|
|
96
|
-
type: 'string',
|
|
97
|
-
description:
|
|
98
|
-
'Display name distinguishing multiple accounts at the same path',
|
|
99
|
-
example: '工资卡'
|
|
83
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
100
84
|
},
|
|
101
85
|
type: {
|
|
102
86
|
type: 'string',
|
|
@@ -104,6 +88,49 @@ export const $AccountResponseDto = {
|
|
|
104
88
|
enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
|
|
105
89
|
example: 'Assets'
|
|
106
90
|
},
|
|
91
|
+
assetSubClass: {
|
|
92
|
+
type: 'string',
|
|
93
|
+
description:
|
|
94
|
+
'Account-level asset sub-class (product type, e.g. STOCK/DEPOSIT/CREDIT_CARD/PERSONAL_LOAN). Computed from the account path via the asset-classifier (ADR-0077). Null for non-asset accounts (Income/Expenses/Equity) or unmatched paths.',
|
|
95
|
+
enum: [
|
|
96
|
+
'DEPOSIT',
|
|
97
|
+
'CASH',
|
|
98
|
+
'MONEY_MARKET_FUND',
|
|
99
|
+
'STOCK',
|
|
100
|
+
'ETF',
|
|
101
|
+
'MUTUAL_FUND',
|
|
102
|
+
'EQUITY_COMPENSATION',
|
|
103
|
+
'GOVERNMENT_BOND',
|
|
104
|
+
'CORPORATE_BOND',
|
|
105
|
+
'BOND_FUND',
|
|
106
|
+
'PRIMARY_RESIDENCE',
|
|
107
|
+
'INVESTMENT_PROPERTY',
|
|
108
|
+
'REIT',
|
|
109
|
+
'GOLD',
|
|
110
|
+
'SILVER',
|
|
111
|
+
'PRECIOUS_METAL',
|
|
112
|
+
'PRECIOUS_METAL_FUND',
|
|
113
|
+
'COMMODITY',
|
|
114
|
+
'COMMODITY_FUND',
|
|
115
|
+
'CRYPTOCURRENCY',
|
|
116
|
+
'RETIREMENT_ACCOUNT',
|
|
117
|
+
'HEALTH_ACCOUNT',
|
|
118
|
+
'EDUCATION_ACCOUNT',
|
|
119
|
+
'INSURANCE',
|
|
120
|
+
'PRIVATE_EQUITY',
|
|
121
|
+
'HEDGE_FUND',
|
|
122
|
+
'COLLECTIBLES',
|
|
123
|
+
'MORTGAGE',
|
|
124
|
+
'STUDENT_LOAN',
|
|
125
|
+
'CREDIT_CARD',
|
|
126
|
+
'PERSONAL_LOAN',
|
|
127
|
+
'ACCOUNTS_PAYABLE',
|
|
128
|
+
'TAX_PAYABLE',
|
|
129
|
+
'OTHER'
|
|
130
|
+
],
|
|
131
|
+
nullable: true,
|
|
132
|
+
example: 'STOCK'
|
|
133
|
+
},
|
|
107
134
|
status: {
|
|
108
135
|
type: 'string',
|
|
109
136
|
description: 'Account status',
|
|
@@ -145,26 +172,26 @@ export const $AccountResponseDto = {
|
|
|
145
172
|
templatePath: {
|
|
146
173
|
type: 'string',
|
|
147
174
|
description: 'Template path reference',
|
|
148
|
-
example: 'Assets:CN:
|
|
175
|
+
example: 'Assets:CN:Checking'
|
|
149
176
|
},
|
|
150
177
|
isCustom: {
|
|
151
178
|
type: 'boolean',
|
|
152
179
|
description: 'Whether this is a custom (user-created) account',
|
|
153
180
|
example: false
|
|
154
181
|
},
|
|
155
|
-
|
|
182
|
+
displayName: {
|
|
156
183
|
type: 'string',
|
|
157
|
-
description: '
|
|
158
|
-
example: '
|
|
184
|
+
description: 'Localized display name (ADR-0114, read-time projection)',
|
|
185
|
+
example: 'Checking'
|
|
159
186
|
},
|
|
160
187
|
icon: {
|
|
161
188
|
type: 'string',
|
|
162
189
|
description: 'Icon identifier',
|
|
163
190
|
example: 'bank-icbc'
|
|
164
191
|
},
|
|
165
|
-
|
|
192
|
+
openDirectiveMeta: {
|
|
166
193
|
type: 'object',
|
|
167
|
-
description: '
|
|
194
|
+
description: 'Open directive metadata (ADR-0115 Decision 9)',
|
|
168
195
|
example: {
|
|
169
196
|
branch: 'Downtown'
|
|
170
197
|
}
|
|
@@ -192,7 +219,6 @@ export const $AccountResponseDto = {
|
|
|
192
219
|
required: [
|
|
193
220
|
'id',
|
|
194
221
|
'path',
|
|
195
|
-
'displayName',
|
|
196
222
|
'type',
|
|
197
223
|
'status',
|
|
198
224
|
'openDate',
|
|
@@ -225,11 +251,6 @@ export const $AccountListResponseDto = {
|
|
|
225
251
|
export const $UpdateAccountDto = {
|
|
226
252
|
type: 'object',
|
|
227
253
|
properties: {
|
|
228
|
-
displayName: {
|
|
229
|
-
type: 'string',
|
|
230
|
-
description: 'Display name to distinguish accounts at the same path',
|
|
231
|
-
example: '招行工资卡'
|
|
232
|
-
},
|
|
233
254
|
currencies: {
|
|
234
255
|
description: 'Allowed currencies (null = no restriction)',
|
|
235
256
|
example: ['CNY', 'USD'],
|
|
@@ -251,19 +272,15 @@ export const $UpdateAccountDto = {
|
|
|
251
272
|
'NONE'
|
|
252
273
|
]
|
|
253
274
|
},
|
|
254
|
-
i18nKey: {
|
|
255
|
-
type: 'string',
|
|
256
|
-
description: 'i18n key for display name',
|
|
257
|
-
example: 'account.custom.mybank'
|
|
258
|
-
},
|
|
259
275
|
icon: {
|
|
260
276
|
type: 'string',
|
|
261
277
|
description: 'Icon identifier',
|
|
262
278
|
example: 'bank-custom'
|
|
263
279
|
},
|
|
264
|
-
|
|
280
|
+
openDirectiveMeta: {
|
|
265
281
|
type: 'object',
|
|
266
|
-
description:
|
|
282
|
+
description:
|
|
283
|
+
'Open directive metadata (merged with existing; NOT an opening-balance amount)',
|
|
267
284
|
example: {
|
|
268
285
|
branch: 'Uptown'
|
|
269
286
|
}
|
|
@@ -310,13 +327,47 @@ export const $ReopenAccountDto = {
|
|
|
310
327
|
}
|
|
311
328
|
} as const;
|
|
312
329
|
|
|
330
|
+
export const $CreateOpeningBalanceDto = {
|
|
331
|
+
type: 'object',
|
|
332
|
+
properties: {
|
|
333
|
+
amount: {
|
|
334
|
+
type: 'number',
|
|
335
|
+
description: 'Opening balance amount (non-negative)',
|
|
336
|
+
example: 1000
|
|
337
|
+
},
|
|
338
|
+
currency: {
|
|
339
|
+
type: 'string',
|
|
340
|
+
description: 'Currency code',
|
|
341
|
+
example: 'CNY'
|
|
342
|
+
},
|
|
343
|
+
date: {
|
|
344
|
+
format: 'date-time',
|
|
345
|
+
type: 'string',
|
|
346
|
+
description: 'Opening-balance date (defaults to now)',
|
|
347
|
+
example: '2024-01-01'
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
required: ['amount', 'currency']
|
|
351
|
+
} as const;
|
|
352
|
+
|
|
353
|
+
export const $OpeningBalanceResultDto = {
|
|
354
|
+
type: 'object',
|
|
355
|
+
properties: {
|
|
356
|
+
transactionId: {
|
|
357
|
+
type: 'string',
|
|
358
|
+
description: 'Created opening-balance transaction id.'
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
required: ['transactionId']
|
|
362
|
+
} as const;
|
|
363
|
+
|
|
313
364
|
export const $AccountStandardResponseDto = {
|
|
314
365
|
type: 'object',
|
|
315
366
|
properties: {
|
|
316
367
|
path: {
|
|
317
368
|
type: 'string',
|
|
318
369
|
description: 'Account path (hierarchical, colon-separated)',
|
|
319
|
-
example: 'Assets:CN:
|
|
370
|
+
example: 'Assets:CN:Checking'
|
|
320
371
|
},
|
|
321
372
|
type: {
|
|
322
373
|
type: 'string',
|
|
@@ -324,11 +375,6 @@ export const $AccountStandardResponseDto = {
|
|
|
324
375
|
enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
|
|
325
376
|
example: 'Assets'
|
|
326
377
|
},
|
|
327
|
-
i18nKey: {
|
|
328
|
-
type: 'string',
|
|
329
|
-
description: 'i18n key for localized display name',
|
|
330
|
-
example: 'account.assets.cn.bank.icbc.checking'
|
|
331
|
-
},
|
|
332
378
|
name: {
|
|
333
379
|
type: 'string',
|
|
334
380
|
description: 'Short localized display name',
|
|
@@ -351,9 +397,47 @@ export const $AccountStandardResponseDto = {
|
|
|
351
397
|
type: 'string',
|
|
352
398
|
description: 'Icon identifier for UI display',
|
|
353
399
|
example: 'bank-icbc'
|
|
400
|
+
},
|
|
401
|
+
productCategory: {
|
|
402
|
+
type: 'string',
|
|
403
|
+
description:
|
|
404
|
+
'Onboarding product category (coarse grouping derived from assetSubClass)',
|
|
405
|
+
enum: [
|
|
406
|
+
'cash',
|
|
407
|
+
'investment',
|
|
408
|
+
'credit_card',
|
|
409
|
+
'loan',
|
|
410
|
+
'payable_tax',
|
|
411
|
+
'other'
|
|
412
|
+
],
|
|
413
|
+
example: 'investment'
|
|
414
|
+
},
|
|
415
|
+
assetClass: {
|
|
416
|
+
type: 'string',
|
|
417
|
+
description:
|
|
418
|
+
'Asset class (LIQUIDITY/EQUITY/.../LIABILITY), derived at read time from classification rules',
|
|
419
|
+
enum: [
|
|
420
|
+
'LIQUIDITY',
|
|
421
|
+
'EQUITY',
|
|
422
|
+
'FIXED_INCOME',
|
|
423
|
+
'PRECIOUS_METALS',
|
|
424
|
+
'COMMODITY',
|
|
425
|
+
'INSURANCE',
|
|
426
|
+
'ALTERNATIVE_INVESTMENT',
|
|
427
|
+
'PERSONAL_ASSETS',
|
|
428
|
+
'LIABILITY',
|
|
429
|
+
'REAL_ESTATE',
|
|
430
|
+
'INDEX'
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
assetSubClass: {
|
|
434
|
+
type: 'string',
|
|
435
|
+
description:
|
|
436
|
+
'Asset sub-class (product type, derived at read time from classification rules)',
|
|
437
|
+
example: 'STOCK'
|
|
354
438
|
}
|
|
355
439
|
},
|
|
356
|
-
required: ['path', 'type', '
|
|
440
|
+
required: ['path', 'type', 'description', 'tags', 'icon', 'productCategory']
|
|
357
441
|
} as const;
|
|
358
442
|
|
|
359
443
|
export const $AccountStandardListResponseDto = {
|
|
@@ -383,18 +467,13 @@ export const $AccountStandardListResponseDto = {
|
|
|
383
467
|
export const $TemplateMetadataDto = {
|
|
384
468
|
type: 'object',
|
|
385
469
|
properties: {
|
|
386
|
-
extendable: {
|
|
387
|
-
type: 'boolean',
|
|
388
|
-
description: 'Whether this path can be extended',
|
|
389
|
-
example: true
|
|
390
|
-
},
|
|
391
470
|
rootType: {
|
|
392
471
|
type: 'string',
|
|
393
472
|
description: 'Root account type',
|
|
394
473
|
example: 'Assets'
|
|
395
474
|
}
|
|
396
475
|
},
|
|
397
|
-
required: ['
|
|
476
|
+
required: ['rootType']
|
|
398
477
|
} as const;
|
|
399
478
|
|
|
400
479
|
export const $TemplateMetadataResponseDto = {
|
|
@@ -533,7 +612,7 @@ export const $CreatePostingDto = {
|
|
|
533
612
|
type: 'string',
|
|
534
613
|
description:
|
|
535
614
|
'Account name in Beancount format (must start with uppercase, colon-separated)',
|
|
536
|
-
example: 'Assets:
|
|
615
|
+
example: 'Assets:Checking'
|
|
537
616
|
},
|
|
538
617
|
units: {
|
|
539
618
|
type: 'string',
|
|
@@ -692,7 +771,7 @@ export const $PostingResponseDto = {
|
|
|
692
771
|
account: {
|
|
693
772
|
type: 'string',
|
|
694
773
|
description: 'Account name',
|
|
695
|
-
example: 'Assets:
|
|
774
|
+
example: 'Assets:Checking'
|
|
696
775
|
},
|
|
697
776
|
units: {
|
|
698
777
|
type: 'string',
|
|
@@ -1058,7 +1137,7 @@ export const $PostingDetailDto = {
|
|
|
1058
1137
|
account: {
|
|
1059
1138
|
type: 'string',
|
|
1060
1139
|
description: 'Fully-qualified Beancount account path',
|
|
1061
|
-
example: 'Assets:
|
|
1140
|
+
example: 'Assets:Checking'
|
|
1062
1141
|
},
|
|
1063
1142
|
units: {
|
|
1064
1143
|
type: 'string',
|
|
@@ -1247,6 +1326,77 @@ export const $TransactionDetailDto = {
|
|
|
1247
1326
|
]
|
|
1248
1327
|
} as const;
|
|
1249
1328
|
|
|
1329
|
+
export const $BalanceByCurrencyDto = {
|
|
1330
|
+
type: 'object',
|
|
1331
|
+
properties: {
|
|
1332
|
+
currency: {
|
|
1333
|
+
type: 'string',
|
|
1334
|
+
description: 'ISO 4217 currency code',
|
|
1335
|
+
example: 'CNY'
|
|
1336
|
+
},
|
|
1337
|
+
balance: {
|
|
1338
|
+
type: 'string',
|
|
1339
|
+
description: 'Balance amount',
|
|
1340
|
+
example: '50000.00'
|
|
1341
|
+
}
|
|
1342
|
+
},
|
|
1343
|
+
required: ['currency', 'balance']
|
|
1344
|
+
} as const;
|
|
1345
|
+
|
|
1346
|
+
export const $ExchangeRateWarningDto = {
|
|
1347
|
+
type: 'object',
|
|
1348
|
+
properties: {
|
|
1349
|
+
type: {
|
|
1350
|
+
type: 'string',
|
|
1351
|
+
description: 'Warning type',
|
|
1352
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
1353
|
+
},
|
|
1354
|
+
currency: {
|
|
1355
|
+
type: 'string',
|
|
1356
|
+
description: 'Currency without exchange rate',
|
|
1357
|
+
example: 'EUR'
|
|
1358
|
+
},
|
|
1359
|
+
totalAmount: {
|
|
1360
|
+
type: 'string',
|
|
1361
|
+
description: 'Total amount affected',
|
|
1362
|
+
example: '1000.00'
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
required: ['type', 'currency', 'totalAmount']
|
|
1366
|
+
} as const;
|
|
1367
|
+
|
|
1368
|
+
export const $TransactionListSummaryDto = {
|
|
1369
|
+
type: 'object',
|
|
1370
|
+
properties: {
|
|
1371
|
+
totalAmount: {
|
|
1372
|
+
type: 'string',
|
|
1373
|
+
description:
|
|
1374
|
+
'Partial converted total in base currency (rated currencies only, raw Beancount sign). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.',
|
|
1375
|
+
example: '-6000.00'
|
|
1376
|
+
},
|
|
1377
|
+
currency: {
|
|
1378
|
+
type: 'string',
|
|
1379
|
+
description: 'Base currency (ISO 4217)',
|
|
1380
|
+
example: 'CNY'
|
|
1381
|
+
},
|
|
1382
|
+
balanceByCurrency: {
|
|
1383
|
+
description: 'Raw (unconverted) balance per currency',
|
|
1384
|
+
type: 'array',
|
|
1385
|
+
items: {
|
|
1386
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
1387
|
+
}
|
|
1388
|
+
},
|
|
1389
|
+
warnings: {
|
|
1390
|
+
description: 'Currencies missing an FX rate (omitted when empty)',
|
|
1391
|
+
type: 'array',
|
|
1392
|
+
items: {
|
|
1393
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
},
|
|
1397
|
+
required: ['totalAmount', 'currency', 'balanceByCurrency']
|
|
1398
|
+
} as const;
|
|
1399
|
+
|
|
1250
1400
|
export const $TransactionListResponseDto = {
|
|
1251
1401
|
type: 'object',
|
|
1252
1402
|
properties: {
|
|
@@ -1271,6 +1421,15 @@ export const $TransactionListResponseDto = {
|
|
|
1271
1421
|
type: 'number',
|
|
1272
1422
|
description: 'Number of items skipped',
|
|
1273
1423
|
example: 0
|
|
1424
|
+
},
|
|
1425
|
+
summary: {
|
|
1426
|
+
description:
|
|
1427
|
+
'Amount summary for the full filtered set (#514). Present only when the request has a single account OR category viewpoint; omitted for search-only / plain-list / dual-perspective requests.',
|
|
1428
|
+
allOf: [
|
|
1429
|
+
{
|
|
1430
|
+
$ref: '#/components/schemas/TransactionListSummaryDto'
|
|
1431
|
+
}
|
|
1432
|
+
]
|
|
1274
1433
|
}
|
|
1275
1434
|
},
|
|
1276
1435
|
required: ['data', 'total', 'limit', 'offset']
|
|
@@ -1370,7 +1529,7 @@ export const $BalanceResponseDto = {
|
|
|
1370
1529
|
account: {
|
|
1371
1530
|
type: 'string',
|
|
1372
1531
|
description: 'Account name',
|
|
1373
|
-
example: 'Assets:
|
|
1532
|
+
example: 'Assets:Checking'
|
|
1374
1533
|
},
|
|
1375
1534
|
balance: {
|
|
1376
1535
|
type: 'string',
|
|
@@ -1397,7 +1556,7 @@ export const $MultiCurrencyBalanceResponseDto = {
|
|
|
1397
1556
|
account: {
|
|
1398
1557
|
type: 'string',
|
|
1399
1558
|
description: 'Account name',
|
|
1400
|
-
example: 'Assets:
|
|
1559
|
+
example: 'Assets:Checking'
|
|
1401
1560
|
},
|
|
1402
1561
|
balances: {
|
|
1403
1562
|
type: 'object',
|
|
@@ -1453,7 +1612,7 @@ export const $TransactionSummaryDto = {
|
|
|
1453
1612
|
accountName: {
|
|
1454
1613
|
type: 'string',
|
|
1455
1614
|
description: 'Source account name (first posting)',
|
|
1456
|
-
example: 'Assets:
|
|
1615
|
+
example: 'Assets:Checking'
|
|
1457
1616
|
},
|
|
1458
1617
|
sourceType: {
|
|
1459
1618
|
type: 'string',
|
|
@@ -1855,7 +2014,8 @@ export const $ResolveResultDto = {
|
|
|
1855
2014
|
},
|
|
1856
2015
|
resolutionId: {
|
|
1857
2016
|
type: 'string',
|
|
1858
|
-
description:
|
|
2017
|
+
description:
|
|
2018
|
+
'Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).'
|
|
1859
2019
|
},
|
|
1860
2020
|
canUndo: {
|
|
1861
2021
|
type: 'boolean',
|
|
@@ -1873,7 +2033,7 @@ export const $ResolveResultDto = {
|
|
|
1873
2033
|
example: 'rule_01HXK5V8N2M3P4Q5R6S7T8U9V0'
|
|
1874
2034
|
}
|
|
1875
2035
|
},
|
|
1876
|
-
required: ['success'
|
|
2036
|
+
required: ['success']
|
|
1877
2037
|
} as const;
|
|
1878
2038
|
|
|
1879
2039
|
export const $UndoResultDto = {
|
|
@@ -2744,64 +2904,221 @@ export const $UpdateCommodityDto = {
|
|
|
2744
2904
|
}
|
|
2745
2905
|
} as const;
|
|
2746
2906
|
|
|
2747
|
-
export const $
|
|
2907
|
+
export const $CreateBeanPriceDto = {
|
|
2748
2908
|
type: 'object',
|
|
2749
2909
|
properties: {
|
|
2750
|
-
|
|
2751
|
-
type: 'string',
|
|
2752
|
-
description: 'Rule name (unique per user)',
|
|
2753
|
-
maxLength: 100
|
|
2754
|
-
},
|
|
2755
|
-
icon: {
|
|
2910
|
+
currency: {
|
|
2756
2911
|
type: 'string',
|
|
2757
|
-
description: '
|
|
2758
|
-
|
|
2912
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2913
|
+
example: 'USD'
|
|
2759
2914
|
},
|
|
2760
|
-
|
|
2915
|
+
quoteCurrency: {
|
|
2761
2916
|
type: 'string',
|
|
2762
|
-
description: '
|
|
2763
|
-
|
|
2764
|
-
'WEEKLY',
|
|
2765
|
-
'BIWEEKLY',
|
|
2766
|
-
'MONTHLY',
|
|
2767
|
-
'BIMONTHLY',
|
|
2768
|
-
'QUARTERLY',
|
|
2769
|
-
'YEARLY',
|
|
2770
|
-
'CUSTOM'
|
|
2771
|
-
]
|
|
2917
|
+
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
2918
|
+
example: 'CNY'
|
|
2772
2919
|
},
|
|
2773
|
-
|
|
2920
|
+
amount: {
|
|
2774
2921
|
type: 'number',
|
|
2775
|
-
description:
|
|
2922
|
+
description:
|
|
2923
|
+
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
2924
|
+
example: 175.5,
|
|
2776
2925
|
minimum: 0
|
|
2777
2926
|
},
|
|
2778
|
-
|
|
2779
|
-
type: '
|
|
2780
|
-
description: '
|
|
2781
|
-
|
|
2782
|
-
maximum: 31
|
|
2927
|
+
date: {
|
|
2928
|
+
type: 'string',
|
|
2929
|
+
description: 'Price date (ISO 8601 format)',
|
|
2930
|
+
example: '2024-11-05'
|
|
2783
2931
|
},
|
|
2784
|
-
|
|
2785
|
-
type: '
|
|
2786
|
-
description:
|
|
2787
|
-
|
|
2932
|
+
metadata: {
|
|
2933
|
+
type: 'object',
|
|
2934
|
+
description:
|
|
2935
|
+
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
2936
|
+
example: {
|
|
2937
|
+
source: 'MANUAL',
|
|
2938
|
+
note: 'Bank valuation report',
|
|
2939
|
+
confidence: 0.95
|
|
2940
|
+
}
|
|
2941
|
+
}
|
|
2942
|
+
},
|
|
2943
|
+
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
2944
|
+
} as const;
|
|
2945
|
+
|
|
2946
|
+
export const $PriceResponseDto = {
|
|
2947
|
+
type: 'object',
|
|
2948
|
+
properties: {
|
|
2949
|
+
id: {
|
|
2950
|
+
type: 'string',
|
|
2951
|
+
description: 'Unique identifier',
|
|
2952
|
+
example: 'uuid-123-456'
|
|
2953
|
+
},
|
|
2954
|
+
userId: {
|
|
2955
|
+
type: 'string',
|
|
2956
|
+
description: 'User ID (owner of the price)',
|
|
2957
|
+
example: 'user-123'
|
|
2788
2958
|
},
|
|
2789
2959
|
currency: {
|
|
2790
2960
|
type: 'string',
|
|
2791
|
-
description: 'Currency
|
|
2792
|
-
|
|
2793
|
-
maxLength: 10
|
|
2961
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2962
|
+
example: 'BTC'
|
|
2794
2963
|
},
|
|
2795
|
-
|
|
2964
|
+
quoteCurrency: {
|
|
2796
2965
|
type: 'string',
|
|
2797
|
-
description: '
|
|
2798
|
-
|
|
2966
|
+
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
2967
|
+
example: 'USD'
|
|
2799
2968
|
},
|
|
2800
|
-
|
|
2969
|
+
amount: {
|
|
2801
2970
|
type: 'number',
|
|
2802
|
-
description:
|
|
2803
|
-
|
|
2804
|
-
|
|
2971
|
+
description:
|
|
2972
|
+
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
2973
|
+
example: 50000
|
|
2974
|
+
},
|
|
2975
|
+
date: {
|
|
2976
|
+
type: 'string',
|
|
2977
|
+
description:
|
|
2978
|
+
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
2979
|
+
example: '2024-01-01',
|
|
2980
|
+
format: 'date'
|
|
2981
|
+
},
|
|
2982
|
+
meta: {
|
|
2983
|
+
type: 'object',
|
|
2984
|
+
description:
|
|
2985
|
+
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
2986
|
+
example: {
|
|
2987
|
+
source: 'MANUAL',
|
|
2988
|
+
note: 'User-defined price',
|
|
2989
|
+
confidence: 1
|
|
2990
|
+
}
|
|
2991
|
+
},
|
|
2992
|
+
createdAt: {
|
|
2993
|
+
format: 'date-time',
|
|
2994
|
+
type: 'string',
|
|
2995
|
+
description: 'Creation timestamp',
|
|
2996
|
+
example: '2024-11-03T10:00:00Z'
|
|
2997
|
+
},
|
|
2998
|
+
updatedAt: {
|
|
2999
|
+
format: 'date-time',
|
|
3000
|
+
type: 'string',
|
|
3001
|
+
description: 'Last update timestamp',
|
|
3002
|
+
example: '2024-11-03T10:00:00Z'
|
|
3003
|
+
}
|
|
3004
|
+
},
|
|
3005
|
+
required: [
|
|
3006
|
+
'id',
|
|
3007
|
+
'userId',
|
|
3008
|
+
'currency',
|
|
3009
|
+
'quoteCurrency',
|
|
3010
|
+
'amount',
|
|
3011
|
+
'date',
|
|
3012
|
+
'meta',
|
|
3013
|
+
'createdAt',
|
|
3014
|
+
'updatedAt'
|
|
3015
|
+
]
|
|
3016
|
+
} as const;
|
|
3017
|
+
|
|
3018
|
+
export const $PriceListResponseDto = {
|
|
3019
|
+
type: 'object',
|
|
3020
|
+
properties: {
|
|
3021
|
+
items: {
|
|
3022
|
+
description: 'List of prices',
|
|
3023
|
+
type: 'array',
|
|
3024
|
+
items: {
|
|
3025
|
+
$ref: '#/components/schemas/PriceResponseDto'
|
|
3026
|
+
}
|
|
3027
|
+
},
|
|
3028
|
+
total: {
|
|
3029
|
+
type: 'number',
|
|
3030
|
+
description: 'Total number of prices',
|
|
3031
|
+
example: 42
|
|
3032
|
+
}
|
|
3033
|
+
},
|
|
3034
|
+
required: ['items', 'total']
|
|
3035
|
+
} as const;
|
|
3036
|
+
|
|
3037
|
+
export const $UpdateBeanPriceDto = {
|
|
3038
|
+
type: 'object',
|
|
3039
|
+
properties: {
|
|
3040
|
+
currency: {
|
|
3041
|
+
type: 'string',
|
|
3042
|
+
description: 'Currency being priced'
|
|
3043
|
+
},
|
|
3044
|
+
quoteCurrency: {
|
|
3045
|
+
type: 'string',
|
|
3046
|
+
description: 'Quote currency (pricing currency)'
|
|
3047
|
+
},
|
|
3048
|
+
amount: {
|
|
3049
|
+
type: 'number',
|
|
3050
|
+
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
3051
|
+
minimum: 0
|
|
3052
|
+
},
|
|
3053
|
+
date: {
|
|
3054
|
+
type: 'string',
|
|
3055
|
+
description: 'Price date (ISO 8601 format)'
|
|
3056
|
+
},
|
|
3057
|
+
metadata: {
|
|
3058
|
+
type: 'object',
|
|
3059
|
+
description: 'Metadata'
|
|
3060
|
+
}
|
|
3061
|
+
}
|
|
3062
|
+
} as const;
|
|
3063
|
+
|
|
3064
|
+
export const $CreateRecurringRuleDto = {
|
|
3065
|
+
type: 'object',
|
|
3066
|
+
properties: {
|
|
3067
|
+
name: {
|
|
3068
|
+
type: 'string',
|
|
3069
|
+
description: 'Rule name (unique per user)',
|
|
3070
|
+
maxLength: 100
|
|
3071
|
+
},
|
|
3072
|
+
icon: {
|
|
3073
|
+
type: 'string',
|
|
3074
|
+
description: 'Icon emoji',
|
|
3075
|
+
maxLength: 10
|
|
3076
|
+
},
|
|
3077
|
+
frequency: {
|
|
3078
|
+
type: 'string',
|
|
3079
|
+
description: 'Recurring frequency',
|
|
3080
|
+
enum: [
|
|
3081
|
+
'WEEKLY',
|
|
3082
|
+
'BIWEEKLY',
|
|
3083
|
+
'MONTHLY',
|
|
3084
|
+
'BIMONTHLY',
|
|
3085
|
+
'QUARTERLY',
|
|
3086
|
+
'YEARLY',
|
|
3087
|
+
'CUSTOM'
|
|
3088
|
+
]
|
|
3089
|
+
},
|
|
3090
|
+
expectedAmount: {
|
|
3091
|
+
type: 'number',
|
|
3092
|
+
description: 'Expected amount (positive number)',
|
|
3093
|
+
minimum: 0
|
|
3094
|
+
},
|
|
3095
|
+
expectedDay: {
|
|
3096
|
+
type: 'number',
|
|
3097
|
+
description: 'Expected day of month (1-31)',
|
|
3098
|
+
minimum: 1,
|
|
3099
|
+
maximum: 31
|
|
3100
|
+
},
|
|
3101
|
+
customIntervalDays: {
|
|
3102
|
+
type: 'number',
|
|
3103
|
+
description: 'Custom interval in days (required for CUSTOM frequency)',
|
|
3104
|
+
minimum: 1
|
|
3105
|
+
},
|
|
3106
|
+
currency: {
|
|
3107
|
+
type: 'string',
|
|
3108
|
+
description: 'Currency code',
|
|
3109
|
+
default: 'CNY',
|
|
3110
|
+
maxLength: 10
|
|
3111
|
+
},
|
|
3112
|
+
matchPayeePattern: {
|
|
3113
|
+
type: 'string',
|
|
3114
|
+
description: 'Payee matching pattern (supports wildcards)',
|
|
3115
|
+
maxLength: 200
|
|
3116
|
+
},
|
|
3117
|
+
matchAmountTolerance: {
|
|
3118
|
+
type: 'number',
|
|
3119
|
+
description: 'Amount tolerance percentage (0-1)',
|
|
3120
|
+
default: 0.075,
|
|
3121
|
+
minimum: 0,
|
|
2805
3122
|
maximum: 1
|
|
2806
3123
|
},
|
|
2807
3124
|
defaultExpenseAccount: {
|
|
@@ -3515,307 +3832,754 @@ export const $ForecastResponseDto = {
|
|
|
3515
3832
|
]
|
|
3516
3833
|
} as const;
|
|
3517
3834
|
|
|
3518
|
-
export const $
|
|
3835
|
+
export const $CurrencyBalanceDto = {
|
|
3519
3836
|
type: 'object',
|
|
3520
3837
|
properties: {
|
|
3521
|
-
|
|
3838
|
+
currency: {
|
|
3522
3839
|
type: 'string',
|
|
3523
|
-
|
|
3524
|
-
|
|
3840
|
+
description: 'ISO 4217 currency code',
|
|
3841
|
+
example: 'CNY'
|
|
3525
3842
|
},
|
|
3526
|
-
|
|
3843
|
+
balance: {
|
|
3527
3844
|
type: 'string',
|
|
3528
|
-
|
|
3529
|
-
|
|
3530
|
-
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
|
|
3536
|
-
|
|
3537
|
-
|
|
3538
|
-
|
|
3539
|
-
type: 'array'
|
|
3540
|
-
},
|
|
3541
|
-
maxItems: 50,
|
|
3542
|
-
type: 'array'
|
|
3543
|
-
},
|
|
3544
|
-
categoryKeywords: {
|
|
3545
|
-
items: {
|
|
3546
|
-
type: 'array'
|
|
3547
|
-
},
|
|
3548
|
-
maxItems: 50,
|
|
3549
|
-
type: 'array'
|
|
3550
|
-
},
|
|
3551
|
-
methodKeywords: {
|
|
3552
|
-
items: {
|
|
3553
|
-
type: 'array'
|
|
3554
|
-
},
|
|
3555
|
-
maxItems: 50,
|
|
3556
|
-
description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
|
|
3557
|
-
type: 'array'
|
|
3558
|
-
},
|
|
3559
|
-
categoryAccount: {
|
|
3845
|
+
description: 'Balance amount',
|
|
3846
|
+
example: '500000.00'
|
|
3847
|
+
}
|
|
3848
|
+
},
|
|
3849
|
+
required: ['currency', 'balance']
|
|
3850
|
+
} as const;
|
|
3851
|
+
|
|
3852
|
+
export const $TimeSeriesPointDto = {
|
|
3853
|
+
type: 'object',
|
|
3854
|
+
properties: {
|
|
3855
|
+
date: {
|
|
3560
3856
|
type: 'string',
|
|
3561
|
-
|
|
3562
|
-
|
|
3563
|
-
'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
|
|
3857
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3858
|
+
example: '2024-06-15'
|
|
3564
3859
|
},
|
|
3565
|
-
|
|
3860
|
+
value: {
|
|
3566
3861
|
type: 'string',
|
|
3567
|
-
|
|
3568
|
-
|
|
3862
|
+
description: 'Value at this date (in base currency)',
|
|
3863
|
+
example: '500000.00'
|
|
3569
3864
|
},
|
|
3570
|
-
|
|
3571
|
-
type: '
|
|
3572
|
-
|
|
3573
|
-
|
|
3865
|
+
change: {
|
|
3866
|
+
type: 'object',
|
|
3867
|
+
description: 'Change from previous point',
|
|
3868
|
+
example: '5000.00'
|
|
3574
3869
|
},
|
|
3575
|
-
|
|
3576
|
-
type: '
|
|
3577
|
-
|
|
3578
|
-
|
|
3870
|
+
assets: {
|
|
3871
|
+
type: 'string',
|
|
3872
|
+
description: 'Total assets at this date (in base currency)',
|
|
3873
|
+
example: '494338.00'
|
|
3579
3874
|
},
|
|
3580
|
-
|
|
3581
|
-
type: '
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
maximum: 1000
|
|
3875
|
+
liabilities: {
|
|
3876
|
+
type: 'string',
|
|
3877
|
+
description: 'Total liabilities at this date (in base currency)',
|
|
3878
|
+
example: '310098.00'
|
|
3585
3879
|
},
|
|
3586
|
-
|
|
3880
|
+
byCurrency: {
|
|
3881
|
+
description: 'Multi-currency breakdown for this point',
|
|
3882
|
+
type: 'array',
|
|
3587
3883
|
items: {
|
|
3588
|
-
|
|
3589
|
-
}
|
|
3590
|
-
maxItems: 20,
|
|
3591
|
-
type: 'array'
|
|
3592
|
-
},
|
|
3593
|
-
additionalMetadata: {
|
|
3594
|
-
type: 'object'
|
|
3595
|
-
},
|
|
3596
|
-
upsertByPayee: {
|
|
3597
|
-
type: 'boolean',
|
|
3598
|
-
description:
|
|
3599
|
-
'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
|
|
3884
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3885
|
+
}
|
|
3600
3886
|
}
|
|
3601
3887
|
},
|
|
3602
|
-
required: ['
|
|
3888
|
+
required: ['date', 'value']
|
|
3603
3889
|
} as const;
|
|
3604
3890
|
|
|
3605
|
-
export const $
|
|
3891
|
+
export const $TrendSummaryDto = {
|
|
3606
3892
|
type: 'object',
|
|
3607
3893
|
properties: {
|
|
3608
|
-
|
|
3609
|
-
type: '
|
|
3610
|
-
description: '
|
|
3894
|
+
startValue: {
|
|
3895
|
+
type: 'string',
|
|
3896
|
+
description: 'Value at start of period',
|
|
3897
|
+
example: '450000.00'
|
|
3611
3898
|
},
|
|
3612
|
-
|
|
3613
|
-
type: '
|
|
3614
|
-
description: '
|
|
3899
|
+
endValue: {
|
|
3900
|
+
type: 'string',
|
|
3901
|
+
description: 'Value at end of period',
|
|
3902
|
+
example: '500000.00'
|
|
3903
|
+
},
|
|
3904
|
+
totalChange: {
|
|
3905
|
+
type: 'string',
|
|
3906
|
+
description: 'Total change over period',
|
|
3907
|
+
example: '50000.00'
|
|
3908
|
+
},
|
|
3909
|
+
totalChangePercentage: {
|
|
3910
|
+
type: 'string',
|
|
3911
|
+
description: 'Total change percentage',
|
|
3912
|
+
example: '+11.11%'
|
|
3615
3913
|
}
|
|
3616
|
-
}
|
|
3914
|
+
},
|
|
3915
|
+
required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
|
|
3617
3916
|
} as const;
|
|
3618
3917
|
|
|
3619
|
-
export const $
|
|
3918
|
+
export const $MultiCurrencyPointDto = {
|
|
3620
3919
|
type: 'object',
|
|
3621
3920
|
properties: {
|
|
3622
|
-
|
|
3623
|
-
type: 'string',
|
|
3624
|
-
description: 'Rule ID'
|
|
3625
|
-
},
|
|
3626
|
-
name: {
|
|
3627
|
-
type: 'string',
|
|
3628
|
-
description: 'Rule name'
|
|
3629
|
-
},
|
|
3630
|
-
description: {
|
|
3921
|
+
date: {
|
|
3631
3922
|
type: 'string',
|
|
3632
|
-
description: '
|
|
3633
|
-
|
|
3634
|
-
narrationKeywords: {
|
|
3635
|
-
description: 'Keywords to match in transaction narration',
|
|
3636
|
-
type: 'array',
|
|
3637
|
-
items: {
|
|
3638
|
-
type: 'string'
|
|
3639
|
-
}
|
|
3640
|
-
},
|
|
3641
|
-
payeeKeywords: {
|
|
3642
|
-
description: 'Keywords to match in payee name',
|
|
3643
|
-
type: 'array',
|
|
3644
|
-
items: {
|
|
3645
|
-
type: 'string'
|
|
3646
|
-
}
|
|
3923
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3924
|
+
example: '2024-06-15'
|
|
3647
3925
|
},
|
|
3648
|
-
|
|
3649
|
-
description: '
|
|
3926
|
+
byCurrency: {
|
|
3927
|
+
description: 'Balances by currency',
|
|
3650
3928
|
type: 'array',
|
|
3651
3929
|
items: {
|
|
3652
|
-
|
|
3930
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3653
3931
|
}
|
|
3654
|
-
}
|
|
3655
|
-
|
|
3656
|
-
|
|
3932
|
+
}
|
|
3933
|
+
},
|
|
3934
|
+
required: ['date', 'byCurrency']
|
|
3935
|
+
} as const;
|
|
3936
|
+
|
|
3937
|
+
export const $PortfolioTrendsResponseDto = {
|
|
3938
|
+
type: 'object',
|
|
3939
|
+
properties: {
|
|
3940
|
+
series: {
|
|
3941
|
+
description: 'Time series data points',
|
|
3657
3942
|
type: 'array',
|
|
3658
3943
|
items: {
|
|
3659
|
-
|
|
3944
|
+
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
3660
3945
|
}
|
|
3661
3946
|
},
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
description: 'Destination account for categorization'
|
|
3665
|
-
},
|
|
3666
|
-
matchLogic: {
|
|
3667
|
-
type: 'string',
|
|
3668
|
-
description: 'Keyword matching logic',
|
|
3669
|
-
enum: ['OR', 'AND'],
|
|
3670
|
-
example: 'OR'
|
|
3671
|
-
},
|
|
3672
|
-
amountRange: {
|
|
3673
|
-
description: 'Amount range for matching',
|
|
3947
|
+
summary: {
|
|
3948
|
+
description: 'Period summary',
|
|
3674
3949
|
allOf: [
|
|
3675
3950
|
{
|
|
3676
|
-
$ref: '#/components/schemas/
|
|
3951
|
+
$ref: '#/components/schemas/TrendSummaryDto'
|
|
3677
3952
|
}
|
|
3678
3953
|
]
|
|
3679
3954
|
},
|
|
3680
|
-
|
|
3681
|
-
type: 'number',
|
|
3682
|
-
description: 'Rule priority (0-1000, higher = first match)',
|
|
3683
|
-
example: 50
|
|
3684
|
-
},
|
|
3685
|
-
enabled: {
|
|
3686
|
-
type: 'boolean',
|
|
3687
|
-
description: 'Whether the rule is enabled'
|
|
3688
|
-
},
|
|
3689
|
-
learningSource: {
|
|
3955
|
+
period: {
|
|
3690
3956
|
type: 'string',
|
|
3691
|
-
description: '
|
|
3692
|
-
|
|
3693
|
-
nullable: true,
|
|
3694
|
-
example: 'REVIEW_CENTER'
|
|
3957
|
+
description: 'Period requested',
|
|
3958
|
+
example: '6m'
|
|
3695
3959
|
},
|
|
3696
|
-
|
|
3697
|
-
type: '
|
|
3698
|
-
description: '
|
|
3960
|
+
granularity: {
|
|
3961
|
+
type: 'string',
|
|
3962
|
+
description: 'Data granularity',
|
|
3963
|
+
example: 'month'
|
|
3699
3964
|
},
|
|
3700
|
-
|
|
3701
|
-
type: '
|
|
3702
|
-
description: '
|
|
3703
|
-
example:
|
|
3965
|
+
currency: {
|
|
3966
|
+
type: 'string',
|
|
3967
|
+
description: 'Base currency for converted values',
|
|
3968
|
+
example: 'CNY'
|
|
3704
3969
|
},
|
|
3705
|
-
|
|
3706
|
-
description:
|
|
3970
|
+
byCurrency: {
|
|
3971
|
+
description:
|
|
3972
|
+
'Multi-currency time series (each point has currency breakdown)',
|
|
3707
3973
|
type: 'array',
|
|
3708
3974
|
items: {
|
|
3709
|
-
|
|
3975
|
+
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
3710
3976
|
}
|
|
3711
3977
|
},
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3978
|
+
warnings: {
|
|
3979
|
+
description: 'Exchange rate warnings',
|
|
3980
|
+
type: 'array',
|
|
3981
|
+
items: {
|
|
3982
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
3717
3983
|
}
|
|
3718
|
-
},
|
|
3719
|
-
createdAt: {
|
|
3720
|
-
format: 'date-time',
|
|
3721
|
-
type: 'string',
|
|
3722
|
-
description: 'Created timestamp'
|
|
3723
|
-
},
|
|
3724
|
-
updatedAt: {
|
|
3725
|
-
format: 'date-time',
|
|
3726
|
-
type: 'string',
|
|
3727
|
-
description: 'Updated timestamp'
|
|
3728
3984
|
}
|
|
3729
3985
|
},
|
|
3730
|
-
required: [
|
|
3731
|
-
'id',
|
|
3732
|
-
'name',
|
|
3733
|
-
'narrationKeywords',
|
|
3734
|
-
'payeeKeywords',
|
|
3735
|
-
'categoryKeywords',
|
|
3736
|
-
'methodKeywords',
|
|
3737
|
-
'matchLogic',
|
|
3738
|
-
'priority',
|
|
3739
|
-
'enabled',
|
|
3740
|
-
'autoApplyEnabled',
|
|
3741
|
-
'confirmationCount',
|
|
3742
|
-
'additionalTags',
|
|
3743
|
-
'createdAt',
|
|
3744
|
-
'updatedAt'
|
|
3745
|
-
]
|
|
3986
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
3746
3987
|
} as const;
|
|
3747
3988
|
|
|
3748
|
-
export const $
|
|
3989
|
+
export const $CashFlowPointDto = {
|
|
3749
3990
|
type: 'object',
|
|
3750
3991
|
properties: {
|
|
3751
|
-
|
|
3752
|
-
type: '
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
}
|
|
3992
|
+
month: {
|
|
3993
|
+
type: 'string',
|
|
3994
|
+
description: 'Month key (YYYY-MM)',
|
|
3995
|
+
example: '2024-03'
|
|
3756
3996
|
},
|
|
3757
|
-
|
|
3758
|
-
type: '
|
|
3759
|
-
description: '
|
|
3997
|
+
income: {
|
|
3998
|
+
type: 'string',
|
|
3999
|
+
description: 'Income in base currency (absolute, converted)',
|
|
4000
|
+
example: '10000.00'
|
|
3760
4001
|
},
|
|
3761
|
-
|
|
3762
|
-
type: '
|
|
3763
|
-
description: '
|
|
4002
|
+
expense: {
|
|
4003
|
+
type: 'string',
|
|
4004
|
+
description: 'Expense in base currency (absolute, converted)',
|
|
4005
|
+
example: '5000.00'
|
|
3764
4006
|
},
|
|
3765
|
-
|
|
3766
|
-
type: '
|
|
3767
|
-
description: '
|
|
4007
|
+
netSavings: {
|
|
4008
|
+
type: 'string',
|
|
4009
|
+
description: 'netSavings = income − expense (savings positive)',
|
|
4010
|
+
example: '5000.00'
|
|
3768
4011
|
}
|
|
3769
4012
|
},
|
|
3770
|
-
required: ['
|
|
4013
|
+
required: ['month', 'income', 'expense', 'netSavings']
|
|
3771
4014
|
} as const;
|
|
3772
4015
|
|
|
3773
|
-
export const $
|
|
4016
|
+
export const $CashFlowTrendSummaryDto = {
|
|
3774
4017
|
type: 'object',
|
|
3775
4018
|
properties: {
|
|
3776
|
-
|
|
4019
|
+
totalIncome: {
|
|
3777
4020
|
type: 'string',
|
|
3778
|
-
|
|
3779
|
-
|
|
4021
|
+
description: 'Total income across the period',
|
|
4022
|
+
example: '60000.00'
|
|
3780
4023
|
},
|
|
3781
|
-
|
|
4024
|
+
totalExpense: {
|
|
3782
4025
|
type: 'string',
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
narrationKeywords: {
|
|
3786
|
-
items: {
|
|
3787
|
-
type: 'array'
|
|
3788
|
-
},
|
|
3789
|
-
maxItems: 50,
|
|
3790
|
-
type: 'array'
|
|
4026
|
+
description: 'Total expense across the period',
|
|
4027
|
+
example: '30000.00'
|
|
3791
4028
|
},
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
maxItems: 50,
|
|
3797
|
-
type: 'array'
|
|
4029
|
+
totalNetSavings: {
|
|
4030
|
+
type: 'string',
|
|
4031
|
+
description: 'income − expense across the period',
|
|
4032
|
+
example: '30000.00'
|
|
3798
4033
|
},
|
|
3799
|
-
|
|
4034
|
+
averageMonthlyNetSavings: {
|
|
4035
|
+
type: 'string',
|
|
4036
|
+
description:
|
|
4037
|
+
'totalNetSavings divided by the window length (N months, incl. zero-filled)',
|
|
4038
|
+
example: '5000.00'
|
|
4039
|
+
}
|
|
4040
|
+
},
|
|
4041
|
+
required: [
|
|
4042
|
+
'totalIncome',
|
|
4043
|
+
'totalExpense',
|
|
4044
|
+
'totalNetSavings',
|
|
4045
|
+
'averageMonthlyNetSavings'
|
|
4046
|
+
]
|
|
4047
|
+
} as const;
|
|
4048
|
+
|
|
4049
|
+
export const $CashFlowTrendsResponseDto = {
|
|
4050
|
+
type: 'object',
|
|
4051
|
+
properties: {
|
|
4052
|
+
series: {
|
|
4053
|
+
description:
|
|
4054
|
+
'Monthly cash-flow series (fixed N-month window, zero-filled)',
|
|
4055
|
+
type: 'array',
|
|
3800
4056
|
items: {
|
|
3801
|
-
|
|
3802
|
-
}
|
|
3803
|
-
maxItems: 50,
|
|
3804
|
-
type: 'array'
|
|
4057
|
+
$ref: '#/components/schemas/CashFlowPointDto'
|
|
4058
|
+
}
|
|
3805
4059
|
},
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
4060
|
+
summary: {
|
|
4061
|
+
description: 'Period totals',
|
|
4062
|
+
allOf: [
|
|
4063
|
+
{
|
|
4064
|
+
$ref: '#/components/schemas/CashFlowTrendSummaryDto'
|
|
4065
|
+
}
|
|
4066
|
+
]
|
|
3813
4067
|
},
|
|
3814
|
-
|
|
4068
|
+
period: {
|
|
3815
4069
|
type: 'string',
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
4070
|
+
description: 'Period requested',
|
|
4071
|
+
example: '6m'
|
|
4072
|
+
},
|
|
4073
|
+
granularity: {
|
|
4074
|
+
type: 'string',
|
|
4075
|
+
description: 'Data granularity (v1 returns month buckets)',
|
|
4076
|
+
example: 'month'
|
|
4077
|
+
},
|
|
4078
|
+
currency: {
|
|
4079
|
+
type: 'string',
|
|
4080
|
+
description: 'Base currency for converted values',
|
|
4081
|
+
example: 'CNY'
|
|
4082
|
+
},
|
|
4083
|
+
warnings: {
|
|
4084
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
4085
|
+
type: 'array',
|
|
4086
|
+
items: {
|
|
4087
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
4088
|
+
}
|
|
4089
|
+
}
|
|
4090
|
+
},
|
|
4091
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
4092
|
+
} as const;
|
|
4093
|
+
|
|
4094
|
+
export const $GenerateSnapshotBody = {
|
|
4095
|
+
type: 'object',
|
|
4096
|
+
properties: {}
|
|
4097
|
+
} as const;
|
|
4098
|
+
|
|
4099
|
+
export const $GenerateSnapshotResponse = {
|
|
4100
|
+
type: 'object',
|
|
4101
|
+
properties: {}
|
|
4102
|
+
} as const;
|
|
4103
|
+
|
|
4104
|
+
export const $BackfillSnapshotsBody = {
|
|
4105
|
+
type: 'object',
|
|
4106
|
+
properties: {}
|
|
4107
|
+
} as const;
|
|
4108
|
+
|
|
4109
|
+
export const $BackfillSnapshotsResponse = {
|
|
4110
|
+
type: 'object',
|
|
4111
|
+
properties: {}
|
|
4112
|
+
} as const;
|
|
4113
|
+
|
|
4114
|
+
export const $DeleteOwnUserDto = {
|
|
4115
|
+
type: 'object',
|
|
4116
|
+
properties: {
|
|
4117
|
+
accessToken: {
|
|
4118
|
+
type: 'string',
|
|
4119
|
+
description: 'Access token for user verification',
|
|
4120
|
+
example: 'abc123xyz'
|
|
4121
|
+
}
|
|
4122
|
+
},
|
|
4123
|
+
required: ['accessToken']
|
|
4124
|
+
} as const;
|
|
4125
|
+
|
|
4126
|
+
export const $SignupDto = {
|
|
4127
|
+
type: 'object',
|
|
4128
|
+
properties: {
|
|
4129
|
+
turnstileToken: {
|
|
4130
|
+
type: 'string',
|
|
4131
|
+
description:
|
|
4132
|
+
'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
|
|
4133
|
+
example: '0.abc123def456...'
|
|
4134
|
+
}
|
|
4135
|
+
}
|
|
4136
|
+
} as const;
|
|
4137
|
+
|
|
4138
|
+
export const $SignupResponseDto = {
|
|
4139
|
+
type: 'object',
|
|
4140
|
+
properties: {
|
|
4141
|
+
authToken: {
|
|
4142
|
+
type: 'string',
|
|
4143
|
+
description: 'JWT auth token',
|
|
4144
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
4145
|
+
},
|
|
4146
|
+
accessToken: {
|
|
4147
|
+
type: 'string',
|
|
4148
|
+
description: 'Auto-generated access token'
|
|
4149
|
+
},
|
|
4150
|
+
role: {
|
|
4151
|
+
type: 'string',
|
|
4152
|
+
description: 'Assigned user role',
|
|
4153
|
+
enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
|
|
4154
|
+
}
|
|
4155
|
+
},
|
|
4156
|
+
required: ['authToken', 'accessToken', 'role']
|
|
4157
|
+
} as const;
|
|
4158
|
+
|
|
4159
|
+
export const $UpdateUserSettingDto = {
|
|
4160
|
+
type: 'object',
|
|
4161
|
+
properties: {
|
|
4162
|
+
secId: {
|
|
4163
|
+
type: 'number',
|
|
4164
|
+
description: 'Security ID'
|
|
4165
|
+
},
|
|
4166
|
+
annualInterestRate: {
|
|
4167
|
+
type: 'number',
|
|
4168
|
+
description: 'Annual interest rate',
|
|
4169
|
+
example: 0.05
|
|
4170
|
+
},
|
|
4171
|
+
currency: {
|
|
4172
|
+
type: 'string',
|
|
4173
|
+
description: 'Currency code',
|
|
4174
|
+
example: 'USD'
|
|
4175
|
+
},
|
|
4176
|
+
baseCurrency: {
|
|
4177
|
+
type: 'string',
|
|
4178
|
+
description: 'Base currency code',
|
|
4179
|
+
example: 'USD'
|
|
4180
|
+
},
|
|
4181
|
+
benchmark: {
|
|
4182
|
+
type: 'string',
|
|
4183
|
+
description: 'Benchmark symbol',
|
|
4184
|
+
example: 'SPY'
|
|
4185
|
+
},
|
|
4186
|
+
colorScheme: {
|
|
4187
|
+
type: 'string',
|
|
4188
|
+
description: 'Color scheme',
|
|
4189
|
+
enum: ['DARK', 'LIGHT']
|
|
4190
|
+
},
|
|
4191
|
+
dateRange: {
|
|
4192
|
+
type: 'string',
|
|
4193
|
+
description: 'Date range filter',
|
|
4194
|
+
example: '1y'
|
|
4195
|
+
},
|
|
4196
|
+
emergencyFund: {
|
|
4197
|
+
type: 'number',
|
|
4198
|
+
description: 'Emergency fund amount',
|
|
4199
|
+
example: 10000
|
|
4200
|
+
},
|
|
4201
|
+
'filters.accounts': {
|
|
4202
|
+
description: 'Account filter IDs',
|
|
4203
|
+
type: 'array',
|
|
4204
|
+
items: {
|
|
4205
|
+
type: 'string'
|
|
4206
|
+
}
|
|
4207
|
+
},
|
|
4208
|
+
'filters.assetClasses': {
|
|
4209
|
+
description: 'Asset class filters',
|
|
4210
|
+
type: 'array',
|
|
4211
|
+
items: {
|
|
4212
|
+
type: 'string'
|
|
4213
|
+
}
|
|
4214
|
+
},
|
|
4215
|
+
'filters.dataSource': {
|
|
4216
|
+
type: 'string',
|
|
4217
|
+
description: 'Data source filter'
|
|
4218
|
+
},
|
|
4219
|
+
'filters.symbol': {
|
|
4220
|
+
type: 'string',
|
|
4221
|
+
description: 'Symbol filter'
|
|
4222
|
+
},
|
|
4223
|
+
'filters.tags': {
|
|
4224
|
+
description: 'Tag filters',
|
|
4225
|
+
type: 'array',
|
|
4226
|
+
items: {
|
|
4227
|
+
type: 'string'
|
|
4228
|
+
}
|
|
4229
|
+
},
|
|
4230
|
+
isExperimentalFeatures: {
|
|
4231
|
+
type: 'boolean',
|
|
4232
|
+
description: 'Enable experimental features'
|
|
4233
|
+
},
|
|
4234
|
+
isRestrictedView: {
|
|
4235
|
+
type: 'boolean',
|
|
4236
|
+
description: 'Enable restricted view mode'
|
|
4237
|
+
},
|
|
4238
|
+
language: {
|
|
4239
|
+
type: 'string',
|
|
4240
|
+
description: 'Language code',
|
|
4241
|
+
example: 'en'
|
|
4242
|
+
},
|
|
4243
|
+
locale: {
|
|
4244
|
+
type: 'string',
|
|
4245
|
+
description: 'Locale code',
|
|
4246
|
+
example: 'en-US'
|
|
4247
|
+
},
|
|
4248
|
+
projectedTotalAmount: {
|
|
4249
|
+
type: 'number',
|
|
4250
|
+
description: 'Projected total amount',
|
|
4251
|
+
example: 1000000
|
|
4252
|
+
},
|
|
4253
|
+
retirementDate: {
|
|
4254
|
+
type: 'string',
|
|
4255
|
+
description: 'Retirement date in ISO 8601 format',
|
|
4256
|
+
example: '2050-01-01'
|
|
4257
|
+
},
|
|
4258
|
+
savingsRate: {
|
|
4259
|
+
type: 'number',
|
|
4260
|
+
description: 'Savings rate percentage',
|
|
4261
|
+
example: 0.2
|
|
4262
|
+
},
|
|
4263
|
+
viewMode: {
|
|
4264
|
+
type: 'string',
|
|
4265
|
+
description: 'View mode',
|
|
4266
|
+
enum: ['DEFAULT', 'ZEN']
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
} as const;
|
|
4270
|
+
|
|
4271
|
+
export const $UpdatePropertyDto = {
|
|
4272
|
+
type: 'object',
|
|
4273
|
+
properties: {
|
|
4274
|
+
value: {
|
|
4275
|
+
type: 'string',
|
|
4276
|
+
description: 'Property value'
|
|
4277
|
+
}
|
|
4278
|
+
},
|
|
4279
|
+
required: ['value']
|
|
4280
|
+
} as const;
|
|
4281
|
+
|
|
4282
|
+
export const $CreateTransactionRuleDto = {
|
|
4283
|
+
type: 'object',
|
|
4284
|
+
properties: {
|
|
4285
|
+
name: {
|
|
4286
|
+
type: 'string',
|
|
4287
|
+
minLength: 1,
|
|
4288
|
+
maxLength: 100
|
|
4289
|
+
},
|
|
4290
|
+
description: {
|
|
4291
|
+
type: 'string',
|
|
4292
|
+
maxLength: 500
|
|
4293
|
+
},
|
|
4294
|
+
narrationKeywords: {
|
|
4295
|
+
items: {
|
|
4296
|
+
type: 'array'
|
|
4297
|
+
},
|
|
4298
|
+
maxItems: 50,
|
|
4299
|
+
type: 'array'
|
|
4300
|
+
},
|
|
4301
|
+
payeeKeywords: {
|
|
4302
|
+
items: {
|
|
4303
|
+
type: 'array'
|
|
4304
|
+
},
|
|
4305
|
+
maxItems: 50,
|
|
4306
|
+
type: 'array'
|
|
4307
|
+
},
|
|
4308
|
+
categoryKeywords: {
|
|
4309
|
+
items: {
|
|
4310
|
+
type: 'array'
|
|
4311
|
+
},
|
|
4312
|
+
maxItems: 50,
|
|
4313
|
+
type: 'array'
|
|
4314
|
+
},
|
|
4315
|
+
methodKeywords: {
|
|
4316
|
+
items: {
|
|
4317
|
+
type: 'array'
|
|
4318
|
+
},
|
|
4319
|
+
maxItems: 50,
|
|
4320
|
+
description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
|
|
4321
|
+
type: 'array'
|
|
4322
|
+
},
|
|
4323
|
+
categoryAccount: {
|
|
4324
|
+
type: 'string',
|
|
4325
|
+
maxLength: 200,
|
|
4326
|
+
description:
|
|
4327
|
+
'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
|
|
4328
|
+
},
|
|
4329
|
+
matchLogic: {
|
|
4330
|
+
type: 'string',
|
|
4331
|
+
enum: ['OR', 'AND'],
|
|
4332
|
+
default: 'OR'
|
|
4333
|
+
},
|
|
4334
|
+
amountMin: {
|
|
4335
|
+
type: 'number',
|
|
4336
|
+
minimum: 0,
|
|
4337
|
+
description: 'Minimum transaction amount (inclusive)'
|
|
4338
|
+
},
|
|
4339
|
+
amountMax: {
|
|
4340
|
+
type: 'number',
|
|
4341
|
+
minimum: 0,
|
|
4342
|
+
description: 'Maximum transaction amount (inclusive)'
|
|
4343
|
+
},
|
|
4344
|
+
priority: {
|
|
4345
|
+
type: 'number',
|
|
4346
|
+
default: 50,
|
|
4347
|
+
minimum: 0,
|
|
4348
|
+
maximum: 1000
|
|
4349
|
+
},
|
|
4350
|
+
additionalTags: {
|
|
4351
|
+
items: {
|
|
4352
|
+
type: 'array'
|
|
4353
|
+
},
|
|
4354
|
+
maxItems: 20,
|
|
4355
|
+
type: 'array'
|
|
4356
|
+
},
|
|
4357
|
+
additionalMetadata: {
|
|
4358
|
+
type: 'object'
|
|
4359
|
+
},
|
|
4360
|
+
upsertByPayee: {
|
|
4361
|
+
type: 'boolean',
|
|
4362
|
+
description:
|
|
4363
|
+
'If true, update existing rule with matching payeeKeywords[0] instead of creating new rule'
|
|
4364
|
+
}
|
|
4365
|
+
},
|
|
4366
|
+
required: ['name', 'matchLogic', 'priority']
|
|
4367
|
+
} as const;
|
|
4368
|
+
|
|
4369
|
+
export const $AmountRangeDto = {
|
|
4370
|
+
type: 'object',
|
|
4371
|
+
properties: {
|
|
4372
|
+
min: {
|
|
4373
|
+
type: 'number',
|
|
4374
|
+
description: 'Minimum amount'
|
|
4375
|
+
},
|
|
4376
|
+
max: {
|
|
4377
|
+
type: 'number',
|
|
4378
|
+
description: 'Maximum amount'
|
|
4379
|
+
}
|
|
4380
|
+
}
|
|
4381
|
+
} as const;
|
|
4382
|
+
|
|
4383
|
+
export const $TransactionRuleResponseDto = {
|
|
4384
|
+
type: 'object',
|
|
4385
|
+
properties: {
|
|
4386
|
+
id: {
|
|
4387
|
+
type: 'string',
|
|
4388
|
+
description: 'Rule ID'
|
|
4389
|
+
},
|
|
4390
|
+
name: {
|
|
4391
|
+
type: 'string',
|
|
4392
|
+
description: 'Rule name'
|
|
4393
|
+
},
|
|
4394
|
+
description: {
|
|
4395
|
+
type: 'string',
|
|
4396
|
+
description: 'Rule description'
|
|
4397
|
+
},
|
|
4398
|
+
narrationKeywords: {
|
|
4399
|
+
description: 'Keywords to match in transaction narration',
|
|
4400
|
+
type: 'array',
|
|
4401
|
+
items: {
|
|
4402
|
+
type: 'string'
|
|
4403
|
+
}
|
|
4404
|
+
},
|
|
4405
|
+
payeeKeywords: {
|
|
4406
|
+
description: 'Keywords to match in payee name',
|
|
4407
|
+
type: 'array',
|
|
4408
|
+
items: {
|
|
4409
|
+
type: 'string'
|
|
4410
|
+
}
|
|
4411
|
+
},
|
|
4412
|
+
categoryKeywords: {
|
|
4413
|
+
description: 'Keywords to match in category',
|
|
4414
|
+
type: 'array',
|
|
4415
|
+
items: {
|
|
4416
|
+
type: 'string'
|
|
4417
|
+
}
|
|
4418
|
+
},
|
|
4419
|
+
methodKeywords: {
|
|
4420
|
+
description: 'Keywords to match in payment method',
|
|
4421
|
+
type: 'array',
|
|
4422
|
+
items: {
|
|
4423
|
+
type: 'string'
|
|
4424
|
+
}
|
|
4425
|
+
},
|
|
4426
|
+
categoryAccount: {
|
|
4427
|
+
type: 'string',
|
|
4428
|
+
description: 'Destination account for categorization'
|
|
4429
|
+
},
|
|
4430
|
+
matchLogic: {
|
|
4431
|
+
type: 'string',
|
|
4432
|
+
description: 'Keyword matching logic',
|
|
4433
|
+
enum: ['OR', 'AND'],
|
|
4434
|
+
example: 'OR'
|
|
4435
|
+
},
|
|
4436
|
+
amountRange: {
|
|
4437
|
+
description: 'Amount range for matching',
|
|
4438
|
+
allOf: [
|
|
4439
|
+
{
|
|
4440
|
+
$ref: '#/components/schemas/AmountRangeDto'
|
|
4441
|
+
}
|
|
4442
|
+
]
|
|
4443
|
+
},
|
|
4444
|
+
priority: {
|
|
4445
|
+
type: 'number',
|
|
4446
|
+
description: 'Rule priority (0-1000, higher = first match)',
|
|
4447
|
+
example: 50
|
|
4448
|
+
},
|
|
4449
|
+
enabled: {
|
|
4450
|
+
type: 'boolean',
|
|
4451
|
+
description: 'Whether the rule is enabled'
|
|
4452
|
+
},
|
|
4453
|
+
learningSource: {
|
|
4454
|
+
type: 'string',
|
|
4455
|
+
description: 'Learning source: NLP, REVIEW_CENTER, or null for manual',
|
|
4456
|
+
enum: ['NLP', 'REVIEW_CENTER'],
|
|
4457
|
+
nullable: true,
|
|
4458
|
+
example: 'REVIEW_CENTER'
|
|
4459
|
+
},
|
|
4460
|
+
autoApplyEnabled: {
|
|
4461
|
+
type: 'boolean',
|
|
4462
|
+
description: 'Whether auto-apply is enabled for this rule'
|
|
4463
|
+
},
|
|
4464
|
+
confirmationCount: {
|
|
4465
|
+
type: 'number',
|
|
4466
|
+
description: 'Number of confirmations for NLP-learned rules',
|
|
4467
|
+
example: 3
|
|
4468
|
+
},
|
|
4469
|
+
additionalTags: {
|
|
4470
|
+
description: 'Additional tags',
|
|
4471
|
+
type: 'array',
|
|
4472
|
+
items: {
|
|
4473
|
+
type: 'string'
|
|
4474
|
+
}
|
|
4475
|
+
},
|
|
4476
|
+
additionalMetadata: {
|
|
4477
|
+
type: 'object',
|
|
4478
|
+
description: 'Additional metadata',
|
|
4479
|
+
additionalProperties: {
|
|
4480
|
+
type: 'string'
|
|
4481
|
+
}
|
|
4482
|
+
},
|
|
4483
|
+
createdAt: {
|
|
4484
|
+
format: 'date-time',
|
|
4485
|
+
type: 'string',
|
|
4486
|
+
description: 'Created timestamp'
|
|
4487
|
+
},
|
|
4488
|
+
updatedAt: {
|
|
4489
|
+
format: 'date-time',
|
|
4490
|
+
type: 'string',
|
|
4491
|
+
description: 'Updated timestamp'
|
|
4492
|
+
}
|
|
4493
|
+
},
|
|
4494
|
+
required: [
|
|
4495
|
+
'id',
|
|
4496
|
+
'name',
|
|
4497
|
+
'narrationKeywords',
|
|
4498
|
+
'payeeKeywords',
|
|
4499
|
+
'categoryKeywords',
|
|
4500
|
+
'methodKeywords',
|
|
4501
|
+
'matchLogic',
|
|
4502
|
+
'priority',
|
|
4503
|
+
'enabled',
|
|
4504
|
+
'autoApplyEnabled',
|
|
4505
|
+
'confirmationCount',
|
|
4506
|
+
'additionalTags',
|
|
4507
|
+
'createdAt',
|
|
4508
|
+
'updatedAt'
|
|
4509
|
+
]
|
|
4510
|
+
} as const;
|
|
4511
|
+
|
|
4512
|
+
export const $TransactionRuleListResponseDto = {
|
|
4513
|
+
type: 'object',
|
|
4514
|
+
properties: {
|
|
4515
|
+
data: {
|
|
4516
|
+
type: 'array',
|
|
4517
|
+
items: {
|
|
4518
|
+
$ref: '#/components/schemas/TransactionRuleResponseDto'
|
|
4519
|
+
}
|
|
4520
|
+
},
|
|
4521
|
+
total: {
|
|
4522
|
+
type: 'number',
|
|
4523
|
+
description: 'Total count of rules'
|
|
4524
|
+
},
|
|
4525
|
+
limit: {
|
|
4526
|
+
type: 'number',
|
|
4527
|
+
description: 'Results per page'
|
|
4528
|
+
},
|
|
4529
|
+
offset: {
|
|
4530
|
+
type: 'number',
|
|
4531
|
+
description: 'Pagination offset'
|
|
4532
|
+
}
|
|
4533
|
+
},
|
|
4534
|
+
required: ['data', 'total', 'limit', 'offset']
|
|
4535
|
+
} as const;
|
|
4536
|
+
|
|
4537
|
+
export const $ValidateRuleDto = {
|
|
4538
|
+
type: 'object',
|
|
4539
|
+
properties: {
|
|
4540
|
+
name: {
|
|
4541
|
+
type: 'string',
|
|
4542
|
+
minLength: 1,
|
|
4543
|
+
maxLength: 100
|
|
4544
|
+
},
|
|
4545
|
+
description: {
|
|
4546
|
+
type: 'string',
|
|
4547
|
+
maxLength: 500
|
|
4548
|
+
},
|
|
4549
|
+
narrationKeywords: {
|
|
4550
|
+
items: {
|
|
4551
|
+
type: 'array'
|
|
4552
|
+
},
|
|
4553
|
+
maxItems: 50,
|
|
4554
|
+
type: 'array'
|
|
4555
|
+
},
|
|
4556
|
+
payeeKeywords: {
|
|
4557
|
+
items: {
|
|
4558
|
+
type: 'array'
|
|
4559
|
+
},
|
|
4560
|
+
maxItems: 50,
|
|
4561
|
+
type: 'array'
|
|
4562
|
+
},
|
|
4563
|
+
categoryKeywords: {
|
|
4564
|
+
items: {
|
|
4565
|
+
type: 'array'
|
|
4566
|
+
},
|
|
4567
|
+
maxItems: 50,
|
|
4568
|
+
type: 'array'
|
|
4569
|
+
},
|
|
4570
|
+
methodKeywords: {
|
|
4571
|
+
items: {
|
|
4572
|
+
type: 'array'
|
|
4573
|
+
},
|
|
4574
|
+
maxItems: 50,
|
|
4575
|
+
description: 'Payment method keywords (e.g., HuaBei, YuEBao)',
|
|
4576
|
+
type: 'array'
|
|
4577
|
+
},
|
|
4578
|
+
categoryAccount: {
|
|
4579
|
+
type: 'string',
|
|
4580
|
+
maxLength: 200,
|
|
4581
|
+
description:
|
|
4582
|
+
'Destination account for expenses/income (e.g., Expenses:Food:Coffee)'
|
|
3819
4583
|
},
|
|
3820
4584
|
matchLogic: {
|
|
3821
4585
|
type: 'string',
|
|
@@ -4164,151 +4928,393 @@ export const $TestRuleResponseDto = {
|
|
|
4164
4928
|
required: ['ruleId', 'matches', 'confidence', 'matchDetails']
|
|
4165
4929
|
} as const;
|
|
4166
4930
|
|
|
4167
|
-
export const $
|
|
4931
|
+
export const $CreateBeanEventDto = {
|
|
4168
4932
|
type: 'object',
|
|
4169
4933
|
properties: {
|
|
4170
|
-
|
|
4934
|
+
date: {
|
|
4171
4935
|
type: 'string',
|
|
4172
|
-
description: '
|
|
4173
|
-
example: '
|
|
4936
|
+
description: 'Life event date (ISO 8601)',
|
|
4937
|
+
example: '2024-03-15'
|
|
4938
|
+
},
|
|
4939
|
+
type: {
|
|
4940
|
+
type: 'string',
|
|
4941
|
+
description:
|
|
4942
|
+
'Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer',
|
|
4943
|
+
example: 'employer'
|
|
4944
|
+
},
|
|
4945
|
+
description: {
|
|
4946
|
+
type: 'string',
|
|
4947
|
+
description:
|
|
4948
|
+
'Life event description. Empty string is a VALID value (distinct from absence).',
|
|
4949
|
+
example: 'Acme Corp'
|
|
4950
|
+
},
|
|
4951
|
+
meta: {
|
|
4952
|
+
type: 'object',
|
|
4953
|
+
description:
|
|
4954
|
+
'Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)',
|
|
4955
|
+
example: {
|
|
4956
|
+
note: 'Promotion'
|
|
4957
|
+
}
|
|
4174
4958
|
}
|
|
4175
4959
|
},
|
|
4176
|
-
required: ['
|
|
4960
|
+
required: ['date', 'type', 'description']
|
|
4177
4961
|
} as const;
|
|
4178
4962
|
|
|
4179
|
-
export const $
|
|
4963
|
+
export const $EventResponseDto = {
|
|
4180
4964
|
type: 'object',
|
|
4181
4965
|
properties: {
|
|
4182
|
-
|
|
4966
|
+
id: {
|
|
4967
|
+
type: 'string',
|
|
4968
|
+
description: 'Unique identifier',
|
|
4969
|
+
example: 'uuid-123-456'
|
|
4970
|
+
},
|
|
4971
|
+
userId: {
|
|
4972
|
+
type: 'string',
|
|
4973
|
+
description: 'User ID (owner of the life event)',
|
|
4974
|
+
example: 'user-123'
|
|
4975
|
+
},
|
|
4976
|
+
date: {
|
|
4977
|
+
type: 'string',
|
|
4978
|
+
description: 'Life event date (ISO 8601 format)',
|
|
4979
|
+
example: '2024-03-15',
|
|
4980
|
+
format: 'date'
|
|
4981
|
+
},
|
|
4982
|
+
type: {
|
|
4183
4983
|
type: 'string',
|
|
4184
4984
|
description:
|
|
4185
|
-
'
|
|
4186
|
-
example: '
|
|
4985
|
+
'Life event type (user-defined, e.g., "employer", "location")',
|
|
4986
|
+
example: 'employer'
|
|
4987
|
+
},
|
|
4988
|
+
description: {
|
|
4989
|
+
type: 'string',
|
|
4990
|
+
description:
|
|
4991
|
+
'Life event description. May be an empty string (a valid value distinct from absence).',
|
|
4992
|
+
example: 'Acme Corp'
|
|
4993
|
+
},
|
|
4994
|
+
meta: {
|
|
4995
|
+
type: 'object',
|
|
4996
|
+
description: 'Product-side metadata (free-form JSON)',
|
|
4997
|
+
example: {
|
|
4998
|
+
note: 'Promotion'
|
|
4999
|
+
}
|
|
5000
|
+
},
|
|
5001
|
+
createdAt: {
|
|
5002
|
+
format: 'date-time',
|
|
5003
|
+
type: 'string',
|
|
5004
|
+
description: 'Creation timestamp',
|
|
5005
|
+
example: '2024-03-15T10:00:00Z'
|
|
5006
|
+
},
|
|
5007
|
+
updatedAt: {
|
|
5008
|
+
format: 'date-time',
|
|
5009
|
+
type: 'string',
|
|
5010
|
+
description:
|
|
5011
|
+
'Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.',
|
|
5012
|
+
example: '2024-03-15T10:00:00Z'
|
|
4187
5013
|
}
|
|
4188
|
-
}
|
|
5014
|
+
},
|
|
5015
|
+
required: [
|
|
5016
|
+
'id',
|
|
5017
|
+
'userId',
|
|
5018
|
+
'date',
|
|
5019
|
+
'type',
|
|
5020
|
+
'description',
|
|
5021
|
+
'meta',
|
|
5022
|
+
'createdAt',
|
|
5023
|
+
'updatedAt'
|
|
5024
|
+
]
|
|
4189
5025
|
} as const;
|
|
4190
5026
|
|
|
4191
|
-
export const $
|
|
5027
|
+
export const $EventListResponseDto = {
|
|
4192
5028
|
type: 'object',
|
|
4193
5029
|
properties: {
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
5030
|
+
items: {
|
|
5031
|
+
description: 'List of life events',
|
|
5032
|
+
type: 'array',
|
|
5033
|
+
items: {
|
|
5034
|
+
$ref: '#/components/schemas/EventResponseDto'
|
|
5035
|
+
}
|
|
4197
5036
|
},
|
|
4198
|
-
|
|
5037
|
+
total: {
|
|
4199
5038
|
type: 'number',
|
|
4200
|
-
description: '
|
|
4201
|
-
example:
|
|
5039
|
+
description: 'Total number of life events matching the query',
|
|
5040
|
+
example: 42
|
|
5041
|
+
}
|
|
5042
|
+
},
|
|
5043
|
+
required: ['items', 'total']
|
|
5044
|
+
} as const;
|
|
5045
|
+
|
|
5046
|
+
export const $UpdateBeanEventDto = {
|
|
5047
|
+
type: 'object',
|
|
5048
|
+
properties: {
|
|
5049
|
+
date: {
|
|
5050
|
+
type: 'string',
|
|
5051
|
+
description: 'Life event date (ISO 8601)'
|
|
5052
|
+
},
|
|
5053
|
+
type: {
|
|
5054
|
+
type: 'string',
|
|
5055
|
+
description: 'Life event type (user-defined)'
|
|
5056
|
+
},
|
|
5057
|
+
description: {
|
|
5058
|
+
type: 'string',
|
|
5059
|
+
description:
|
|
5060
|
+
'Life event description. Empty string is a VALID value (distinct from absence).'
|
|
5061
|
+
},
|
|
5062
|
+
meta: {
|
|
5063
|
+
type: 'object',
|
|
5064
|
+
description: 'Product-side metadata (free-form JSON)'
|
|
5065
|
+
}
|
|
5066
|
+
}
|
|
5067
|
+
} as const;
|
|
5068
|
+
|
|
5069
|
+
export const $OnboardingAccountDto = {
|
|
5070
|
+
type: 'object',
|
|
5071
|
+
properties: {
|
|
5072
|
+
path: {
|
|
5073
|
+
type: 'string',
|
|
5074
|
+
description:
|
|
5075
|
+
'Account path (Assets/Liabilities only; format validated by the account service)',
|
|
5076
|
+
example: 'Assets:Checking'
|
|
4202
5077
|
},
|
|
4203
5078
|
currency: {
|
|
4204
5079
|
type: 'string',
|
|
4205
|
-
description: '
|
|
5080
|
+
description: 'ISO 4217 currency code (3 letters)',
|
|
4206
5081
|
example: 'USD'
|
|
4207
5082
|
},
|
|
4208
|
-
|
|
5083
|
+
openingBalance: {
|
|
4209
5084
|
type: 'string',
|
|
4210
|
-
description:
|
|
4211
|
-
|
|
5085
|
+
description:
|
|
5086
|
+
'Opening balance as a non-negative Decimal string (e.g. "1000.00")',
|
|
5087
|
+
example: '1000.00'
|
|
4212
5088
|
},
|
|
4213
|
-
|
|
5089
|
+
platformId: {
|
|
4214
5090
|
type: 'string',
|
|
4215
|
-
description:
|
|
4216
|
-
|
|
5091
|
+
description:
|
|
5092
|
+
'Platform ID to bind the account to (references Platform.id); omit for unbound',
|
|
5093
|
+
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
5094
|
+
}
|
|
5095
|
+
},
|
|
5096
|
+
required: ['path', 'currency']
|
|
5097
|
+
} as const;
|
|
5098
|
+
|
|
5099
|
+
export const $OnboardingDto = {
|
|
5100
|
+
type: 'object',
|
|
5101
|
+
properties: {
|
|
5102
|
+
accounts: {
|
|
5103
|
+
description: 'Asset/Liability accounts to register with opening balances',
|
|
5104
|
+
type: 'array',
|
|
5105
|
+
items: {
|
|
5106
|
+
$ref: '#/components/schemas/OnboardingAccountDto'
|
|
5107
|
+
}
|
|
4217
5108
|
},
|
|
4218
|
-
|
|
5109
|
+
skipAssetRegistration: {
|
|
5110
|
+
type: 'boolean',
|
|
5111
|
+
description:
|
|
5112
|
+
'Skip asset registration; only bootstrap the core account set',
|
|
5113
|
+
default: false
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
5116
|
+
} as const;
|
|
5117
|
+
|
|
5118
|
+
export const $ActualBalanceDto = {
|
|
5119
|
+
type: 'object',
|
|
5120
|
+
properties: {
|
|
5121
|
+
amount: {
|
|
4219
5122
|
type: 'string',
|
|
4220
|
-
description:
|
|
4221
|
-
|
|
5123
|
+
description:
|
|
5124
|
+
'Actual balance amount as a decimal string (preserves precision for tolerance inference).',
|
|
5125
|
+
example: '1234.56'
|
|
5126
|
+
},
|
|
5127
|
+
ccy: {
|
|
5128
|
+
type: 'string',
|
|
5129
|
+
description: 'Currency code (ISO 4217 or commodity ticker).',
|
|
5130
|
+
example: 'CNY'
|
|
5131
|
+
}
|
|
5132
|
+
},
|
|
5133
|
+
required: ['amount', 'ccy']
|
|
5134
|
+
} as const;
|
|
5135
|
+
|
|
5136
|
+
export const $ComputeReconciliationDto = {
|
|
5137
|
+
type: 'object',
|
|
5138
|
+
properties: {
|
|
5139
|
+
accountId: {
|
|
5140
|
+
type: 'string',
|
|
5141
|
+
description: 'BeanAccount id to reconcile.'
|
|
5142
|
+
},
|
|
5143
|
+
asOfDate: {
|
|
5144
|
+
type: 'string',
|
|
5145
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5146
|
+
example: '2026-07-24'
|
|
5147
|
+
},
|
|
5148
|
+
actualBalance: {
|
|
5149
|
+
description: 'Actual balance from the external statement.',
|
|
5150
|
+
allOf: [
|
|
5151
|
+
{
|
|
5152
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5153
|
+
}
|
|
5154
|
+
]
|
|
5155
|
+
}
|
|
5156
|
+
},
|
|
5157
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
5158
|
+
} as const;
|
|
5159
|
+
|
|
5160
|
+
export const $ReconciliationComputeResultDto = {
|
|
5161
|
+
type: 'object',
|
|
5162
|
+
properties: {
|
|
5163
|
+
accountId: {
|
|
5164
|
+
type: 'string'
|
|
5165
|
+
},
|
|
5166
|
+
asOfDate: {
|
|
5167
|
+
type: 'string'
|
|
5168
|
+
},
|
|
5169
|
+
bookBalance: {
|
|
5170
|
+
type: 'string',
|
|
5171
|
+
description: 'System-computed book balance (decimal string).'
|
|
5172
|
+
},
|
|
5173
|
+
actualBalance: {
|
|
5174
|
+
type: 'string',
|
|
5175
|
+
description: 'User-entered actual balance (decimal string).'
|
|
5176
|
+
},
|
|
5177
|
+
currency: {
|
|
5178
|
+
type: 'string'
|
|
4222
5179
|
},
|
|
4223
|
-
|
|
5180
|
+
diff: {
|
|
4224
5181
|
type: 'string',
|
|
4225
|
-
description: '
|
|
4226
|
-
example: '1y'
|
|
4227
|
-
},
|
|
4228
|
-
emergencyFund: {
|
|
4229
|
-
type: 'number',
|
|
4230
|
-
description: 'Emergency fund amount',
|
|
4231
|
-
example: 10000
|
|
5182
|
+
description: 'Diff = book − actual (decimal string).'
|
|
4232
5183
|
},
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
items: {
|
|
4237
|
-
type: 'string'
|
|
4238
|
-
}
|
|
5184
|
+
tolerance: {
|
|
5185
|
+
type: 'string',
|
|
5186
|
+
description: 'Applied tolerance (decimal string).'
|
|
4239
5187
|
},
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
items: {
|
|
4244
|
-
type: 'string'
|
|
4245
|
-
}
|
|
5188
|
+
withinTolerance: {
|
|
5189
|
+
type: 'boolean',
|
|
5190
|
+
description: 'true when |diff| ≤ tolerance.'
|
|
4246
5191
|
},
|
|
4247
|
-
|
|
5192
|
+
suggestedAction: {
|
|
4248
5193
|
type: 'string',
|
|
4249
|
-
|
|
5194
|
+
enum: ['assert', 'pad'],
|
|
5195
|
+
description:
|
|
5196
|
+
'Suggested next action: assert when within tolerance, pad otherwise.'
|
|
5197
|
+
}
|
|
5198
|
+
},
|
|
5199
|
+
required: [
|
|
5200
|
+
'accountId',
|
|
5201
|
+
'asOfDate',
|
|
5202
|
+
'bookBalance',
|
|
5203
|
+
'actualBalance',
|
|
5204
|
+
'currency',
|
|
5205
|
+
'diff',
|
|
5206
|
+
'tolerance',
|
|
5207
|
+
'withinTolerance',
|
|
5208
|
+
'suggestedAction'
|
|
5209
|
+
]
|
|
5210
|
+
} as const;
|
|
5211
|
+
|
|
5212
|
+
export const $AssertReconciliationDto = {
|
|
5213
|
+
type: 'object',
|
|
5214
|
+
properties: {
|
|
5215
|
+
accountId: {
|
|
5216
|
+
type: 'string',
|
|
5217
|
+
description: 'BeanAccount id to reconcile.'
|
|
4250
5218
|
},
|
|
4251
|
-
|
|
5219
|
+
asOfDate: {
|
|
4252
5220
|
type: 'string',
|
|
4253
|
-
description: '
|
|
5221
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5222
|
+
example: '2026-07-24'
|
|
4254
5223
|
},
|
|
4255
|
-
|
|
4256
|
-
description: '
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
5224
|
+
actualBalance: {
|
|
5225
|
+
description: 'Actual balance from the external statement.',
|
|
5226
|
+
allOf: [
|
|
5227
|
+
{
|
|
5228
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5229
|
+
}
|
|
5230
|
+
]
|
|
4261
5231
|
},
|
|
4262
|
-
|
|
4263
|
-
type: '
|
|
4264
|
-
description:
|
|
5232
|
+
tolerance: {
|
|
5233
|
+
type: 'string',
|
|
5234
|
+
description:
|
|
5235
|
+
'Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).',
|
|
5236
|
+
example: '0.01'
|
|
5237
|
+
}
|
|
5238
|
+
},
|
|
5239
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
5240
|
+
} as const;
|
|
5241
|
+
|
|
5242
|
+
export const $ReconciliationRecordDto = {
|
|
5243
|
+
type: 'object',
|
|
5244
|
+
properties: {
|
|
5245
|
+
id: {
|
|
5246
|
+
type: 'string'
|
|
4265
5247
|
},
|
|
4266
|
-
|
|
4267
|
-
type: '
|
|
4268
|
-
description: 'Enable restricted view mode'
|
|
5248
|
+
accountId: {
|
|
5249
|
+
type: 'string'
|
|
4269
5250
|
},
|
|
4270
|
-
|
|
5251
|
+
date: {
|
|
5252
|
+
type: 'string'
|
|
5253
|
+
},
|
|
5254
|
+
amount: {
|
|
4271
5255
|
type: 'string',
|
|
4272
|
-
description: '
|
|
4273
|
-
example: 'en'
|
|
5256
|
+
description: 'Asserted (actual) amount.'
|
|
4274
5257
|
},
|
|
4275
|
-
|
|
5258
|
+
currency: {
|
|
5259
|
+
type: 'string'
|
|
5260
|
+
},
|
|
5261
|
+
tolerance: {
|
|
5262
|
+
type: 'string'
|
|
5263
|
+
},
|
|
5264
|
+
diffAmount: {
|
|
4276
5265
|
type: 'string',
|
|
4277
|
-
description: '
|
|
4278
|
-
example: 'en-US'
|
|
5266
|
+
description: 'book − actual.'
|
|
4279
5267
|
},
|
|
4280
|
-
|
|
4281
|
-
type: '
|
|
4282
|
-
description: 'Projected total amount',
|
|
4283
|
-
example: 1000000
|
|
5268
|
+
diffCurrency: {
|
|
5269
|
+
type: 'string'
|
|
4284
5270
|
},
|
|
4285
|
-
|
|
5271
|
+
createdAt: {
|
|
5272
|
+
type: 'string'
|
|
5273
|
+
}
|
|
5274
|
+
},
|
|
5275
|
+
required: ['id', 'accountId', 'date', 'amount', 'currency', 'createdAt']
|
|
5276
|
+
} as const;
|
|
5277
|
+
|
|
5278
|
+
export const $PadReconciliationDto = {
|
|
5279
|
+
type: 'object',
|
|
5280
|
+
properties: {
|
|
5281
|
+
accountId: {
|
|
4286
5282
|
type: 'string',
|
|
4287
|
-
description: '
|
|
4288
|
-
example: '2050-01-01'
|
|
5283
|
+
description: 'BeanAccount id to reconcile.'
|
|
4289
5284
|
},
|
|
4290
|
-
|
|
4291
|
-
type: '
|
|
4292
|
-
description: '
|
|
4293
|
-
example:
|
|
5285
|
+
asOfDate: {
|
|
5286
|
+
type: 'string',
|
|
5287
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
5288
|
+
example: '2026-07-24'
|
|
4294
5289
|
},
|
|
4295
|
-
|
|
5290
|
+
actualBalance: {
|
|
5291
|
+
description: 'Actual balance from the external statement.',
|
|
5292
|
+
allOf: [
|
|
5293
|
+
{
|
|
5294
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
5295
|
+
}
|
|
5296
|
+
]
|
|
5297
|
+
},
|
|
5298
|
+
sourceAccount: {
|
|
4296
5299
|
type: 'string',
|
|
4297
|
-
description:
|
|
4298
|
-
|
|
5300
|
+
description:
|
|
5301
|
+
'Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).',
|
|
5302
|
+
example: 'Equity:Opening-Balances',
|
|
5303
|
+
default: 'Equity:Opening-Balances'
|
|
4299
5304
|
}
|
|
4300
|
-
}
|
|
5305
|
+
},
|
|
5306
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
4301
5307
|
} as const;
|
|
4302
5308
|
|
|
4303
|
-
export const $
|
|
5309
|
+
export const $PadResultDto = {
|
|
4304
5310
|
type: 'object',
|
|
4305
5311
|
properties: {
|
|
4306
|
-
|
|
5312
|
+
transactionId: {
|
|
4307
5313
|
type: 'string',
|
|
4308
|
-
description: '
|
|
5314
|
+
description: 'Created pad adjusting transaction id.'
|
|
4309
5315
|
}
|
|
4310
5316
|
},
|
|
4311
|
-
required: ['
|
|
5317
|
+
required: ['transactionId']
|
|
4312
5318
|
} as const;
|
|
4313
5319
|
|
|
4314
5320
|
export const $FileImportDto = {
|
|
@@ -4477,7 +5483,7 @@ export const $IdentifyResultDto = {
|
|
|
4477
5483
|
account: {
|
|
4478
5484
|
type: 'string',
|
|
4479
5485
|
description: 'Default account used by this importer',
|
|
4480
|
-
example: 'Assets:Alipay:Balance'
|
|
5486
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4481
5487
|
},
|
|
4482
5488
|
message: {
|
|
4483
5489
|
type: 'string',
|
|
@@ -4494,7 +5500,7 @@ export const $MapperDefaultsDto = {
|
|
|
4494
5500
|
sourceAccount: {
|
|
4495
5501
|
type: 'string',
|
|
4496
5502
|
description: 'Source account for transactions (Beancount format)',
|
|
4497
|
-
example: 'Assets:Alipay:Balance'
|
|
5503
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4498
5504
|
},
|
|
4499
5505
|
currency: {
|
|
4500
5506
|
type: 'string',
|
|
@@ -4531,7 +5537,7 @@ export const $MapperDefaultsDto = {
|
|
|
4531
5537
|
description:
|
|
4532
5538
|
'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
|
|
4533
5539
|
example: {
|
|
4534
|
-
HuaBei: 'Liabilities:
|
|
5540
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
4535
5541
|
CreditCard: 'Liabilities:CreditCard'
|
|
4536
5542
|
}
|
|
4537
5543
|
}
|
|
@@ -4663,8 +5669,9 @@ export const $UpdateMapperDefaultsDto = {
|
|
|
4663
5669
|
sourceAccount: {
|
|
4664
5670
|
type: 'string',
|
|
4665
5671
|
description: 'Source account for transactions (Beancount format)',
|
|
4666
|
-
example: 'Assets:Alipay:Balance',
|
|
4667
|
-
pattern:
|
|
5672
|
+
example: 'Assets:CN:Alipay:Balance',
|
|
5673
|
+
pattern:
|
|
5674
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4668
5675
|
},
|
|
4669
5676
|
currency: {
|
|
4670
5677
|
type: 'string',
|
|
@@ -4678,20 +5685,22 @@ export const $UpdateMapperDefaultsDto = {
|
|
|
4678
5685
|
type: 'string',
|
|
4679
5686
|
description: 'Default expense account (optional)',
|
|
4680
5687
|
example: 'Expenses:Unknown',
|
|
4681
|
-
pattern:
|
|
5688
|
+
pattern:
|
|
5689
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4682
5690
|
},
|
|
4683
5691
|
incomeAccount: {
|
|
4684
5692
|
type: 'string',
|
|
4685
5693
|
description: 'Default income account (optional)',
|
|
4686
5694
|
example: 'Income:Unknown',
|
|
4687
|
-
pattern:
|
|
5695
|
+
pattern:
|
|
5696
|
+
'^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
|
|
4688
5697
|
},
|
|
4689
5698
|
methodAccountMapping: {
|
|
4690
5699
|
type: 'object',
|
|
4691
5700
|
description:
|
|
4692
5701
|
'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
|
|
4693
5702
|
example: {
|
|
4694
|
-
HuaBei: 'Liabilities:
|
|
5703
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
4695
5704
|
CreditCard: 'Liabilities:CreditCard'
|
|
4696
5705
|
}
|
|
4697
5706
|
}
|
|
@@ -4726,119 +5735,13 @@ export const $UpdateImporterConfigDto = {
|
|
|
4726
5735
|
}
|
|
4727
5736
|
} as const;
|
|
4728
5737
|
|
|
4729
|
-
export const $CreatePlatformDto = {
|
|
4730
|
-
type: 'object',
|
|
4731
|
-
properties: {
|
|
4732
|
-
name: {
|
|
4733
|
-
type: 'string',
|
|
4734
|
-
description: 'Platform name',
|
|
4735
|
-
example: 'Binance'
|
|
4736
|
-
},
|
|
4737
|
-
canonical: {
|
|
4738
|
-
type: 'string',
|
|
4739
|
-
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
4740
|
-
example: 'binance'
|
|
4741
|
-
},
|
|
4742
|
-
aliases: {
|
|
4743
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4744
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4745
|
-
type: 'array',
|
|
4746
|
-
items: {
|
|
4747
|
-
type: 'string'
|
|
4748
|
-
}
|
|
4749
|
-
},
|
|
4750
|
-
url: {
|
|
4751
|
-
type: 'string',
|
|
4752
|
-
description: 'Platform URL',
|
|
4753
|
-
example: 'https://www.binance.com'
|
|
4754
|
-
},
|
|
4755
|
-
type: {
|
|
4756
|
-
type: 'string',
|
|
4757
|
-
description: 'Platform type',
|
|
4758
|
-
enum: [
|
|
4759
|
-
'BANK',
|
|
4760
|
-
'BROKERAGE',
|
|
4761
|
-
'CRYPTO_EXCHANGE',
|
|
4762
|
-
'PAYMENT',
|
|
4763
|
-
'INVESTMENT',
|
|
4764
|
-
'INSURANCE',
|
|
4765
|
-
'OTHER'
|
|
4766
|
-
],
|
|
4767
|
-
example: 'CRYPTO_EXCHANGE'
|
|
4768
|
-
},
|
|
4769
|
-
logoUrl: {
|
|
4770
|
-
type: 'string',
|
|
4771
|
-
description: 'Platform logo URL',
|
|
4772
|
-
example: 'https://example.com/logos/binance.png'
|
|
4773
|
-
},
|
|
4774
|
-
isActive: {
|
|
4775
|
-
type: 'boolean',
|
|
4776
|
-
description: 'Whether the platform is active',
|
|
4777
|
-
default: true
|
|
4778
|
-
}
|
|
4779
|
-
},
|
|
4780
|
-
required: ['name', 'canonical', 'aliases', 'url', 'type']
|
|
4781
|
-
} as const;
|
|
4782
|
-
|
|
4783
|
-
export const $UpdatePlatformDto = {
|
|
4784
|
-
type: 'object',
|
|
4785
|
-
properties: {
|
|
4786
|
-
name: {
|
|
4787
|
-
type: 'string',
|
|
4788
|
-
description: 'Platform name',
|
|
4789
|
-
example: 'Binance'
|
|
4790
|
-
},
|
|
4791
|
-
canonical: {
|
|
4792
|
-
type: 'string',
|
|
4793
|
-
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
4794
|
-
example: 'binance'
|
|
4795
|
-
},
|
|
4796
|
-
aliases: {
|
|
4797
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4798
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4799
|
-
type: 'array',
|
|
4800
|
-
items: {
|
|
4801
|
-
type: 'string'
|
|
4802
|
-
}
|
|
4803
|
-
},
|
|
4804
|
-
url: {
|
|
4805
|
-
type: 'string',
|
|
4806
|
-
description: 'Platform URL',
|
|
4807
|
-
example: 'https://www.binance.com'
|
|
4808
|
-
},
|
|
4809
|
-
type: {
|
|
4810
|
-
type: 'string',
|
|
4811
|
-
description: 'Platform type',
|
|
4812
|
-
enum: [
|
|
4813
|
-
'BANK',
|
|
4814
|
-
'BROKERAGE',
|
|
4815
|
-
'CRYPTO_EXCHANGE',
|
|
4816
|
-
'PAYMENT',
|
|
4817
|
-
'INVESTMENT',
|
|
4818
|
-
'INSURANCE',
|
|
4819
|
-
'OTHER'
|
|
4820
|
-
],
|
|
4821
|
-
example: 'CRYPTO_EXCHANGE'
|
|
4822
|
-
},
|
|
4823
|
-
logoUrl: {
|
|
4824
|
-
type: 'string',
|
|
4825
|
-
description: 'Platform logo URL',
|
|
4826
|
-
example: 'https://example.com/logos/binance.png'
|
|
4827
|
-
},
|
|
4828
|
-
isActive: {
|
|
4829
|
-
type: 'boolean',
|
|
4830
|
-
description: 'Whether the platform is active'
|
|
4831
|
-
}
|
|
4832
|
-
}
|
|
4833
|
-
} as const;
|
|
4834
|
-
|
|
4835
5738
|
export const $ProviderSyncConfigDto = {
|
|
4836
5739
|
type: 'object',
|
|
4837
5740
|
properties: {
|
|
4838
5741
|
sourceAccount: {
|
|
4839
5742
|
type: 'string',
|
|
4840
5743
|
description: 'Source account for the first posting',
|
|
4841
|
-
example: 'Assets:
|
|
5744
|
+
example: 'Assets:US:Chase:Checking'
|
|
4842
5745
|
},
|
|
4843
5746
|
defaultCurrency: {
|
|
4844
5747
|
type: 'string',
|
|
@@ -4847,26 +5750,29 @@ export const $ProviderSyncConfigDto = {
|
|
|
4847
5750
|
},
|
|
4848
5751
|
defaultExpenseAccount: {
|
|
4849
5752
|
type: 'string',
|
|
4850
|
-
description:
|
|
5753
|
+
description:
|
|
5754
|
+
'Default expense account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
|
|
4851
5755
|
example: 'Expenses:Unknown'
|
|
4852
5756
|
},
|
|
4853
5757
|
defaultIncomeAccount: {
|
|
4854
5758
|
type: 'string',
|
|
4855
|
-
description:
|
|
5759
|
+
description:
|
|
5760
|
+
'Default income account for the second posting. Omit when no real default exists; the pipeline routes to Review via the Uncategorized sentinel (#618).',
|
|
4856
5761
|
example: 'Income:Unknown'
|
|
4857
5762
|
},
|
|
4858
5763
|
filterPending: {
|
|
4859
5764
|
type: 'boolean',
|
|
4860
5765
|
description: 'Filter pending transactions',
|
|
4861
5766
|
default: true
|
|
5767
|
+
},
|
|
5768
|
+
externalAccountId: {
|
|
5769
|
+
type: 'string',
|
|
5770
|
+
description:
|
|
5771
|
+
'External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.',
|
|
5772
|
+
example: 'acc_gocardless_001'
|
|
4862
5773
|
}
|
|
4863
5774
|
},
|
|
4864
|
-
required: [
|
|
4865
|
-
'sourceAccount',
|
|
4866
|
-
'defaultCurrency',
|
|
4867
|
-
'defaultExpenseAccount',
|
|
4868
|
-
'defaultIncomeAccount'
|
|
4869
|
-
]
|
|
5775
|
+
required: ['sourceAccount', 'defaultCurrency']
|
|
4870
5776
|
} as const;
|
|
4871
5777
|
|
|
4872
5778
|
export const $ProviderSyncDto = {
|
|
@@ -4971,11 +5877,99 @@ export const $SupportedProvidersResponseDto = {
|
|
|
4971
5877
|
],
|
|
4972
5878
|
type: 'array',
|
|
4973
5879
|
items: {
|
|
4974
|
-
type: 'string'
|
|
5880
|
+
type: 'string'
|
|
5881
|
+
}
|
|
5882
|
+
}
|
|
5883
|
+
},
|
|
5884
|
+
required: ['providers']
|
|
5885
|
+
} as const;
|
|
5886
|
+
|
|
5887
|
+
export const $CreateExternalAccountLinkDto = {
|
|
5888
|
+
type: 'object',
|
|
5889
|
+
properties: {
|
|
5890
|
+
provider: {
|
|
5891
|
+
type: 'string',
|
|
5892
|
+
enum: [
|
|
5893
|
+
'plaid',
|
|
5894
|
+
'teller',
|
|
5895
|
+
'truelayer',
|
|
5896
|
+
'gocardless',
|
|
5897
|
+
'simplefin',
|
|
5898
|
+
'yodlee',
|
|
5899
|
+
'beancount-direct',
|
|
5900
|
+
'parsed-bill'
|
|
5901
|
+
],
|
|
5902
|
+
example: 'plaid',
|
|
5903
|
+
description: 'Open Banking provider (whitelist)'
|
|
5904
|
+
},
|
|
5905
|
+
externalAccountId: {
|
|
5906
|
+
type: 'string',
|
|
5907
|
+
example: 'acc-plaid-001',
|
|
5908
|
+
description: 'External account ID from the provider'
|
|
5909
|
+
},
|
|
5910
|
+
beanAccountId: {
|
|
5911
|
+
type: 'string',
|
|
5912
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
5913
|
+
description: 'Target BeanAccount ID (must belong to the JWT user)'
|
|
5914
|
+
}
|
|
5915
|
+
},
|
|
5916
|
+
required: ['provider', 'externalAccountId', 'beanAccountId']
|
|
5917
|
+
} as const;
|
|
5918
|
+
|
|
5919
|
+
export const $ExternalAccountLinkResponseDto = {
|
|
5920
|
+
type: 'object',
|
|
5921
|
+
properties: {
|
|
5922
|
+
id: {
|
|
5923
|
+
type: 'string'
|
|
5924
|
+
},
|
|
5925
|
+
provider: {
|
|
5926
|
+
type: 'string'
|
|
5927
|
+
},
|
|
5928
|
+
externalAccountId: {
|
|
5929
|
+
type: 'string'
|
|
5930
|
+
},
|
|
5931
|
+
beanAccountId: {
|
|
5932
|
+
type: 'string'
|
|
5933
|
+
},
|
|
5934
|
+
isActive: {
|
|
5935
|
+
type: 'boolean'
|
|
5936
|
+
},
|
|
5937
|
+
createdAt: {
|
|
5938
|
+
type: 'string'
|
|
5939
|
+
},
|
|
5940
|
+
updatedAt: {
|
|
5941
|
+
type: 'string'
|
|
5942
|
+
}
|
|
5943
|
+
},
|
|
5944
|
+
required: [
|
|
5945
|
+
'id',
|
|
5946
|
+
'provider',
|
|
5947
|
+
'externalAccountId',
|
|
5948
|
+
'beanAccountId',
|
|
5949
|
+
'isActive',
|
|
5950
|
+
'createdAt',
|
|
5951
|
+
'updatedAt'
|
|
5952
|
+
]
|
|
5953
|
+
} as const;
|
|
5954
|
+
|
|
5955
|
+
export const $ExternalAccountLinkListResponseDto = {
|
|
5956
|
+
type: 'object',
|
|
5957
|
+
properties: {
|
|
5958
|
+
items: {
|
|
5959
|
+
type: 'array',
|
|
5960
|
+
items: {
|
|
5961
|
+
$ref: '#/components/schemas/ExternalAccountLinkResponseDto'
|
|
4975
5962
|
}
|
|
5963
|
+
},
|
|
5964
|
+
total: {
|
|
5965
|
+
type: 'number'
|
|
5966
|
+
},
|
|
5967
|
+
provider: {
|
|
5968
|
+
type: 'string',
|
|
5969
|
+
description: 'Filter by provider (query param)'
|
|
4976
5970
|
}
|
|
4977
5971
|
},
|
|
4978
|
-
required: ['
|
|
5972
|
+
required: ['items', 'total']
|
|
4979
5973
|
} as const;
|
|
4980
5974
|
|
|
4981
5975
|
export const $ParserTelemetryReportDto = {
|
|
@@ -4993,10 +5987,17 @@ export const $ProcessNlpDto = {
|
|
|
4993
5987
|
properties: {
|
|
4994
5988
|
message: {
|
|
4995
5989
|
type: 'string',
|
|
4996
|
-
description:
|
|
4997
|
-
|
|
5990
|
+
description:
|
|
5991
|
+
'Natural language text describing a transaction. Optional when `confirm` is true (structured confirm); otherwise required.',
|
|
5992
|
+
example: 'Starbucks 35',
|
|
4998
5993
|
maxLength: 500
|
|
4999
5994
|
},
|
|
5995
|
+
confirm: {
|
|
5996
|
+
type: 'boolean',
|
|
5997
|
+
description:
|
|
5998
|
+
'Structured confirm signal — bypasses NL confirm-word matching when true. Send parsedData field edits alongside. The NL word-list path is the fallback.',
|
|
5999
|
+
example: true
|
|
6000
|
+
},
|
|
5000
6001
|
sessionId: {
|
|
5001
6002
|
type: 'string',
|
|
5002
6003
|
description:
|
|
@@ -5012,9 +6013,20 @@ export const $ProcessNlpDto = {
|
|
|
5012
6013
|
currency: 'CNY',
|
|
5013
6014
|
payee: 'Starbucks'
|
|
5014
6015
|
}
|
|
6016
|
+
},
|
|
6017
|
+
selectedRuleId: {
|
|
6018
|
+
type: 'string',
|
|
6019
|
+
description:
|
|
6020
|
+
'confirm_rule echo-back: rule id selected from the prior confirm_rule response (matchedRule.id or alternatives[i].ruleId). Applied directly when the session is confirming_rule — no NL re-parse.',
|
|
6021
|
+
example: 'rule_abc123'
|
|
6022
|
+
},
|
|
6023
|
+
selectedAccount: {
|
|
6024
|
+
type: 'string',
|
|
6025
|
+
description:
|
|
6026
|
+
'confirm_account echo-back: account path selected from the prior confirm_account response (suggestedAccount, similarAccounts[i], or a typed path). Applied directly when the session is confirming_account — no NL re-parse.',
|
|
6027
|
+
example: 'Expenses:Food:Coffee'
|
|
5015
6028
|
}
|
|
5016
|
-
}
|
|
5017
|
-
required: ['message']
|
|
6029
|
+
}
|
|
5018
6030
|
} as const;
|
|
5019
6031
|
|
|
5020
6032
|
export const $NlpTransactionInfoDto = {
|
|
@@ -5336,7 +6348,8 @@ export const $NlpAccountConfirmationDataDto = {
|
|
|
5336
6348
|
},
|
|
5337
6349
|
suggestedAccount: {
|
|
5338
6350
|
type: 'string',
|
|
5339
|
-
description:
|
|
6351
|
+
description:
|
|
6352
|
+
'Suggested replacement account (omitted when no clear candidate)',
|
|
5340
6353
|
example: 'Expenses:Food:Drinks'
|
|
5341
6354
|
},
|
|
5342
6355
|
similarAccounts: {
|
|
@@ -5358,7 +6371,6 @@ export const $NlpAccountConfirmationDataDto = {
|
|
|
5358
6371
|
},
|
|
5359
6372
|
required: [
|
|
5360
6373
|
'invalidAccount',
|
|
5361
|
-
'suggestedAccount',
|
|
5362
6374
|
'similarAccounts',
|
|
5363
6375
|
'errorMessage',
|
|
5364
6376
|
'transactionContext'
|
|
@@ -5527,11 +6539,12 @@ export const $NlpSuggestedAccountDto = {
|
|
|
5527
6539
|
account: {
|
|
5528
6540
|
type: 'string',
|
|
5529
6541
|
description: 'Suggested account path',
|
|
5530
|
-
example: 'Assets:
|
|
6542
|
+
example: 'Assets:Checking'
|
|
5531
6543
|
},
|
|
5532
6544
|
confidence: {
|
|
5533
6545
|
type: 'number',
|
|
5534
|
-
description:
|
|
6546
|
+
description:
|
|
6547
|
+
'Confidence score for this suggestion (0-1). Present = predicted (confirm/confirm_rule/confirm_account); omitted = actual persisted account (created). (#586)',
|
|
5535
6548
|
example: 0.9
|
|
5536
6549
|
}
|
|
5537
6550
|
},
|
|
@@ -5567,23 +6580,31 @@ export const $NlpDefaultAccountsDto = {
|
|
|
5567
6580
|
properties: {
|
|
5568
6581
|
asset: {
|
|
5569
6582
|
type: 'string',
|
|
5570
|
-
description:
|
|
5571
|
-
|
|
6583
|
+
description:
|
|
6584
|
+
'Default OPEN asset account (MRU when multiple), or null when none/ambiguous',
|
|
6585
|
+
example: 'Assets:Checking',
|
|
6586
|
+
nullable: true
|
|
5572
6587
|
},
|
|
5573
6588
|
expense: {
|
|
5574
6589
|
type: 'string',
|
|
5575
|
-
description:
|
|
5576
|
-
|
|
6590
|
+
description:
|
|
6591
|
+
'Default OPEN expense account (MRU when multiple), or null when none/ambiguous',
|
|
6592
|
+
example: 'Expenses:Food:Coffee',
|
|
6593
|
+
nullable: true
|
|
5577
6594
|
},
|
|
5578
6595
|
income: {
|
|
5579
6596
|
type: 'string',
|
|
5580
|
-
description:
|
|
5581
|
-
|
|
6597
|
+
description:
|
|
6598
|
+
'Default OPEN income account (MRU when multiple), or null when none/ambiguous',
|
|
6599
|
+
example: 'Income:Salary',
|
|
6600
|
+
nullable: true
|
|
5582
6601
|
},
|
|
5583
6602
|
liability: {
|
|
5584
6603
|
type: 'string',
|
|
5585
|
-
description:
|
|
5586
|
-
|
|
6604
|
+
description:
|
|
6605
|
+
'Default OPEN liability account (MRU when multiple), or null when none/ambiguous',
|
|
6606
|
+
example: 'Liabilities:CreditCard',
|
|
6607
|
+
nullable: true
|
|
5587
6608
|
}
|
|
5588
6609
|
},
|
|
5589
6610
|
required: ['asset', 'expense', 'income', 'liability']
|
|
@@ -5608,7 +6629,8 @@ export const $NlpResponseDto = {
|
|
|
5608
6629
|
'confirm_rule',
|
|
5609
6630
|
'confirm_account',
|
|
5610
6631
|
'confirm_payee',
|
|
5611
|
-
'cancel'
|
|
6632
|
+
'cancel',
|
|
6633
|
+
'aborted'
|
|
5612
6634
|
]
|
|
5613
6635
|
},
|
|
5614
6636
|
intent: {
|
|
@@ -5770,7 +6792,7 @@ export const $NlpResponseDto = {
|
|
|
5770
6792
|
},
|
|
5771
6793
|
suggestedAccounts: {
|
|
5772
6794
|
description:
|
|
5773
|
-
'Suggested accounts for this transaction.
|
|
6795
|
+
'Suggested accounts for this transaction (#586). confirm/confirm_rule/confirm_account: predicted (source/destination carry confidence); created: actual persisted accounts (confidence omitted). confirm_account destination is the suggested replacement, never the invalid account.',
|
|
5774
6796
|
allOf: [
|
|
5775
6797
|
{
|
|
5776
6798
|
$ref: '#/components/schemas/NlpSuggestedAccountsDto'
|
|
@@ -5779,7 +6801,7 @@ export const $NlpResponseDto = {
|
|
|
5779
6801
|
},
|
|
5780
6802
|
defaultAccounts: {
|
|
5781
6803
|
description:
|
|
5782
|
-
'Default accounts for the user/region.
|
|
6804
|
+
'Default fallback accounts for the user/region (#586). v1 returns universal constants; per-user personalization is planned.',
|
|
5783
6805
|
allOf: [
|
|
5784
6806
|
{
|
|
5785
6807
|
$ref: '#/components/schemas/NlpDefaultAccountsDto'
|
|
@@ -5787,24 +6809,285 @@ export const $NlpResponseDto = {
|
|
|
5787
6809
|
]
|
|
5788
6810
|
}
|
|
5789
6811
|
},
|
|
5790
|
-
required: ['status', 'action']
|
|
6812
|
+
required: ['status', 'action']
|
|
6813
|
+
} as const;
|
|
6814
|
+
|
|
6815
|
+
export const $PlatformListItemDto = {
|
|
6816
|
+
type: 'object',
|
|
6817
|
+
properties: {
|
|
6818
|
+
id: {
|
|
6819
|
+
type: 'string',
|
|
6820
|
+
description: 'Global platform ID'
|
|
6821
|
+
},
|
|
6822
|
+
name: {
|
|
6823
|
+
type: 'string',
|
|
6824
|
+
description: 'Platform name'
|
|
6825
|
+
},
|
|
6826
|
+
url: {
|
|
6827
|
+
type: 'string',
|
|
6828
|
+
description: 'Platform URL'
|
|
6829
|
+
},
|
|
6830
|
+
type: {
|
|
6831
|
+
type: 'string',
|
|
6832
|
+
description: 'Platform type',
|
|
6833
|
+
enum: [
|
|
6834
|
+
'BANK',
|
|
6835
|
+
'BROKERAGE',
|
|
6836
|
+
'CRYPTO_EXCHANGE',
|
|
6837
|
+
'PAYMENT',
|
|
6838
|
+
'INVESTMENT',
|
|
6839
|
+
'INSURANCE',
|
|
6840
|
+
'OTHER'
|
|
6841
|
+
]
|
|
6842
|
+
},
|
|
6843
|
+
canonical: {
|
|
6844
|
+
type: 'string',
|
|
6845
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
6846
|
+
},
|
|
6847
|
+
suggestedSegment: {
|
|
6848
|
+
type: 'string',
|
|
6849
|
+
description:
|
|
6850
|
+
'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
|
|
6851
|
+
},
|
|
6852
|
+
logoUrl: {
|
|
6853
|
+
type: 'string',
|
|
6854
|
+
description: 'Logo URL',
|
|
6855
|
+
nullable: true
|
|
6856
|
+
},
|
|
6857
|
+
countryCode: {
|
|
6858
|
+
type: 'string',
|
|
6859
|
+
description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
|
|
6860
|
+
example: 'CN',
|
|
6861
|
+
nullable: true
|
|
6862
|
+
},
|
|
6863
|
+
category: {
|
|
6864
|
+
type: 'string',
|
|
6865
|
+
description:
|
|
6866
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
6867
|
+
nullable: true,
|
|
6868
|
+
example: 'DigitalWallet'
|
|
6869
|
+
},
|
|
6870
|
+
isBound: {
|
|
6871
|
+
type: 'boolean',
|
|
6872
|
+
description: 'Whether user has accounts using this platform'
|
|
6873
|
+
}
|
|
6874
|
+
},
|
|
6875
|
+
required: [
|
|
6876
|
+
'id',
|
|
6877
|
+
'name',
|
|
6878
|
+
'url',
|
|
6879
|
+
'type',
|
|
6880
|
+
'canonical',
|
|
6881
|
+
'suggestedSegment',
|
|
6882
|
+
'logoUrl',
|
|
6883
|
+
'countryCode',
|
|
6884
|
+
'category',
|
|
6885
|
+
'isBound'
|
|
6886
|
+
]
|
|
6887
|
+
} as const;
|
|
6888
|
+
|
|
6889
|
+
export const $PlatformMatchResultDto = {
|
|
6890
|
+
type: 'object',
|
|
6891
|
+
properties: {
|
|
6892
|
+
id: {
|
|
6893
|
+
type: 'string',
|
|
6894
|
+
description: 'Global platform ID'
|
|
6895
|
+
},
|
|
6896
|
+
name: {
|
|
6897
|
+
type: 'string',
|
|
6898
|
+
description: 'Platform name (e.g., "ICBC")'
|
|
6899
|
+
},
|
|
6900
|
+
canonical: {
|
|
6901
|
+
type: 'string',
|
|
6902
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
6903
|
+
},
|
|
6904
|
+
type: {
|
|
6905
|
+
type: 'string',
|
|
6906
|
+
description: 'Platform type',
|
|
6907
|
+
enum: [
|
|
6908
|
+
'BANK',
|
|
6909
|
+
'BROKERAGE',
|
|
6910
|
+
'CRYPTO_EXCHANGE',
|
|
6911
|
+
'PAYMENT',
|
|
6912
|
+
'INVESTMENT',
|
|
6913
|
+
'INSURANCE',
|
|
6914
|
+
'OTHER'
|
|
6915
|
+
]
|
|
6916
|
+
},
|
|
6917
|
+
suggestedSegment: {
|
|
6918
|
+
type: 'string',
|
|
6919
|
+
description:
|
|
6920
|
+
'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
|
|
6921
|
+
},
|
|
6922
|
+
logoUrl: {
|
|
6923
|
+
type: 'string',
|
|
6924
|
+
description: 'Logo URL',
|
|
6925
|
+
nullable: true
|
|
6926
|
+
},
|
|
6927
|
+
countryCode: {
|
|
6928
|
+
type: 'string',
|
|
6929
|
+
description: 'ISO 3166-1 alpha-2 (UPPERCASE); null = global platform',
|
|
6930
|
+
example: 'CN',
|
|
6931
|
+
nullable: true
|
|
6932
|
+
},
|
|
6933
|
+
category: {
|
|
6934
|
+
type: 'string',
|
|
6935
|
+
description:
|
|
6936
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
6937
|
+
nullable: true,
|
|
6938
|
+
example: 'DigitalWallet'
|
|
6939
|
+
},
|
|
6940
|
+
matchType: {
|
|
6941
|
+
type: 'string',
|
|
6942
|
+
description: "How this row matched: 'exact' > 'prefix' > 'substring'",
|
|
6943
|
+
enum: ['exact', 'prefix', 'substring']
|
|
6944
|
+
}
|
|
6945
|
+
},
|
|
6946
|
+
required: [
|
|
6947
|
+
'id',
|
|
6948
|
+
'name',
|
|
6949
|
+
'canonical',
|
|
6950
|
+
'type',
|
|
6951
|
+
'suggestedSegment',
|
|
6952
|
+
'logoUrl',
|
|
6953
|
+
'countryCode',
|
|
6954
|
+
'category',
|
|
6955
|
+
'matchType'
|
|
6956
|
+
]
|
|
6957
|
+
} as const;
|
|
6958
|
+
|
|
6959
|
+
export const $PlatformMatchResponseDto = {
|
|
6960
|
+
type: 'object',
|
|
6961
|
+
properties: {
|
|
6962
|
+
platforms: {
|
|
6963
|
+
description: 'Ranked matches, best tier first (at most 10 rows)',
|
|
6964
|
+
type: 'array',
|
|
6965
|
+
items: {
|
|
6966
|
+
$ref: '#/components/schemas/PlatformMatchResultDto'
|
|
6967
|
+
}
|
|
6968
|
+
},
|
|
6969
|
+
matchType: {
|
|
6970
|
+
type: 'string',
|
|
6971
|
+
description:
|
|
6972
|
+
"Overall match quality — top row's tier, or 'none' when no hits",
|
|
6973
|
+
enum: ['none', 'exact', 'prefix', 'substring']
|
|
6974
|
+
},
|
|
6975
|
+
total: {
|
|
6976
|
+
type: 'number',
|
|
6977
|
+
description: 'Total matches before LIMIT (truncation transparency)'
|
|
6978
|
+
},
|
|
6979
|
+
hasMore: {
|
|
6980
|
+
type: 'boolean',
|
|
6981
|
+
description: 'true when total > platforms.length (more matches exist)'
|
|
6982
|
+
}
|
|
6983
|
+
},
|
|
6984
|
+
required: ['platforms', 'matchType', 'total', 'hasMore']
|
|
6985
|
+
} as const;
|
|
6986
|
+
|
|
6987
|
+
export const $CreatePlatformDto = {
|
|
6988
|
+
type: 'object',
|
|
6989
|
+
properties: {
|
|
6990
|
+
name: {
|
|
6991
|
+
type: 'string',
|
|
6992
|
+
description: 'Platform name',
|
|
6993
|
+
example: 'Binance'
|
|
6994
|
+
},
|
|
6995
|
+
canonical: {
|
|
6996
|
+
type: 'string',
|
|
6997
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
6998
|
+
example: 'binance'
|
|
6999
|
+
},
|
|
7000
|
+
aliases: {
|
|
7001
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
7002
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
7003
|
+
type: 'array',
|
|
7004
|
+
items: {
|
|
7005
|
+
type: 'string'
|
|
7006
|
+
}
|
|
7007
|
+
},
|
|
7008
|
+
url: {
|
|
7009
|
+
type: 'string',
|
|
7010
|
+
description: 'Platform URL',
|
|
7011
|
+
example: 'https://www.binance.com'
|
|
7012
|
+
},
|
|
7013
|
+
type: {
|
|
7014
|
+
type: 'string',
|
|
7015
|
+
description: 'Platform type',
|
|
7016
|
+
enum: [
|
|
7017
|
+
'BANK',
|
|
7018
|
+
'BROKERAGE',
|
|
7019
|
+
'CRYPTO_EXCHANGE',
|
|
7020
|
+
'PAYMENT',
|
|
7021
|
+
'INVESTMENT',
|
|
7022
|
+
'INSURANCE',
|
|
7023
|
+
'OTHER'
|
|
7024
|
+
],
|
|
7025
|
+
example: 'CRYPTO_EXCHANGE'
|
|
7026
|
+
},
|
|
7027
|
+
logoUrl: {
|
|
7028
|
+
type: 'string',
|
|
7029
|
+
description: 'Platform logo URL',
|
|
7030
|
+
example: 'https://example.com/logos/binance.png'
|
|
7031
|
+
},
|
|
7032
|
+
isActive: {
|
|
7033
|
+
type: 'boolean',
|
|
7034
|
+
description: 'Whether the platform is active',
|
|
7035
|
+
default: true
|
|
7036
|
+
}
|
|
7037
|
+
},
|
|
7038
|
+
required: ['name', 'canonical', 'aliases', 'url', 'type']
|
|
5791
7039
|
} as const;
|
|
5792
7040
|
|
|
5793
|
-
export const $
|
|
7041
|
+
export const $UpdatePlatformDto = {
|
|
5794
7042
|
type: 'object',
|
|
5795
7043
|
properties: {
|
|
5796
|
-
|
|
7044
|
+
name: {
|
|
5797
7045
|
type: 'string',
|
|
5798
|
-
description: '
|
|
5799
|
-
example: '
|
|
7046
|
+
description: 'Platform name',
|
|
7047
|
+
example: 'Binance'
|
|
5800
7048
|
},
|
|
5801
|
-
|
|
7049
|
+
canonical: {
|
|
5802
7050
|
type: 'string',
|
|
5803
|
-
description: '
|
|
5804
|
-
example: '
|
|
7051
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
7052
|
+
example: 'binance'
|
|
7053
|
+
},
|
|
7054
|
+
aliases: {
|
|
7055
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
7056
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
7057
|
+
type: 'array',
|
|
7058
|
+
items: {
|
|
7059
|
+
type: 'string'
|
|
7060
|
+
}
|
|
7061
|
+
},
|
|
7062
|
+
url: {
|
|
7063
|
+
type: 'string',
|
|
7064
|
+
description: 'Platform URL',
|
|
7065
|
+
example: 'https://www.binance.com'
|
|
7066
|
+
},
|
|
7067
|
+
type: {
|
|
7068
|
+
type: 'string',
|
|
7069
|
+
description: 'Platform type',
|
|
7070
|
+
enum: [
|
|
7071
|
+
'BANK',
|
|
7072
|
+
'BROKERAGE',
|
|
7073
|
+
'CRYPTO_EXCHANGE',
|
|
7074
|
+
'PAYMENT',
|
|
7075
|
+
'INVESTMENT',
|
|
7076
|
+
'INSURANCE',
|
|
7077
|
+
'OTHER'
|
|
7078
|
+
],
|
|
7079
|
+
example: 'CRYPTO_EXCHANGE'
|
|
7080
|
+
},
|
|
7081
|
+
logoUrl: {
|
|
7082
|
+
type: 'string',
|
|
7083
|
+
description: 'Platform logo URL',
|
|
7084
|
+
example: 'https://example.com/logos/binance.png'
|
|
7085
|
+
},
|
|
7086
|
+
isActive: {
|
|
7087
|
+
type: 'boolean',
|
|
7088
|
+
description: 'Whether the platform is active'
|
|
5805
7089
|
}
|
|
5806
|
-
}
|
|
5807
|
-
required: ['currency', 'balance']
|
|
7090
|
+
}
|
|
5808
7091
|
} as const;
|
|
5809
7092
|
|
|
5810
7093
|
export const $NetWorthByCurrencyDto = {
|
|
@@ -5876,28 +7159,6 @@ export const $ConvertedNetWorthDto = {
|
|
|
5876
7159
|
]
|
|
5877
7160
|
} as const;
|
|
5878
7161
|
|
|
5879
|
-
export const $ExchangeRateWarningDto = {
|
|
5880
|
-
type: 'object',
|
|
5881
|
-
properties: {
|
|
5882
|
-
type: {
|
|
5883
|
-
type: 'string',
|
|
5884
|
-
description: 'Warning type',
|
|
5885
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
5886
|
-
},
|
|
5887
|
-
currency: {
|
|
5888
|
-
type: 'string',
|
|
5889
|
-
description: 'Currency without exchange rate',
|
|
5890
|
-
example: 'EUR'
|
|
5891
|
-
},
|
|
5892
|
-
totalAmount: {
|
|
5893
|
-
type: 'string',
|
|
5894
|
-
description: 'Total amount affected',
|
|
5895
|
-
example: '1000.00'
|
|
5896
|
-
}
|
|
5897
|
-
},
|
|
5898
|
-
required: ['type', 'currency', 'totalAmount']
|
|
5899
|
-
} as const;
|
|
5900
|
-
|
|
5901
7162
|
export const $NetWorthResponseDto = {
|
|
5902
7163
|
type: 'object',
|
|
5903
7164
|
properties: {
|
|
@@ -5983,7 +7244,7 @@ export const $AccountItemDto = {
|
|
|
5983
7244
|
name: {
|
|
5984
7245
|
type: 'string',
|
|
5985
7246
|
description: 'Full account name',
|
|
5986
|
-
example: 'Assets:
|
|
7247
|
+
example: 'Assets:CN:CMB:Savings'
|
|
5987
7248
|
},
|
|
5988
7249
|
displayName: {
|
|
5989
7250
|
type: 'string',
|
|
@@ -5999,6 +7260,12 @@ export const $AccountItemDto = {
|
|
|
5999
7260
|
type: 'string',
|
|
6000
7261
|
description: 'Currency code',
|
|
6001
7262
|
example: 'CNY'
|
|
7263
|
+
},
|
|
7264
|
+
convertedBalance: {
|
|
7265
|
+
type: 'string',
|
|
7266
|
+
description:
|
|
7267
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
7268
|
+
example: '50000.00'
|
|
6002
7269
|
}
|
|
6003
7270
|
},
|
|
6004
7271
|
required: ['id', 'name', 'displayName', 'balance', 'currency']
|
|
@@ -6025,11 +7292,66 @@ export const $PlatformGroupDto = {
|
|
|
6025
7292
|
},
|
|
6026
7293
|
totalBalance: {
|
|
6027
7294
|
type: 'string',
|
|
6028
|
-
description: '
|
|
7295
|
+
description: 'FX-converted total balance in base currency',
|
|
7296
|
+
example: '100000.00'
|
|
7297
|
+
},
|
|
7298
|
+
balanceByCurrency: {
|
|
7299
|
+
description: 'Raw (unconverted) balances grouped by currency',
|
|
7300
|
+
type: 'array',
|
|
7301
|
+
items: {
|
|
7302
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
7303
|
+
}
|
|
7304
|
+
},
|
|
7305
|
+
convertedBalance: {
|
|
7306
|
+
type: 'string',
|
|
7307
|
+
description:
|
|
7308
|
+
'Converted balance in base currency (omitted when no currency is convertible)',
|
|
6029
7309
|
example: '100000.00'
|
|
7310
|
+
},
|
|
7311
|
+
sharePct: {
|
|
7312
|
+
type: 'number',
|
|
7313
|
+
description:
|
|
7314
|
+
'Share of the grand converted total (0-100); 0 when grand total is 0',
|
|
7315
|
+
example: 42.5
|
|
7316
|
+
}
|
|
7317
|
+
},
|
|
7318
|
+
required: [
|
|
7319
|
+
'platformId',
|
|
7320
|
+
'platformName',
|
|
7321
|
+
'accounts',
|
|
7322
|
+
'totalBalance',
|
|
7323
|
+
'balanceByCurrency',
|
|
7324
|
+
'sharePct'
|
|
7325
|
+
]
|
|
7326
|
+
} as const;
|
|
7327
|
+
|
|
7328
|
+
export const $AccountExchangeRateWarningDto = {
|
|
7329
|
+
type: 'object',
|
|
7330
|
+
properties: {
|
|
7331
|
+
type: {
|
|
7332
|
+
type: 'string',
|
|
7333
|
+
description: 'Warning type',
|
|
7334
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
7335
|
+
},
|
|
7336
|
+
currency: {
|
|
7337
|
+
type: 'string',
|
|
7338
|
+
description: 'Currency without exchange rate',
|
|
7339
|
+
example: 'USD'
|
|
7340
|
+
},
|
|
7341
|
+
accounts: {
|
|
7342
|
+
description: 'Affected account paths',
|
|
7343
|
+
type: 'array',
|
|
7344
|
+
items: {
|
|
7345
|
+
type: 'string'
|
|
7346
|
+
}
|
|
7347
|
+
},
|
|
7348
|
+
totalAmount: {
|
|
7349
|
+
type: 'string',
|
|
7350
|
+
description: 'Total amount in this currency',
|
|
7351
|
+
example: '5000.00'
|
|
6030
7352
|
}
|
|
6031
7353
|
},
|
|
6032
|
-
required: ['
|
|
7354
|
+
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
6033
7355
|
} as const;
|
|
6034
7356
|
|
|
6035
7357
|
export const $AccountsSummaryDto = {
|
|
@@ -6042,9 +7364,21 @@ export const $AccountsSummaryDto = {
|
|
|
6042
7364
|
totalPlatforms: {
|
|
6043
7365
|
type: 'number',
|
|
6044
7366
|
description: 'Total number of platforms'
|
|
7367
|
+
},
|
|
7368
|
+
baseCurrency: {
|
|
7369
|
+
type: 'string',
|
|
7370
|
+
description: 'Base currency for conversion',
|
|
7371
|
+
example: 'CNY'
|
|
7372
|
+
},
|
|
7373
|
+
warnings: {
|
|
7374
|
+
description: 'Per-account exchange rate warnings',
|
|
7375
|
+
type: 'array',
|
|
7376
|
+
items: {
|
|
7377
|
+
$ref: '#/components/schemas/AccountExchangeRateWarningDto'
|
|
7378
|
+
}
|
|
6045
7379
|
}
|
|
6046
7380
|
},
|
|
6047
|
-
required: ['totalAccounts', 'totalPlatforms']
|
|
7381
|
+
required: ['totalAccounts', 'totalPlatforms', 'baseCurrency']
|
|
6048
7382
|
} as const;
|
|
6049
7383
|
|
|
6050
7384
|
export const $AccountsResponseDto = {
|
|
@@ -6079,7 +7413,7 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
6079
7413
|
name: {
|
|
6080
7414
|
type: 'string',
|
|
6081
7415
|
description: 'Full account name',
|
|
6082
|
-
example: 'Assets:
|
|
7416
|
+
example: 'Assets:CN:CMB:Savings'
|
|
6083
7417
|
},
|
|
6084
7418
|
displayName: {
|
|
6085
7419
|
type: 'string',
|
|
@@ -6096,6 +7430,12 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
6096
7430
|
description: 'Currency code',
|
|
6097
7431
|
example: 'CNY'
|
|
6098
7432
|
},
|
|
7433
|
+
convertedBalance: {
|
|
7434
|
+
type: 'string',
|
|
7435
|
+
description:
|
|
7436
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
7437
|
+
example: '50000.00'
|
|
7438
|
+
},
|
|
6099
7439
|
assetClass: {
|
|
6100
7440
|
type: 'string',
|
|
6101
7441
|
description: 'Asset class',
|
|
@@ -6175,35 +7515,6 @@ export const $AssetClassGroupDto = {
|
|
|
6175
7515
|
required: ['assetClass', 'accounts', 'balanceByCurrency']
|
|
6176
7516
|
} as const;
|
|
6177
7517
|
|
|
6178
|
-
export const $AccountExchangeRateWarningDto = {
|
|
6179
|
-
type: 'object',
|
|
6180
|
-
properties: {
|
|
6181
|
-
type: {
|
|
6182
|
-
type: 'string',
|
|
6183
|
-
description: 'Warning type',
|
|
6184
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
6185
|
-
},
|
|
6186
|
-
currency: {
|
|
6187
|
-
type: 'string',
|
|
6188
|
-
description: 'Currency without exchange rate',
|
|
6189
|
-
example: 'USD'
|
|
6190
|
-
},
|
|
6191
|
-
accounts: {
|
|
6192
|
-
description: 'Affected account paths',
|
|
6193
|
-
type: 'array',
|
|
6194
|
-
items: {
|
|
6195
|
-
type: 'string'
|
|
6196
|
-
}
|
|
6197
|
-
},
|
|
6198
|
-
totalAmount: {
|
|
6199
|
-
type: 'string',
|
|
6200
|
-
description: 'Total amount in this currency',
|
|
6201
|
-
example: '5000.00'
|
|
6202
|
-
}
|
|
6203
|
-
},
|
|
6204
|
-
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
6205
|
-
} as const;
|
|
6206
|
-
|
|
6207
7518
|
export const $AssetClassSummaryDto = {
|
|
6208
7519
|
type: 'object',
|
|
6209
7520
|
properties: {
|
|
@@ -6277,7 +7588,7 @@ export const $HoldingAssetClassAccountSliceDto = {
|
|
|
6277
7588
|
accountPath: {
|
|
6278
7589
|
type: 'string',
|
|
6279
7590
|
description: 'Full account path',
|
|
6280
|
-
example: 'Assets:US:
|
|
7591
|
+
example: 'Assets:US:Fidelity:Brokerage'
|
|
6281
7592
|
},
|
|
6282
7593
|
accountCurrency: {
|
|
6283
7594
|
type: 'string',
|
|
@@ -6449,38 +7760,133 @@ export const $CashFlowResponseDto = {
|
|
|
6449
7760
|
description: 'Base currency code',
|
|
6450
7761
|
example: 'CNY'
|
|
6451
7762
|
},
|
|
6452
|
-
byCurrency: {
|
|
6453
|
-
description: 'Cash flow grouped by original currency',
|
|
6454
|
-
allOf: [
|
|
6455
|
-
{
|
|
6456
|
-
$ref: '#/components/schemas/CashFlowByCurrencyDto'
|
|
6457
|
-
}
|
|
6458
|
-
]
|
|
7763
|
+
byCurrency: {
|
|
7764
|
+
description: 'Cash flow grouped by original currency',
|
|
7765
|
+
allOf: [
|
|
7766
|
+
{
|
|
7767
|
+
$ref: '#/components/schemas/CashFlowByCurrencyDto'
|
|
7768
|
+
}
|
|
7769
|
+
]
|
|
7770
|
+
},
|
|
7771
|
+
converted: {
|
|
7772
|
+
description: 'Converted values in base currency',
|
|
7773
|
+
allOf: [
|
|
7774
|
+
{
|
|
7775
|
+
$ref: '#/components/schemas/ConvertedCashFlowDto'
|
|
7776
|
+
}
|
|
7777
|
+
]
|
|
7778
|
+
},
|
|
7779
|
+
warnings: {
|
|
7780
|
+
description: 'Exchange rate warnings',
|
|
7781
|
+
type: 'array',
|
|
7782
|
+
items: {
|
|
7783
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7786
|
+
},
|
|
7787
|
+
required: [
|
|
7788
|
+
'period',
|
|
7789
|
+
'income',
|
|
7790
|
+
'expense',
|
|
7791
|
+
'netSavings',
|
|
7792
|
+
'savingsRate',
|
|
7793
|
+
'currency'
|
|
7794
|
+
]
|
|
7795
|
+
} as const;
|
|
7796
|
+
|
|
7797
|
+
export const $CategoryGroupDto = {
|
|
7798
|
+
type: 'object',
|
|
7799
|
+
properties: {
|
|
7800
|
+
category: {
|
|
7801
|
+
type: 'string',
|
|
7802
|
+
description:
|
|
7803
|
+
'Functional category (account-path Group segment); regional and universal account paths merge under it',
|
|
7804
|
+
example: 'Food'
|
|
7805
|
+
},
|
|
7806
|
+
totalExpense: {
|
|
7807
|
+
type: 'string',
|
|
7808
|
+
description:
|
|
7809
|
+
'Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)',
|
|
7810
|
+
example: '1200.00'
|
|
7811
|
+
},
|
|
7812
|
+
sharePct: {
|
|
7813
|
+
type: 'number',
|
|
7814
|
+
description: 'Share of grand total (0-100); 0 when grand total is 0',
|
|
7815
|
+
example: 42.5
|
|
7816
|
+
},
|
|
7817
|
+
balanceByCurrency: {
|
|
7818
|
+
description: 'Raw (unconverted) expense per currency',
|
|
7819
|
+
type: 'array',
|
|
7820
|
+
items: {
|
|
7821
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
7822
|
+
}
|
|
7823
|
+
},
|
|
7824
|
+
convertedBalance: {
|
|
7825
|
+
type: 'string',
|
|
7826
|
+
description:
|
|
7827
|
+
'Converted total in base currency (omitted when FX missing for all currencies in this category)',
|
|
7828
|
+
example: '1200.00'
|
|
7829
|
+
}
|
|
7830
|
+
},
|
|
7831
|
+
required: ['category', 'totalExpense', 'sharePct', 'balanceByCurrency']
|
|
7832
|
+
} as const;
|
|
7833
|
+
|
|
7834
|
+
export const $ExpensesByCategorySummaryDto = {
|
|
7835
|
+
type: 'object',
|
|
7836
|
+
properties: {
|
|
7837
|
+
totalExpense: {
|
|
7838
|
+
type: 'string',
|
|
7839
|
+
description:
|
|
7840
|
+
'Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income',
|
|
7841
|
+
example: '5000.00'
|
|
7842
|
+
},
|
|
7843
|
+
categoryCount: {
|
|
7844
|
+
type: 'number',
|
|
7845
|
+
description: 'Number of categories',
|
|
7846
|
+
example: 8
|
|
7847
|
+
}
|
|
7848
|
+
},
|
|
7849
|
+
required: ['totalExpense', 'categoryCount']
|
|
7850
|
+
} as const;
|
|
7851
|
+
|
|
7852
|
+
export const $ExpensesByCategoryResponseDto = {
|
|
7853
|
+
type: 'object',
|
|
7854
|
+
properties: {
|
|
7855
|
+
period: {
|
|
7856
|
+
type: 'string',
|
|
7857
|
+
description: 'Period requested',
|
|
7858
|
+
example: '1m'
|
|
7859
|
+
},
|
|
7860
|
+
baseCurrency: {
|
|
7861
|
+
type: 'string',
|
|
7862
|
+
description: 'Base currency for converted values',
|
|
7863
|
+
example: 'CNY'
|
|
7864
|
+
},
|
|
7865
|
+
groups: {
|
|
7866
|
+
description:
|
|
7867
|
+
'Expense groups by functional category, sorted by converted total desc',
|
|
7868
|
+
type: 'array',
|
|
7869
|
+
items: {
|
|
7870
|
+
$ref: '#/components/schemas/CategoryGroupDto'
|
|
7871
|
+
}
|
|
6459
7872
|
},
|
|
6460
|
-
|
|
6461
|
-
description: '
|
|
7873
|
+
summary: {
|
|
7874
|
+
description: 'Summary statistics',
|
|
6462
7875
|
allOf: [
|
|
6463
7876
|
{
|
|
6464
|
-
$ref: '#/components/schemas/
|
|
7877
|
+
$ref: '#/components/schemas/ExpensesByCategorySummaryDto'
|
|
6465
7878
|
}
|
|
6466
7879
|
]
|
|
6467
7880
|
},
|
|
6468
7881
|
warnings: {
|
|
6469
|
-
description: 'Exchange rate warnings',
|
|
7882
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
6470
7883
|
type: 'array',
|
|
6471
7884
|
items: {
|
|
6472
7885
|
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
6473
7886
|
}
|
|
6474
7887
|
}
|
|
6475
7888
|
},
|
|
6476
|
-
required: [
|
|
6477
|
-
'period',
|
|
6478
|
-
'income',
|
|
6479
|
-
'expense',
|
|
6480
|
-
'netSavings',
|
|
6481
|
-
'savingsRate',
|
|
6482
|
-
'currency'
|
|
6483
|
-
]
|
|
7889
|
+
required: ['period', 'baseCurrency', 'groups', 'summary']
|
|
6484
7890
|
} as const;
|
|
6485
7891
|
|
|
6486
7892
|
export const $MonetaryDto = {
|
|
@@ -6697,409 +8103,243 @@ export const $HoldingPnlRowDto = {
|
|
|
6697
8103
|
},
|
|
6698
8104
|
required: [
|
|
6699
8105
|
'accountId',
|
|
6700
|
-
'accountPath',
|
|
6701
|
-
'symbol',
|
|
6702
|
-
'chartToken',
|
|
6703
|
-
'assetClass',
|
|
6704
|
-
'units'
|
|
6705
|
-
]
|
|
6706
|
-
} as const;
|
|
6707
|
-
|
|
6708
|
-
export const $HoldingPnlWarningDto = {
|
|
6709
|
-
type: 'object',
|
|
6710
|
-
properties: {
|
|
6711
|
-
type: {
|
|
6712
|
-
type: 'string',
|
|
6713
|
-
description: 'Warning type',
|
|
6714
|
-
example: 'MISSING_COST_FX_RATE',
|
|
6715
|
-
enum: [
|
|
6716
|
-
'MISSING_COST_FX_RATE',
|
|
6717
|
-
'MISSING_MARKET_FX_RATE',
|
|
6718
|
-
'MISSING_SALE_PRICE',
|
|
6719
|
-
'MISSING_REALIZED_FX_RATE',
|
|
6720
|
-
'OVERSOLD_LOTS',
|
|
6721
|
-
'NO_PRICE',
|
|
6722
|
-
'MIXED_COST_CURRENCY'
|
|
6723
|
-
]
|
|
6724
|
-
},
|
|
6725
|
-
symbol: {
|
|
6726
|
-
type: 'object',
|
|
6727
|
-
nullable: true
|
|
6728
|
-
},
|
|
6729
|
-
accountId: {
|
|
6730
|
-
type: 'object',
|
|
6731
|
-
nullable: true
|
|
6732
|
-
},
|
|
6733
|
-
currency: {
|
|
6734
|
-
type: 'object',
|
|
6735
|
-
nullable: true
|
|
6736
|
-
}
|
|
6737
|
-
},
|
|
6738
|
-
required: ['type']
|
|
6739
|
-
} as const;
|
|
6740
|
-
|
|
6741
|
-
export const $HoldingPnlResponseDto = {
|
|
6742
|
-
type: 'object',
|
|
6743
|
-
properties: {
|
|
6744
|
-
asOfDate: {
|
|
6745
|
-
type: 'string',
|
|
6746
|
-
example: '2026-07-08'
|
|
6747
|
-
},
|
|
6748
|
-
baseCurrency: {
|
|
6749
|
-
type: 'string',
|
|
6750
|
-
example: 'CNY'
|
|
6751
|
-
},
|
|
6752
|
-
method: {
|
|
6753
|
-
type: 'string',
|
|
6754
|
-
description:
|
|
6755
|
-
'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
|
|
6756
|
-
enum: ['average', 'FIFO'],
|
|
6757
|
-
example: 'average'
|
|
6758
|
-
},
|
|
6759
|
-
rows: {
|
|
6760
|
-
type: 'array',
|
|
6761
|
-
items: {
|
|
6762
|
-
$ref: '#/components/schemas/HoldingPnlRowDto'
|
|
6763
|
-
}
|
|
6764
|
-
},
|
|
6765
|
-
warnings: {
|
|
6766
|
-
type: 'array',
|
|
6767
|
-
items: {
|
|
6768
|
-
$ref: '#/components/schemas/HoldingPnlWarningDto'
|
|
6769
|
-
}
|
|
6770
|
-
}
|
|
6771
|
-
},
|
|
6772
|
-
required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
|
|
6773
|
-
} as const;
|
|
6774
|
-
|
|
6775
|
-
export const $CreateBeanPriceDto = {
|
|
6776
|
-
type: 'object',
|
|
6777
|
-
properties: {
|
|
6778
|
-
currency: {
|
|
6779
|
-
type: 'string',
|
|
6780
|
-
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
6781
|
-
example: 'USD'
|
|
6782
|
-
},
|
|
6783
|
-
quoteCurrency: {
|
|
6784
|
-
type: 'string',
|
|
6785
|
-
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
6786
|
-
example: 'CNY'
|
|
6787
|
-
},
|
|
6788
|
-
amount: {
|
|
6789
|
-
type: 'number',
|
|
6790
|
-
description:
|
|
6791
|
-
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
6792
|
-
example: 175.5,
|
|
6793
|
-
minimum: 0
|
|
6794
|
-
},
|
|
6795
|
-
date: {
|
|
6796
|
-
type: 'string',
|
|
6797
|
-
description: 'Price date (ISO 8601 format)',
|
|
6798
|
-
example: '2024-11-05'
|
|
6799
|
-
},
|
|
6800
|
-
metadata: {
|
|
6801
|
-
type: 'object',
|
|
6802
|
-
description:
|
|
6803
|
-
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
6804
|
-
example: {
|
|
6805
|
-
source: 'MANUAL',
|
|
6806
|
-
note: 'Bank valuation report',
|
|
6807
|
-
confidence: 0.95
|
|
6808
|
-
}
|
|
6809
|
-
}
|
|
6810
|
-
},
|
|
6811
|
-
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
6812
|
-
} as const;
|
|
6813
|
-
|
|
6814
|
-
export const $PriceResponseDto = {
|
|
6815
|
-
type: 'object',
|
|
6816
|
-
properties: {
|
|
6817
|
-
id: {
|
|
6818
|
-
type: 'string',
|
|
6819
|
-
description: 'Unique identifier',
|
|
6820
|
-
example: 'uuid-123-456'
|
|
6821
|
-
},
|
|
6822
|
-
userId: {
|
|
6823
|
-
type: 'string',
|
|
6824
|
-
description: 'User ID (owner of the price)',
|
|
6825
|
-
example: 'user-123'
|
|
6826
|
-
},
|
|
6827
|
-
currency: {
|
|
6828
|
-
type: 'string',
|
|
6829
|
-
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
6830
|
-
example: 'BTC'
|
|
6831
|
-
},
|
|
6832
|
-
quoteCurrency: {
|
|
6833
|
-
type: 'string',
|
|
6834
|
-
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
6835
|
-
example: 'USD'
|
|
6836
|
-
},
|
|
6837
|
-
amount: {
|
|
6838
|
-
type: 'number',
|
|
6839
|
-
description:
|
|
6840
|
-
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
6841
|
-
example: 50000
|
|
6842
|
-
},
|
|
6843
|
-
date: {
|
|
6844
|
-
type: 'string',
|
|
6845
|
-
description:
|
|
6846
|
-
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
6847
|
-
example: '2024-01-01',
|
|
6848
|
-
format: 'date'
|
|
6849
|
-
},
|
|
6850
|
-
meta: {
|
|
6851
|
-
type: 'object',
|
|
6852
|
-
description:
|
|
6853
|
-
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
6854
|
-
example: {
|
|
6855
|
-
source: 'MANUAL',
|
|
6856
|
-
note: 'User-defined price',
|
|
6857
|
-
confidence: 1
|
|
6858
|
-
}
|
|
6859
|
-
},
|
|
6860
|
-
createdAt: {
|
|
6861
|
-
format: 'date-time',
|
|
6862
|
-
type: 'string',
|
|
6863
|
-
description: 'Creation timestamp',
|
|
6864
|
-
example: '2024-11-03T10:00:00Z'
|
|
6865
|
-
},
|
|
6866
|
-
updatedAt: {
|
|
6867
|
-
format: 'date-time',
|
|
6868
|
-
type: 'string',
|
|
6869
|
-
description: 'Last update timestamp',
|
|
6870
|
-
example: '2024-11-03T10:00:00Z'
|
|
6871
|
-
}
|
|
6872
|
-
},
|
|
6873
|
-
required: [
|
|
6874
|
-
'id',
|
|
6875
|
-
'userId',
|
|
6876
|
-
'currency',
|
|
6877
|
-
'quoteCurrency',
|
|
6878
|
-
'amount',
|
|
6879
|
-
'date',
|
|
6880
|
-
'meta',
|
|
6881
|
-
'createdAt',
|
|
6882
|
-
'updatedAt'
|
|
6883
|
-
]
|
|
6884
|
-
} as const;
|
|
6885
|
-
|
|
6886
|
-
export const $PriceListResponseDto = {
|
|
6887
|
-
type: 'object',
|
|
6888
|
-
properties: {
|
|
6889
|
-
items: {
|
|
6890
|
-
description: 'List of prices',
|
|
6891
|
-
type: 'array',
|
|
6892
|
-
items: {
|
|
6893
|
-
$ref: '#/components/schemas/PriceResponseDto'
|
|
6894
|
-
}
|
|
6895
|
-
},
|
|
6896
|
-
total: {
|
|
6897
|
-
type: 'number',
|
|
6898
|
-
description: 'Total number of prices',
|
|
6899
|
-
example: 42
|
|
6900
|
-
}
|
|
6901
|
-
},
|
|
6902
|
-
required: ['items', 'total']
|
|
6903
|
-
} as const;
|
|
6904
|
-
|
|
6905
|
-
export const $UpdateBeanPriceDto = {
|
|
6906
|
-
type: 'object',
|
|
6907
|
-
properties: {
|
|
6908
|
-
currency: {
|
|
6909
|
-
type: 'string',
|
|
6910
|
-
description: 'Currency being priced'
|
|
6911
|
-
},
|
|
6912
|
-
quoteCurrency: {
|
|
6913
|
-
type: 'string',
|
|
6914
|
-
description: 'Quote currency (pricing currency)'
|
|
6915
|
-
},
|
|
6916
|
-
amount: {
|
|
6917
|
-
type: 'number',
|
|
6918
|
-
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
6919
|
-
minimum: 0
|
|
6920
|
-
},
|
|
6921
|
-
date: {
|
|
6922
|
-
type: 'string',
|
|
6923
|
-
description: 'Price date (ISO 8601 format)'
|
|
6924
|
-
},
|
|
6925
|
-
metadata: {
|
|
6926
|
-
type: 'object',
|
|
6927
|
-
description: 'Metadata'
|
|
6928
|
-
}
|
|
6929
|
-
}
|
|
8106
|
+
'accountPath',
|
|
8107
|
+
'symbol',
|
|
8108
|
+
'chartToken',
|
|
8109
|
+
'assetClass',
|
|
8110
|
+
'units'
|
|
8111
|
+
]
|
|
6930
8112
|
} as const;
|
|
6931
8113
|
|
|
6932
|
-
export const $
|
|
8114
|
+
export const $HoldingPnlWarningDto = {
|
|
6933
8115
|
type: 'object',
|
|
6934
8116
|
properties: {
|
|
6935
|
-
|
|
8117
|
+
type: {
|
|
6936
8118
|
type: 'string',
|
|
6937
|
-
description: '
|
|
6938
|
-
example: '
|
|
8119
|
+
description: 'Warning type',
|
|
8120
|
+
example: 'MISSING_COST_FX_RATE',
|
|
8121
|
+
enum: [
|
|
8122
|
+
'MISSING_COST_FX_RATE',
|
|
8123
|
+
'MISSING_MARKET_FX_RATE',
|
|
8124
|
+
'MISSING_SALE_PRICE',
|
|
8125
|
+
'MISSING_REALIZED_FX_RATE',
|
|
8126
|
+
'OVERSOLD_LOTS',
|
|
8127
|
+
'NO_PRICE',
|
|
8128
|
+
'MIXED_COST_CURRENCY'
|
|
8129
|
+
]
|
|
6939
8130
|
},
|
|
6940
|
-
|
|
6941
|
-
type: '
|
|
6942
|
-
|
|
6943
|
-
|
|
8131
|
+
symbol: {
|
|
8132
|
+
type: 'object',
|
|
8133
|
+
nullable: true
|
|
8134
|
+
},
|
|
8135
|
+
accountId: {
|
|
8136
|
+
type: 'object',
|
|
8137
|
+
nullable: true
|
|
8138
|
+
},
|
|
8139
|
+
currency: {
|
|
8140
|
+
type: 'object',
|
|
8141
|
+
nullable: true
|
|
6944
8142
|
}
|
|
6945
8143
|
},
|
|
6946
|
-
required: ['
|
|
8144
|
+
required: ['type']
|
|
6947
8145
|
} as const;
|
|
6948
8146
|
|
|
6949
|
-
export const $
|
|
8147
|
+
export const $HoldingPnlResponseDto = {
|
|
6950
8148
|
type: 'object',
|
|
6951
8149
|
properties: {
|
|
6952
|
-
|
|
8150
|
+
asOfDate: {
|
|
6953
8151
|
type: 'string',
|
|
6954
|
-
|
|
6955
|
-
example: '2024-06-15'
|
|
8152
|
+
example: '2026-07-08'
|
|
6956
8153
|
},
|
|
6957
|
-
|
|
8154
|
+
baseCurrency: {
|
|
6958
8155
|
type: 'string',
|
|
6959
|
-
|
|
6960
|
-
example: '500000.00'
|
|
8156
|
+
example: 'CNY'
|
|
6961
8157
|
},
|
|
6962
|
-
|
|
6963
|
-
type: '
|
|
6964
|
-
description:
|
|
6965
|
-
|
|
8158
|
+
method: {
|
|
8159
|
+
type: 'string',
|
|
8160
|
+
description:
|
|
8161
|
+
'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
|
|
8162
|
+
enum: ['average', 'FIFO'],
|
|
8163
|
+
example: 'average'
|
|
6966
8164
|
},
|
|
6967
|
-
|
|
6968
|
-
description: 'Multi-currency breakdown for this point',
|
|
8165
|
+
rows: {
|
|
6969
8166
|
type: 'array',
|
|
6970
8167
|
items: {
|
|
6971
|
-
$ref: '#/components/schemas/
|
|
8168
|
+
$ref: '#/components/schemas/HoldingPnlRowDto'
|
|
8169
|
+
}
|
|
8170
|
+
},
|
|
8171
|
+
warnings: {
|
|
8172
|
+
type: 'array',
|
|
8173
|
+
items: {
|
|
8174
|
+
$ref: '#/components/schemas/HoldingPnlWarningDto'
|
|
6972
8175
|
}
|
|
6973
8176
|
}
|
|
6974
8177
|
},
|
|
6975
|
-
required: ['
|
|
8178
|
+
required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
|
|
6976
8179
|
} as const;
|
|
6977
8180
|
|
|
6978
|
-
export const $
|
|
8181
|
+
export const $AnonymousLoginDto = {
|
|
6979
8182
|
type: 'object',
|
|
6980
8183
|
properties: {
|
|
6981
|
-
|
|
6982
|
-
type: 'string',
|
|
6983
|
-
description: 'Value at start of period',
|
|
6984
|
-
example: '450000.00'
|
|
6985
|
-
},
|
|
6986
|
-
endValue: {
|
|
6987
|
-
type: 'string',
|
|
6988
|
-
description: 'Value at end of period',
|
|
6989
|
-
example: '500000.00'
|
|
6990
|
-
},
|
|
6991
|
-
totalChange: {
|
|
6992
|
-
type: 'string',
|
|
6993
|
-
description: 'Total change over period',
|
|
6994
|
-
example: '50000.00'
|
|
6995
|
-
},
|
|
6996
|
-
totalChangePercentage: {
|
|
8184
|
+
accessToken: {
|
|
6997
8185
|
type: 'string',
|
|
6998
|
-
description: '
|
|
6999
|
-
example: '+11.11%'
|
|
8186
|
+
description: 'Access token for anonymous login'
|
|
7000
8187
|
}
|
|
7001
8188
|
},
|
|
7002
|
-
required: ['
|
|
8189
|
+
required: ['accessToken']
|
|
7003
8190
|
} as const;
|
|
7004
8191
|
|
|
7005
|
-
export const $
|
|
8192
|
+
export const $AnonymousLoginResponseDto = {
|
|
7006
8193
|
type: 'object',
|
|
7007
8194
|
properties: {
|
|
7008
|
-
|
|
8195
|
+
authToken: {
|
|
7009
8196
|
type: 'string',
|
|
7010
|
-
description: '
|
|
7011
|
-
example: '
|
|
7012
|
-
},
|
|
7013
|
-
byCurrency: {
|
|
7014
|
-
description: 'Balances by currency',
|
|
7015
|
-
type: 'array',
|
|
7016
|
-
items: {
|
|
7017
|
-
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
7018
|
-
}
|
|
8197
|
+
description: 'JWT auth token',
|
|
8198
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
7019
8199
|
}
|
|
7020
8200
|
},
|
|
7021
|
-
required: ['
|
|
8201
|
+
required: ['authToken']
|
|
7022
8202
|
} as const;
|
|
7023
8203
|
|
|
7024
|
-
export const $
|
|
8204
|
+
export const $SymbolSearchResultDto = {
|
|
7025
8205
|
type: 'object',
|
|
7026
8206
|
properties: {
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
items: {
|
|
7031
|
-
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
7032
|
-
}
|
|
8207
|
+
symbol: {
|
|
8208
|
+
type: 'string',
|
|
8209
|
+
example: 'AAPL'
|
|
7033
8210
|
},
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
$ref: '#/components/schemas/TrendSummaryDto'
|
|
7039
|
-
}
|
|
7040
|
-
]
|
|
8211
|
+
name: {
|
|
8212
|
+
type: 'object',
|
|
8213
|
+
example: 'Apple Inc.',
|
|
8214
|
+
nullable: true
|
|
7041
8215
|
},
|
|
7042
|
-
|
|
7043
|
-
type: '
|
|
7044
|
-
|
|
7045
|
-
|
|
8216
|
+
exchange: {
|
|
8217
|
+
type: 'object',
|
|
8218
|
+
example: 'US',
|
|
8219
|
+
nullable: true
|
|
7046
8220
|
},
|
|
7047
|
-
|
|
7048
|
-
type: '
|
|
7049
|
-
description: '
|
|
7050
|
-
example: '
|
|
8221
|
+
assetType: {
|
|
8222
|
+
type: 'object',
|
|
8223
|
+
description: 'OpenBB asset_type (e.g. stock, etf)',
|
|
8224
|
+
example: 'stock',
|
|
8225
|
+
nullable: true
|
|
7051
8226
|
},
|
|
7052
|
-
|
|
7053
|
-
type: '
|
|
7054
|
-
description: '
|
|
7055
|
-
example: '
|
|
8227
|
+
assetClass: {
|
|
8228
|
+
type: 'object',
|
|
8229
|
+
description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
|
|
8230
|
+
example: 'EQUITY',
|
|
8231
|
+
nullable: true
|
|
7056
8232
|
},
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
7063
|
-
}
|
|
8233
|
+
assetSubClass: {
|
|
8234
|
+
type: 'object',
|
|
8235
|
+
description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
|
|
8236
|
+
example: 'STOCK',
|
|
8237
|
+
nullable: true
|
|
7064
8238
|
},
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
}
|
|
8239
|
+
currency: {
|
|
8240
|
+
type: 'object',
|
|
8241
|
+
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8242
|
+
example: 'USD',
|
|
8243
|
+
nullable: true
|
|
7071
8244
|
}
|
|
7072
8245
|
},
|
|
7073
|
-
required: ['
|
|
7074
|
-
} as const;
|
|
7075
|
-
|
|
7076
|
-
export const $GenerateSnapshotBody = {
|
|
7077
|
-
type: 'object',
|
|
7078
|
-
properties: {}
|
|
7079
|
-
} as const;
|
|
7080
|
-
|
|
7081
|
-
export const $GenerateSnapshotResponse = {
|
|
7082
|
-
type: 'object',
|
|
7083
|
-
properties: {}
|
|
7084
|
-
} as const;
|
|
7085
|
-
|
|
7086
|
-
export const $BackfillSnapshotsBody = {
|
|
7087
|
-
type: 'object',
|
|
7088
|
-
properties: {}
|
|
7089
|
-
} as const;
|
|
7090
|
-
|
|
7091
|
-
export const $BackfillSnapshotsResponse = {
|
|
7092
|
-
type: 'object',
|
|
7093
|
-
properties: {}
|
|
8246
|
+
required: ['symbol']
|
|
7094
8247
|
} as const;
|
|
7095
8248
|
|
|
7096
|
-
export const $
|
|
8249
|
+
export const $SymbolQuoteDto = {
|
|
7097
8250
|
type: 'object',
|
|
7098
8251
|
properties: {
|
|
7099
|
-
|
|
8252
|
+
symbol: {
|
|
7100
8253
|
type: 'string',
|
|
7101
|
-
|
|
8254
|
+
example: 'AAPL'
|
|
8255
|
+
},
|
|
8256
|
+
name: {
|
|
8257
|
+
type: 'object',
|
|
8258
|
+
example: 'Apple Inc.',
|
|
8259
|
+
nullable: true
|
|
8260
|
+
},
|
|
8261
|
+
exchange: {
|
|
8262
|
+
type: 'object',
|
|
8263
|
+
example: 'US',
|
|
8264
|
+
nullable: true
|
|
8265
|
+
},
|
|
8266
|
+
assetType: {
|
|
8267
|
+
type: 'object',
|
|
8268
|
+
description: 'OpenBB asset_type',
|
|
8269
|
+
example: 'stock',
|
|
8270
|
+
nullable: true
|
|
8271
|
+
},
|
|
8272
|
+
assetClass: {
|
|
8273
|
+
type: 'object',
|
|
8274
|
+
description: 'IGN asset class',
|
|
8275
|
+
example: 'EQUITY',
|
|
8276
|
+
nullable: true
|
|
8277
|
+
},
|
|
8278
|
+
assetSubClass: {
|
|
8279
|
+
type: 'object',
|
|
8280
|
+
description: 'IGN asset sub-class',
|
|
8281
|
+
example: 'STOCK',
|
|
8282
|
+
nullable: true
|
|
8283
|
+
},
|
|
8284
|
+
currency: {
|
|
8285
|
+
type: 'object',
|
|
8286
|
+
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8287
|
+
example: 'USD',
|
|
8288
|
+
nullable: true
|
|
8289
|
+
},
|
|
8290
|
+
price: {
|
|
8291
|
+
type: 'object',
|
|
8292
|
+
description: 'Latest price (Decimal string)',
|
|
8293
|
+
example: '189.84',
|
|
8294
|
+
nullable: true
|
|
8295
|
+
},
|
|
8296
|
+
priceDate: {
|
|
8297
|
+
type: 'object',
|
|
8298
|
+
description: 'Date the price was observed (ISO yyyy-MM-dd)',
|
|
8299
|
+
example: '2026-08-05',
|
|
8300
|
+
nullable: true
|
|
8301
|
+
},
|
|
8302
|
+
changePercent: {
|
|
8303
|
+
type: 'object',
|
|
8304
|
+
description:
|
|
8305
|
+
'Change vs previous close, in percentage points (1.7 == 1.7%). openbb stores change_percent as a normalized decimal; this exposes percentage points for frontend convenience.',
|
|
8306
|
+
example: 1.7,
|
|
8307
|
+
nullable: true
|
|
8308
|
+
},
|
|
8309
|
+
prevClose: {
|
|
8310
|
+
type: 'object',
|
|
8311
|
+
description: 'Previous close (Decimal string)',
|
|
8312
|
+
nullable: true
|
|
8313
|
+
},
|
|
8314
|
+
open: {
|
|
8315
|
+
type: 'object',
|
|
8316
|
+
description: 'Day open (Decimal string)',
|
|
8317
|
+
nullable: true
|
|
8318
|
+
},
|
|
8319
|
+
high: {
|
|
8320
|
+
type: 'object',
|
|
8321
|
+
description: 'Day high (Decimal string)',
|
|
8322
|
+
nullable: true
|
|
8323
|
+
},
|
|
8324
|
+
low: {
|
|
8325
|
+
type: 'object',
|
|
8326
|
+
description: 'Day low (Decimal string)',
|
|
8327
|
+
nullable: true
|
|
8328
|
+
},
|
|
8329
|
+
volume: {
|
|
8330
|
+
type: 'object',
|
|
8331
|
+
description: 'Day volume (Decimal string)',
|
|
8332
|
+
nullable: true
|
|
8333
|
+
},
|
|
8334
|
+
yearHigh: {
|
|
8335
|
+
type: 'object',
|
|
8336
|
+
description: '52-week high (Decimal string)',
|
|
8337
|
+
nullable: true
|
|
8338
|
+
},
|
|
8339
|
+
yearLow: {
|
|
8340
|
+
type: 'object',
|
|
8341
|
+
description: '52-week low (Decimal string)',
|
|
8342
|
+
nullable: true
|
|
7102
8343
|
}
|
|
7103
|
-
}
|
|
7104
|
-
required: ['accessToken']
|
|
8344
|
+
}
|
|
7105
8345
|
} as const;
|