@firela/api-types 0.0.0-canary.c24ca5bf → 0.0.0-canary.c2c992d2
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 +1489 -1209
- package/dist/index.d.ts +1489 -1209
- package/dist/index.js +6 -4
- package/dist/index.mjs +6 -4
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +1668 -1049
- package/src/generated/services.gen.ts +613 -545
- package/src/generated/types.gen.ts +19542 -1408
|
@@ -51,6 +51,14 @@ export const $CreateAccountDto = {
|
|
|
51
51
|
description: 'Icon identifier (overrides template)',
|
|
52
52
|
example: 'bank-custom'
|
|
53
53
|
},
|
|
54
|
+
displayName: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
description:
|
|
57
|
+
'User-set display name override (omit/null = keep the derived name)',
|
|
58
|
+
nullable: true,
|
|
59
|
+
maxLength: 50,
|
|
60
|
+
example: 'Salary card'
|
|
61
|
+
},
|
|
54
62
|
openDirectiveMeta: {
|
|
55
63
|
type: 'object',
|
|
56
64
|
description:
|
|
@@ -181,7 +189,8 @@ export const $AccountResponseDto = {
|
|
|
181
189
|
},
|
|
182
190
|
displayName: {
|
|
183
191
|
type: 'string',
|
|
184
|
-
description:
|
|
192
|
+
description:
|
|
193
|
+
'Display name with precedence: user-set name (#762) > ADR-0114 localized name > path leaf (read-time projection)',
|
|
185
194
|
example: 'Checking'
|
|
186
195
|
},
|
|
187
196
|
icon: {
|
|
@@ -197,7 +206,7 @@ export const $AccountResponseDto = {
|
|
|
197
206
|
}
|
|
198
207
|
},
|
|
199
208
|
platformId: {
|
|
200
|
-
type: '
|
|
209
|
+
type: 'string',
|
|
201
210
|
description: 'Platform ID (null if unbound)',
|
|
202
211
|
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
203
212
|
},
|
|
@@ -277,6 +286,14 @@ export const $UpdateAccountDto = {
|
|
|
277
286
|
description: 'Icon identifier',
|
|
278
287
|
example: 'bank-custom'
|
|
279
288
|
},
|
|
289
|
+
displayName: {
|
|
290
|
+
type: 'string',
|
|
291
|
+
description:
|
|
292
|
+
'User-set display name override (null = clear the override and fall back to the derived name, omit = unchanged)',
|
|
293
|
+
nullable: true,
|
|
294
|
+
maxLength: 50,
|
|
295
|
+
example: 'Salary card'
|
|
296
|
+
},
|
|
280
297
|
openDirectiveMeta: {
|
|
281
298
|
type: 'object',
|
|
282
299
|
description:
|
|
@@ -377,16 +394,43 @@ export const $AccountStandardResponseDto = {
|
|
|
377
394
|
},
|
|
378
395
|
name: {
|
|
379
396
|
type: 'string',
|
|
380
|
-
description:
|
|
397
|
+
description:
|
|
398
|
+
'Short display name. Universal rows project to the request locale (Accept-Language); regional rows keep the authored native name — mixed-language by design (ADR-0131 class P vs class A).',
|
|
381
399
|
example: 'Housing Fund'
|
|
382
400
|
},
|
|
401
|
+
aliases: {
|
|
402
|
+
description:
|
|
403
|
+
'Authored market-language alternative names delivered verbatim (not localized copy, not xlf-managed, not locale-projected). Flat string[] per ADR-0129 D1; ADR-0131 class A.',
|
|
404
|
+
example: ['Alipay', 'WeChat Pay'],
|
|
405
|
+
type: 'array',
|
|
406
|
+
items: {
|
|
407
|
+
type: 'string'
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
searchTerms: {
|
|
411
|
+
description:
|
|
412
|
+
'Locale-projected search synonyms (e.g. the zh bank-card / debit-card everyday terms for the checking account). Pure-locale projection — absent when the locale has no seeded synonyms; English fallback rides the authored aliases field. Search-only vocabulary, not the NLP routing corpus (#698, ADR-0131 fourth-class adjudication).',
|
|
413
|
+
example: ['yinhangka', 'jiejika'],
|
|
414
|
+
type: 'array',
|
|
415
|
+
items: {
|
|
416
|
+
type: 'string'
|
|
417
|
+
}
|
|
418
|
+
},
|
|
419
|
+
currency: {
|
|
420
|
+
type: 'string',
|
|
421
|
+
description:
|
|
422
|
+
'Product denomination as a 3-letter ISO 4217 code, authored market data delivered verbatim (not localized, not xlf-managed). ADR-0131 class A. Absent = single-currency not asserted — consumers fall back to their own region currency (#714).',
|
|
423
|
+
example: 'HKD'
|
|
424
|
+
},
|
|
383
425
|
description: {
|
|
384
426
|
type: 'string',
|
|
385
|
-
description:
|
|
427
|
+
description:
|
|
428
|
+
'Account description (stable semantics only). Mixed-language contract: universal rows project to the request locale via the accountDesc xlf axis with an en fallback (ADR-0131 class P, ADR-0132; unseeded locales falling back to English are expected); regional rows deliver the authored market language (ADR-0131 class A, verbatim, never xlf-managed).',
|
|
386
429
|
example: 'ICBC checking account for daily transactions'
|
|
387
430
|
},
|
|
388
431
|
tags: {
|
|
389
|
-
description:
|
|
432
|
+
description:
|
|
433
|
+
'Account tags for categorization — structured metadata delivered verbatim (not localized, not xlf-managed). ADR-0131 class A.',
|
|
390
434
|
example: ['bank', 'checking', 'primary'],
|
|
391
435
|
type: 'array',
|
|
392
436
|
items: {
|
|
@@ -498,7 +542,10 @@ export const $RegionConfigDto = {
|
|
|
498
542
|
},
|
|
499
543
|
locale: {
|
|
500
544
|
type: 'string',
|
|
501
|
-
example: 'de-DE'
|
|
545
|
+
example: 'de-DE',
|
|
546
|
+
pattern: '^[a-z]{2,8}-[A-Z]{2}$',
|
|
547
|
+
description:
|
|
548
|
+
"Region-qualified BCP-47 tag whose region subtag equals the region's own ISO 3166-1 code (e.g., ja-JP, zh-CN, zh-HK)"
|
|
502
549
|
}
|
|
503
550
|
},
|
|
504
551
|
required: ['currency', 'dateFormat', 'locale']
|
|
@@ -511,6 +558,12 @@ export const $RegionInfoDto = {
|
|
|
511
558
|
type: 'string',
|
|
512
559
|
example: 'de'
|
|
513
560
|
},
|
|
561
|
+
open: {
|
|
562
|
+
type: 'boolean',
|
|
563
|
+
example: true,
|
|
564
|
+
description:
|
|
565
|
+
'Whether the region is open (has a ready regional account template). Not-yet-open regions still return identity metadata and degrade to the universal-only catalog.'
|
|
566
|
+
},
|
|
514
567
|
displayName: {
|
|
515
568
|
type: 'string',
|
|
516
569
|
example: 'Germany'
|
|
@@ -529,7 +582,7 @@ export const $RegionInfoDto = {
|
|
|
529
582
|
$ref: '#/components/schemas/RegionConfigDto'
|
|
530
583
|
}
|
|
531
584
|
},
|
|
532
|
-
required: ['code', 'displayName', 'chain', 'config']
|
|
585
|
+
required: ['code', 'open', 'displayName', 'chain', 'config']
|
|
533
586
|
} as const;
|
|
534
587
|
|
|
535
588
|
export const $RegionsMetadataResponseDto = {
|
|
@@ -776,7 +829,7 @@ export const $PostingResponseDto = {
|
|
|
776
829
|
units: {
|
|
777
830
|
type: 'string',
|
|
778
831
|
description:
|
|
779
|
-
'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
|
|
832
|
+
'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned. Carries the raw Beancount sign (credit-normal accounts such as Income post negative — the accounting truth, ADR-0126); renderers must not infer economic semantics from this sign.',
|
|
780
833
|
example: '100.50'
|
|
781
834
|
},
|
|
782
835
|
currency: {
|
|
@@ -1142,7 +1195,7 @@ export const $PostingDetailDto = {
|
|
|
1142
1195
|
units: {
|
|
1143
1196
|
type: 'string',
|
|
1144
1197
|
description:
|
|
1145
|
-
'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
|
|
1198
|
+
'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned. Carries the raw Beancount sign (credit-normal accounts such as Income post negative — the accounting truth, ADR-0126); renderers must not infer economic semantics from this sign.',
|
|
1146
1199
|
example: '100.50'
|
|
1147
1200
|
},
|
|
1148
1201
|
currency: {
|
|
@@ -1326,6 +1379,147 @@ export const $TransactionDetailDto = {
|
|
|
1326
1379
|
]
|
|
1327
1380
|
} as const;
|
|
1328
1381
|
|
|
1382
|
+
export const $TransactionListItemDto = {
|
|
1383
|
+
type: 'object',
|
|
1384
|
+
properties: {
|
|
1385
|
+
id: {
|
|
1386
|
+
type: 'string',
|
|
1387
|
+
description: 'Transaction ID',
|
|
1388
|
+
example: 'clh1234567890abcdef'
|
|
1389
|
+
},
|
|
1390
|
+
date: {
|
|
1391
|
+
type: 'string',
|
|
1392
|
+
description: 'Transaction date',
|
|
1393
|
+
example: '2024-11-28'
|
|
1394
|
+
},
|
|
1395
|
+
flag: {
|
|
1396
|
+
type: 'string',
|
|
1397
|
+
description: 'Transaction flag',
|
|
1398
|
+
enum: [
|
|
1399
|
+
'CLEARED',
|
|
1400
|
+
'PENDING',
|
|
1401
|
+
'PADDING',
|
|
1402
|
+
'SUMMARIZE',
|
|
1403
|
+
'TRANSFER',
|
|
1404
|
+
'CONVERSIONS'
|
|
1405
|
+
],
|
|
1406
|
+
example: 'CLEARED'
|
|
1407
|
+
},
|
|
1408
|
+
customFlag: {
|
|
1409
|
+
type: 'string',
|
|
1410
|
+
description: 'Custom flag (if not using standard flags)',
|
|
1411
|
+
example: 'R'
|
|
1412
|
+
},
|
|
1413
|
+
payee: {
|
|
1414
|
+
type: 'string',
|
|
1415
|
+
description: 'Payee name',
|
|
1416
|
+
example: 'Whole Foods Market'
|
|
1417
|
+
},
|
|
1418
|
+
narration: {
|
|
1419
|
+
type: 'string',
|
|
1420
|
+
description: 'Transaction narration',
|
|
1421
|
+
example: 'Grocery shopping'
|
|
1422
|
+
},
|
|
1423
|
+
tags: {
|
|
1424
|
+
description: 'Transaction tags',
|
|
1425
|
+
example: ['groceries'],
|
|
1426
|
+
type: 'array',
|
|
1427
|
+
items: {
|
|
1428
|
+
type: 'string'
|
|
1429
|
+
}
|
|
1430
|
+
},
|
|
1431
|
+
links: {
|
|
1432
|
+
description: 'Transaction links',
|
|
1433
|
+
example: ['invoice-2024-001'],
|
|
1434
|
+
type: 'array',
|
|
1435
|
+
items: {
|
|
1436
|
+
type: 'string'
|
|
1437
|
+
}
|
|
1438
|
+
},
|
|
1439
|
+
meta: {
|
|
1440
|
+
type: 'object',
|
|
1441
|
+
description: 'Transaction metadata'
|
|
1442
|
+
},
|
|
1443
|
+
status: {
|
|
1444
|
+
type: 'string',
|
|
1445
|
+
description: 'Transaction status',
|
|
1446
|
+
enum: ['ACTIVE', 'VOIDED', 'SUPERSEDED'],
|
|
1447
|
+
example: 'ACTIVE'
|
|
1448
|
+
},
|
|
1449
|
+
sourceType: {
|
|
1450
|
+
type: 'string',
|
|
1451
|
+
description:
|
|
1452
|
+
'Source type (free-form string from transaction metadata, e.g. import, api)'
|
|
1453
|
+
},
|
|
1454
|
+
sourcePlatform: {
|
|
1455
|
+
type: 'string',
|
|
1456
|
+
description: 'Source platform (e.g., alipay, wechat)',
|
|
1457
|
+
example: 'alipay'
|
|
1458
|
+
},
|
|
1459
|
+
postings: {
|
|
1460
|
+
description: 'Transaction postings',
|
|
1461
|
+
type: 'array',
|
|
1462
|
+
items: {
|
|
1463
|
+
$ref: '#/components/schemas/PostingDetailDto'
|
|
1464
|
+
}
|
|
1465
|
+
},
|
|
1466
|
+
createdAt: {
|
|
1467
|
+
type: 'string',
|
|
1468
|
+
description: 'Created at timestamp',
|
|
1469
|
+
example: '2024-11-28T10:30:00.000Z'
|
|
1470
|
+
},
|
|
1471
|
+
voidedAt: {
|
|
1472
|
+
type: 'string',
|
|
1473
|
+
description: 'Voided at timestamp (if voided)',
|
|
1474
|
+
example: '2024-11-29T15:00:00.000Z'
|
|
1475
|
+
},
|
|
1476
|
+
voidedBy: {
|
|
1477
|
+
type: 'string',
|
|
1478
|
+
description: 'User ID who voided this transaction',
|
|
1479
|
+
example: 'clh1234567890abcdef'
|
|
1480
|
+
},
|
|
1481
|
+
correctionReason: {
|
|
1482
|
+
type: 'string',
|
|
1483
|
+
description: 'Correction reason (if voided or superseded)',
|
|
1484
|
+
example: 'Duplicate entry'
|
|
1485
|
+
},
|
|
1486
|
+
supersededBy: {
|
|
1487
|
+
type: 'string',
|
|
1488
|
+
description:
|
|
1489
|
+
'ID of the transaction that supersedes this one (set when status=SUPERSEDED)',
|
|
1490
|
+
example: 'clh1234567890abcdef'
|
|
1491
|
+
},
|
|
1492
|
+
originalTxn: {
|
|
1493
|
+
type: 'string',
|
|
1494
|
+
description:
|
|
1495
|
+
'ID of the transaction this one corrected/replaced (back-link on the replacement)',
|
|
1496
|
+
example: 'clh1234567890abcdef'
|
|
1497
|
+
},
|
|
1498
|
+
viewpointAmount: {
|
|
1499
|
+
type: 'string',
|
|
1500
|
+
description:
|
|
1501
|
+
'Row amount under the request viewpoint (ADR-0126). Category viewpoint (category + flow): per-leg sign-normalized sum over the category account set (Income-root legs negated, Expenses-root identity) — positive under normal booking but NOT clamped (explicit negative expense legs and net-flip refund months stay negative). No viewpoint (plain list / search, no accountId): wallet money-flow net = raw-sign sum over cost-less Assets/Liabilities legs (income positive, expenses negative, transfers net ~0); color cue is the wallet sign (net < 0 = wealth-decreasing). Status-orthogonal: audit views match too (ADR-0128 amount-as-matching-key). Omitted under the account viewpoint (incl. dual) and for rows with no wallet leg.',
|
|
1502
|
+
example: '10000.00'
|
|
1503
|
+
},
|
|
1504
|
+
viewpointCurrency: {
|
|
1505
|
+
type: 'string',
|
|
1506
|
+
description:
|
|
1507
|
+
'Currency of viewpointAmount. A row spanning multiple currencies takes the largest-magnitude currency group (known simplification, ADR-0126).',
|
|
1508
|
+
example: 'CNY'
|
|
1509
|
+
}
|
|
1510
|
+
},
|
|
1511
|
+
required: [
|
|
1512
|
+
'id',
|
|
1513
|
+
'date',
|
|
1514
|
+
'narration',
|
|
1515
|
+
'tags',
|
|
1516
|
+
'links',
|
|
1517
|
+
'status',
|
|
1518
|
+
'postings',
|
|
1519
|
+
'createdAt'
|
|
1520
|
+
]
|
|
1521
|
+
} as const;
|
|
1522
|
+
|
|
1329
1523
|
export const $BalanceByCurrencyDto = {
|
|
1330
1524
|
type: 'object',
|
|
1331
1525
|
properties: {
|
|
@@ -1371,7 +1565,7 @@ export const $TransactionListSummaryDto = {
|
|
|
1371
1565
|
totalAmount: {
|
|
1372
1566
|
type: 'string',
|
|
1373
1567
|
description:
|
|
1374
|
-
'Partial converted total in base currency (rated currencies only
|
|
1568
|
+
'Partial converted total in base currency (rated currencies only). Sign by viewpoint (ADR-0126): account viewpoint keeps the raw Beancount sign (income negative); category viewpoint is per-leg sign-normalized (Income legs negated, Expenses legs identity — positive under normal booking, not clamped). 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
1569
|
example: '-6000.00'
|
|
1376
1570
|
},
|
|
1377
1571
|
currency: {
|
|
@@ -1397,6 +1591,26 @@ export const $TransactionListSummaryDto = {
|
|
|
1397
1591
|
required: ['totalAmount', 'currency', 'balanceByCurrency']
|
|
1398
1592
|
} as const;
|
|
1399
1593
|
|
|
1594
|
+
export const $TransactionListViewpointDto = {
|
|
1595
|
+
type: 'object',
|
|
1596
|
+
properties: {
|
|
1597
|
+
type: {
|
|
1598
|
+
type: 'string',
|
|
1599
|
+
description:
|
|
1600
|
+
'Viewpoint type (only category drill-down carries a viewpoint today)',
|
|
1601
|
+
enum: ['category'],
|
|
1602
|
+
example: 'category'
|
|
1603
|
+
},
|
|
1604
|
+
flow: {
|
|
1605
|
+
type: 'string',
|
|
1606
|
+
description: 'Flow root the category account set is restricted to',
|
|
1607
|
+
enum: ['income', 'expense'],
|
|
1608
|
+
example: 'expense'
|
|
1609
|
+
}
|
|
1610
|
+
},
|
|
1611
|
+
required: ['type', 'flow']
|
|
1612
|
+
} as const;
|
|
1613
|
+
|
|
1400
1614
|
export const $TransactionListResponseDto = {
|
|
1401
1615
|
type: 'object',
|
|
1402
1616
|
properties: {
|
|
@@ -1404,7 +1618,7 @@ export const $TransactionListResponseDto = {
|
|
|
1404
1618
|
description: 'List of transactions',
|
|
1405
1619
|
type: 'array',
|
|
1406
1620
|
items: {
|
|
1407
|
-
$ref: '#/components/schemas/
|
|
1621
|
+
$ref: '#/components/schemas/TransactionListItemDto'
|
|
1408
1622
|
}
|
|
1409
1623
|
},
|
|
1410
1624
|
total: {
|
|
@@ -1430,6 +1644,15 @@ export const $TransactionListResponseDto = {
|
|
|
1430
1644
|
$ref: '#/components/schemas/TransactionListSummaryDto'
|
|
1431
1645
|
}
|
|
1432
1646
|
]
|
|
1647
|
+
},
|
|
1648
|
+
viewpoint: {
|
|
1649
|
+
description:
|
|
1650
|
+
'Viewpoint metadata (ADR-0126). Present only for a single category filter (category + flow, no accountId); dual-perspective requests are viewpoint-less (raw signs, no viewpointAmount).',
|
|
1651
|
+
allOf: [
|
|
1652
|
+
{
|
|
1653
|
+
$ref: '#/components/schemas/TransactionListViewpointDto'
|
|
1654
|
+
}
|
|
1655
|
+
]
|
|
1433
1656
|
}
|
|
1434
1657
|
},
|
|
1435
1658
|
required: ['data', 'total', 'limit', 'offset']
|
|
@@ -1781,13 +2004,17 @@ export const $ReviewStatsDto = {
|
|
|
1781
2004
|
type: 'object',
|
|
1782
2005
|
description: 'Count by type'
|
|
1783
2006
|
},
|
|
2007
|
+
resolved: {
|
|
2008
|
+
type: 'number',
|
|
2009
|
+
description: 'Current count of reviews in RESOLVED status'
|
|
2010
|
+
},
|
|
1784
2011
|
oldestPending: {
|
|
1785
2012
|
format: 'date-time',
|
|
1786
2013
|
type: 'string',
|
|
1787
2014
|
description: 'Oldest pending review date'
|
|
1788
2015
|
}
|
|
1789
2016
|
},
|
|
1790
|
-
required: ['total', 'byType']
|
|
2017
|
+
required: ['total', 'byType', 'resolved']
|
|
1791
2018
|
} as const;
|
|
1792
2019
|
|
|
1793
2020
|
export const $DecisionOptionDto = {
|
|
@@ -2092,6 +2319,44 @@ export const $BatchResolveDto = {
|
|
|
2092
2319
|
required: ['reviewIds', 'action']
|
|
2093
2320
|
} as const;
|
|
2094
2321
|
|
|
2322
|
+
export const $BatchResolveItemDto = {
|
|
2323
|
+
type: 'object',
|
|
2324
|
+
properties: {
|
|
2325
|
+
reviewId: {
|
|
2326
|
+
type: 'string',
|
|
2327
|
+
description: 'Review item ID'
|
|
2328
|
+
},
|
|
2329
|
+
success: {
|
|
2330
|
+
type: 'boolean',
|
|
2331
|
+
description: 'Whether this item was resolved successfully'
|
|
2332
|
+
},
|
|
2333
|
+
resolutionId: {
|
|
2334
|
+
type: 'string',
|
|
2335
|
+
description:
|
|
2336
|
+
'Resolution ID for undo. Present only on successful items (failed items stay PENDING).'
|
|
2337
|
+
},
|
|
2338
|
+
messageKey: {
|
|
2339
|
+
type: 'string',
|
|
2340
|
+
description:
|
|
2341
|
+
'i18n message key for the per-item failure reason (e.g., review.payee.error.no_suggestion), mirroring the single-item resolve response. Present only on resolver rejections, not on unexpected errors.'
|
|
2342
|
+
},
|
|
2343
|
+
messageParams: {
|
|
2344
|
+
type: 'object',
|
|
2345
|
+
description:
|
|
2346
|
+
'Parameters for message interpolation (e.g., { name: "PayeeName" })',
|
|
2347
|
+
additionalProperties: {
|
|
2348
|
+
type: 'string'
|
|
2349
|
+
}
|
|
2350
|
+
},
|
|
2351
|
+
error: {
|
|
2352
|
+
type: 'string',
|
|
2353
|
+
description:
|
|
2354
|
+
'Diagnostic string: the messageKey on the resolver-rejection path; an i18n key mapped from the exception type on the unexpected-error path (#903, raw exception detail stays in server logs).'
|
|
2355
|
+
}
|
|
2356
|
+
},
|
|
2357
|
+
required: ['reviewId', 'success']
|
|
2358
|
+
} as const;
|
|
2359
|
+
|
|
2095
2360
|
export const $BatchResolveResultDto = {
|
|
2096
2361
|
type: 'object',
|
|
2097
2362
|
properties: {
|
|
@@ -2107,7 +2372,7 @@ export const $BatchResolveResultDto = {
|
|
|
2107
2372
|
description: 'Details for each item',
|
|
2108
2373
|
type: 'array',
|
|
2109
2374
|
items: {
|
|
2110
|
-
|
|
2375
|
+
$ref: '#/components/schemas/BatchResolveItemDto'
|
|
2111
2376
|
}
|
|
2112
2377
|
}
|
|
2113
2378
|
},
|
|
@@ -2340,10 +2605,10 @@ export const $UpdatePayeeDto = {
|
|
|
2340
2605
|
meta: {
|
|
2341
2606
|
type: 'object',
|
|
2342
2607
|
description:
|
|
2343
|
-
'Metadata for extended information (location, notes, contact info, etc.)
|
|
2608
|
+
'Metadata for extended information (location, notes, contact info, etc.)',
|
|
2344
2609
|
example: {
|
|
2345
2610
|
location: 'Zhongguancun',
|
|
2346
|
-
note: '
|
|
2611
|
+
note: 'Near subway station',
|
|
2347
2612
|
favorite: true
|
|
2348
2613
|
}
|
|
2349
2614
|
},
|
|
@@ -2904,568 +3169,660 @@ export const $UpdateCommodityDto = {
|
|
|
2904
3169
|
}
|
|
2905
3170
|
} as const;
|
|
2906
3171
|
|
|
2907
|
-
export const $
|
|
3172
|
+
export const $CurrencyBalanceDto = {
|
|
2908
3173
|
type: 'object',
|
|
2909
3174
|
properties: {
|
|
2910
3175
|
currency: {
|
|
2911
3176
|
type: 'string',
|
|
2912
|
-
description: '
|
|
2913
|
-
example: 'USD'
|
|
2914
|
-
},
|
|
2915
|
-
quoteCurrency: {
|
|
2916
|
-
type: 'string',
|
|
2917
|
-
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
3177
|
+
description: 'ISO 4217 currency code',
|
|
2918
3178
|
example: 'CNY'
|
|
2919
3179
|
},
|
|
2920
|
-
|
|
2921
|
-
type: 'number',
|
|
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,
|
|
2925
|
-
minimum: 0
|
|
2926
|
-
},
|
|
2927
|
-
date: {
|
|
3180
|
+
balance: {
|
|
2928
3181
|
type: 'string',
|
|
2929
|
-
description: '
|
|
2930
|
-
example: '
|
|
2931
|
-
},
|
|
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
|
-
}
|
|
3182
|
+
description: 'Balance amount',
|
|
3183
|
+
example: '500000.00'
|
|
2941
3184
|
}
|
|
2942
3185
|
},
|
|
2943
|
-
required: ['currency', '
|
|
3186
|
+
required: ['currency', 'balance']
|
|
2944
3187
|
} as const;
|
|
2945
3188
|
|
|
2946
|
-
export const $
|
|
3189
|
+
export const $TimeSeriesPointDto = {
|
|
2947
3190
|
type: 'object',
|
|
2948
3191
|
properties: {
|
|
2949
|
-
|
|
3192
|
+
date: {
|
|
2950
3193
|
type: 'string',
|
|
2951
|
-
description: '
|
|
2952
|
-
example: '
|
|
3194
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3195
|
+
example: '2024-06-15'
|
|
2953
3196
|
},
|
|
2954
|
-
|
|
3197
|
+
value: {
|
|
2955
3198
|
type: 'string',
|
|
2956
|
-
description: '
|
|
2957
|
-
example: '
|
|
3199
|
+
description: 'Value at this date (in base currency)',
|
|
3200
|
+
example: '500000.00'
|
|
2958
3201
|
},
|
|
2959
|
-
|
|
3202
|
+
change: {
|
|
2960
3203
|
type: 'string',
|
|
2961
|
-
description: '
|
|
2962
|
-
example: '
|
|
3204
|
+
description: 'Change from previous point',
|
|
3205
|
+
example: '5000.00'
|
|
2963
3206
|
},
|
|
2964
|
-
|
|
3207
|
+
assets: {
|
|
2965
3208
|
type: 'string',
|
|
2966
|
-
description: '
|
|
2967
|
-
example: '
|
|
2968
|
-
},
|
|
2969
|
-
amount: {
|
|
2970
|
-
type: 'number',
|
|
2971
|
-
description:
|
|
2972
|
-
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
2973
|
-
example: 50000
|
|
3209
|
+
description: 'Total assets at this date (in base currency)',
|
|
3210
|
+
example: '494338.00'
|
|
2974
3211
|
},
|
|
2975
|
-
|
|
3212
|
+
liabilities: {
|
|
2976
3213
|
type: 'string',
|
|
2977
|
-
description:
|
|
2978
|
-
|
|
2979
|
-
example: '2024-01-01',
|
|
2980
|
-
format: 'date'
|
|
3214
|
+
description: 'Total liabilities at this date (in base currency)',
|
|
3215
|
+
example: '310098.00'
|
|
2981
3216
|
},
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
source: 'MANUAL',
|
|
2988
|
-
note: 'User-defined price',
|
|
2989
|
-
confidence: 1
|
|
3217
|
+
byCurrency: {
|
|
3218
|
+
description: 'Multi-currency breakdown for this point',
|
|
3219
|
+
type: 'array',
|
|
3220
|
+
items: {
|
|
3221
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
2990
3222
|
}
|
|
3223
|
+
}
|
|
3224
|
+
},
|
|
3225
|
+
required: ['date', 'value']
|
|
3226
|
+
} as const;
|
|
3227
|
+
|
|
3228
|
+
export const $TrendSummaryDto = {
|
|
3229
|
+
type: 'object',
|
|
3230
|
+
properties: {
|
|
3231
|
+
startValue: {
|
|
3232
|
+
type: 'string',
|
|
3233
|
+
description: 'Value at start of period',
|
|
3234
|
+
example: '450000.00'
|
|
2991
3235
|
},
|
|
2992
|
-
|
|
2993
|
-
format: 'date-time',
|
|
3236
|
+
endValue: {
|
|
2994
3237
|
type: 'string',
|
|
2995
|
-
description: '
|
|
2996
|
-
example: '
|
|
3238
|
+
description: 'Value at end of period',
|
|
3239
|
+
example: '500000.00'
|
|
2997
3240
|
},
|
|
2998
|
-
|
|
2999
|
-
format: 'date-time',
|
|
3241
|
+
totalChange: {
|
|
3000
3242
|
type: 'string',
|
|
3001
|
-
description: '
|
|
3002
|
-
example: '
|
|
3243
|
+
description: 'Total change over period',
|
|
3244
|
+
example: '50000.00'
|
|
3245
|
+
},
|
|
3246
|
+
totalChangePercentage: {
|
|
3247
|
+
type: 'string',
|
|
3248
|
+
description: 'Total change percentage',
|
|
3249
|
+
example: '+11.11%'
|
|
3003
3250
|
}
|
|
3004
3251
|
},
|
|
3005
|
-
required: [
|
|
3006
|
-
'id',
|
|
3007
|
-
'userId',
|
|
3008
|
-
'currency',
|
|
3009
|
-
'quoteCurrency',
|
|
3010
|
-
'amount',
|
|
3011
|
-
'date',
|
|
3012
|
-
'meta',
|
|
3013
|
-
'createdAt',
|
|
3014
|
-
'updatedAt'
|
|
3015
|
-
]
|
|
3252
|
+
required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
|
|
3016
3253
|
} as const;
|
|
3017
3254
|
|
|
3018
|
-
export const $
|
|
3255
|
+
export const $MultiCurrencyPointDto = {
|
|
3019
3256
|
type: 'object',
|
|
3020
3257
|
properties: {
|
|
3021
|
-
|
|
3022
|
-
|
|
3258
|
+
date: {
|
|
3259
|
+
type: 'string',
|
|
3260
|
+
description: 'Date in YYYY-MM-DD format',
|
|
3261
|
+
example: '2024-06-15'
|
|
3262
|
+
},
|
|
3263
|
+
byCurrency: {
|
|
3264
|
+
description: 'Balances by currency',
|
|
3023
3265
|
type: 'array',
|
|
3024
3266
|
items: {
|
|
3025
|
-
$ref: '#/components/schemas/
|
|
3267
|
+
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3026
3268
|
}
|
|
3027
|
-
},
|
|
3028
|
-
total: {
|
|
3029
|
-
type: 'number',
|
|
3030
|
-
description: 'Total number of prices',
|
|
3031
|
-
example: 42
|
|
3032
3269
|
}
|
|
3033
3270
|
},
|
|
3034
|
-
required: ['
|
|
3271
|
+
required: ['date', 'byCurrency']
|
|
3035
3272
|
} as const;
|
|
3036
3273
|
|
|
3037
|
-
export const $
|
|
3274
|
+
export const $PortfolioTrendsResponseDto = {
|
|
3038
3275
|
type: 'object',
|
|
3039
3276
|
properties: {
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3277
|
+
series: {
|
|
3278
|
+
description: 'Time series data points',
|
|
3279
|
+
type: 'array',
|
|
3280
|
+
items: {
|
|
3281
|
+
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
3282
|
+
}
|
|
3043
3283
|
},
|
|
3044
|
-
|
|
3284
|
+
summary: {
|
|
3285
|
+
description: 'Period summary',
|
|
3286
|
+
allOf: [
|
|
3287
|
+
{
|
|
3288
|
+
$ref: '#/components/schemas/TrendSummaryDto'
|
|
3289
|
+
}
|
|
3290
|
+
]
|
|
3291
|
+
},
|
|
3292
|
+
period: {
|
|
3045
3293
|
type: 'string',
|
|
3046
|
-
description: '
|
|
3294
|
+
description: 'Period requested',
|
|
3295
|
+
example: '6m'
|
|
3047
3296
|
},
|
|
3048
|
-
|
|
3049
|
-
type: '
|
|
3050
|
-
description: '
|
|
3051
|
-
|
|
3297
|
+
granularity: {
|
|
3298
|
+
type: 'string',
|
|
3299
|
+
description: 'Data granularity',
|
|
3300
|
+
example: 'month'
|
|
3052
3301
|
},
|
|
3053
|
-
|
|
3302
|
+
currency: {
|
|
3054
3303
|
type: 'string',
|
|
3055
|
-
description: '
|
|
3304
|
+
description: 'Base currency for converted values',
|
|
3305
|
+
example: 'CNY'
|
|
3056
3306
|
},
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
|
|
3307
|
+
byCurrency: {
|
|
3308
|
+
description:
|
|
3309
|
+
'Multi-currency time series (each point has currency breakdown)',
|
|
3310
|
+
type: 'array',
|
|
3311
|
+
items: {
|
|
3312
|
+
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
3313
|
+
}
|
|
3314
|
+
},
|
|
3315
|
+
warnings: {
|
|
3316
|
+
description: 'Exchange rate warnings',
|
|
3317
|
+
type: 'array',
|
|
3318
|
+
items: {
|
|
3319
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
3320
|
+
}
|
|
3060
3321
|
}
|
|
3061
|
-
}
|
|
3322
|
+
},
|
|
3323
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
3062
3324
|
} as const;
|
|
3063
3325
|
|
|
3064
|
-
export const $
|
|
3326
|
+
export const $CashFlowPointDto = {
|
|
3065
3327
|
type: 'object',
|
|
3066
3328
|
properties: {
|
|
3067
|
-
|
|
3329
|
+
month: {
|
|
3068
3330
|
type: 'string',
|
|
3069
|
-
description: '
|
|
3070
|
-
|
|
3331
|
+
description: 'Month key (YYYY-MM)',
|
|
3332
|
+
example: '2024-03'
|
|
3071
3333
|
},
|
|
3072
|
-
|
|
3334
|
+
income: {
|
|
3073
3335
|
type: 'string',
|
|
3074
|
-
description: '
|
|
3075
|
-
|
|
3336
|
+
description: 'Income in base currency (absolute, converted)',
|
|
3337
|
+
example: '10000.00'
|
|
3076
3338
|
},
|
|
3077
|
-
|
|
3339
|
+
expense: {
|
|
3078
3340
|
type: 'string',
|
|
3079
|
-
description: '
|
|
3080
|
-
|
|
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
|
|
3341
|
+
description: 'Expense in base currency (absolute, converted)',
|
|
3342
|
+
example: '5000.00'
|
|
3100
3343
|
},
|
|
3101
|
-
|
|
3102
|
-
type: '
|
|
3103
|
-
description: '
|
|
3104
|
-
|
|
3344
|
+
netSavings: {
|
|
3345
|
+
type: 'string',
|
|
3346
|
+
description: 'netSavings = income − expense (savings positive)',
|
|
3347
|
+
example: '5000.00'
|
|
3348
|
+
}
|
|
3349
|
+
},
|
|
3350
|
+
required: ['month', 'income', 'expense', 'netSavings']
|
|
3351
|
+
} as const;
|
|
3352
|
+
|
|
3353
|
+
export const $CashFlowTrendSummaryDto = {
|
|
3354
|
+
type: 'object',
|
|
3355
|
+
properties: {
|
|
3356
|
+
totalIncome: {
|
|
3357
|
+
type: 'string',
|
|
3358
|
+
description: 'Total income across the period',
|
|
3359
|
+
example: '60000.00'
|
|
3105
3360
|
},
|
|
3106
|
-
|
|
3361
|
+
totalExpense: {
|
|
3107
3362
|
type: 'string',
|
|
3108
|
-
description: '
|
|
3109
|
-
|
|
3110
|
-
maxLength: 10
|
|
3363
|
+
description: 'Total expense across the period',
|
|
3364
|
+
example: '30000.00'
|
|
3111
3365
|
},
|
|
3112
|
-
|
|
3366
|
+
totalNetSavings: {
|
|
3113
3367
|
type: 'string',
|
|
3114
|
-
description: '
|
|
3115
|
-
|
|
3368
|
+
description: 'income − expense across the period',
|
|
3369
|
+
example: '30000.00'
|
|
3116
3370
|
},
|
|
3117
|
-
|
|
3118
|
-
type: 'number',
|
|
3119
|
-
description: 'Amount tolerance percentage (0-1)',
|
|
3120
|
-
default: 0.075,
|
|
3121
|
-
minimum: 0,
|
|
3122
|
-
maximum: 1
|
|
3123
|
-
},
|
|
3124
|
-
defaultExpenseAccount: {
|
|
3371
|
+
averageMonthlyNetSavings: {
|
|
3125
3372
|
type: 'string',
|
|
3126
|
-
description:
|
|
3127
|
-
|
|
3373
|
+
description:
|
|
3374
|
+
'totalNetSavings divided by the window length (N months, incl. zero-filled)',
|
|
3375
|
+
example: '5000.00'
|
|
3376
|
+
}
|
|
3377
|
+
},
|
|
3378
|
+
required: [
|
|
3379
|
+
'totalIncome',
|
|
3380
|
+
'totalExpense',
|
|
3381
|
+
'totalNetSavings',
|
|
3382
|
+
'averageMonthlyNetSavings'
|
|
3383
|
+
]
|
|
3384
|
+
} as const;
|
|
3385
|
+
|
|
3386
|
+
export const $CashFlowTrendsResponseDto = {
|
|
3387
|
+
type: 'object',
|
|
3388
|
+
properties: {
|
|
3389
|
+
series: {
|
|
3390
|
+
description:
|
|
3391
|
+
'Monthly cash-flow series (fixed N-month window, zero-filled)',
|
|
3392
|
+
type: 'array',
|
|
3393
|
+
items: {
|
|
3394
|
+
$ref: '#/components/schemas/CashFlowPointDto'
|
|
3395
|
+
}
|
|
3128
3396
|
},
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3397
|
+
summary: {
|
|
3398
|
+
description: 'Period totals',
|
|
3399
|
+
allOf: [
|
|
3400
|
+
{
|
|
3401
|
+
$ref: '#/components/schemas/CashFlowTrendSummaryDto'
|
|
3402
|
+
}
|
|
3403
|
+
]
|
|
3133
3404
|
},
|
|
3134
|
-
|
|
3405
|
+
period: {
|
|
3135
3406
|
type: 'string',
|
|
3136
|
-
description: '
|
|
3137
|
-
|
|
3138
|
-
},
|
|
3139
|
-
autoCreate: {
|
|
3140
|
-
type: 'boolean',
|
|
3141
|
-
description: 'Auto-create transaction when expected date arrives',
|
|
3142
|
-
default: false
|
|
3407
|
+
description: 'Period requested',
|
|
3408
|
+
example: '6m'
|
|
3143
3409
|
},
|
|
3144
|
-
|
|
3410
|
+
granularity: {
|
|
3145
3411
|
type: 'string',
|
|
3146
|
-
description: '
|
|
3412
|
+
description: 'Data granularity (v1 returns month buckets)',
|
|
3413
|
+
example: 'month'
|
|
3147
3414
|
},
|
|
3148
|
-
|
|
3415
|
+
currency: {
|
|
3149
3416
|
type: 'string',
|
|
3150
|
-
description: '
|
|
3417
|
+
description: 'Base currency for converted values',
|
|
3418
|
+
example: 'CNY'
|
|
3419
|
+
},
|
|
3420
|
+
warnings: {
|
|
3421
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
3422
|
+
type: 'array',
|
|
3423
|
+
items: {
|
|
3424
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
3425
|
+
}
|
|
3151
3426
|
}
|
|
3152
3427
|
},
|
|
3153
|
-
required: [
|
|
3154
|
-
'name',
|
|
3155
|
-
'frequency',
|
|
3156
|
-
'expectedAmount',
|
|
3157
|
-
'currency',
|
|
3158
|
-
'matchAmountTolerance',
|
|
3159
|
-
'autoCreate'
|
|
3160
|
-
]
|
|
3428
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
3161
3429
|
} as const;
|
|
3162
3430
|
|
|
3163
|
-
export const $
|
|
3431
|
+
export const $GenerateSnapshotBody = {
|
|
3432
|
+
type: 'object',
|
|
3433
|
+
properties: {}
|
|
3434
|
+
} as const;
|
|
3435
|
+
|
|
3436
|
+
export const $GenerateSnapshotResponse = {
|
|
3437
|
+
type: 'object',
|
|
3438
|
+
properties: {}
|
|
3439
|
+
} as const;
|
|
3440
|
+
|
|
3441
|
+
export const $BackfillSnapshotsBody = {
|
|
3442
|
+
type: 'object',
|
|
3443
|
+
properties: {}
|
|
3444
|
+
} as const;
|
|
3445
|
+
|
|
3446
|
+
export const $BackfillSnapshotsResponse = {
|
|
3447
|
+
type: 'object',
|
|
3448
|
+
properties: {}
|
|
3449
|
+
} as const;
|
|
3450
|
+
|
|
3451
|
+
export const $CreateBeanPriceDto = {
|
|
3164
3452
|
type: 'object',
|
|
3165
3453
|
properties: {
|
|
3166
|
-
|
|
3167
|
-
type: 'string',
|
|
3168
|
-
description: 'Rule ID'
|
|
3169
|
-
},
|
|
3170
|
-
userId: {
|
|
3454
|
+
currency: {
|
|
3171
3455
|
type: 'string',
|
|
3172
|
-
description: '
|
|
3456
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
3457
|
+
example: 'USD'
|
|
3173
3458
|
},
|
|
3174
|
-
|
|
3459
|
+
quoteCurrency: {
|
|
3175
3460
|
type: 'string',
|
|
3176
|
-
description: '
|
|
3461
|
+
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
3462
|
+
example: 'CNY'
|
|
3177
3463
|
},
|
|
3178
|
-
|
|
3179
|
-
type: '
|
|
3180
|
-
description:
|
|
3464
|
+
amount: {
|
|
3465
|
+
type: 'number',
|
|
3466
|
+
description:
|
|
3467
|
+
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
3468
|
+
example: 175.5,
|
|
3469
|
+
minimum: 0
|
|
3181
3470
|
},
|
|
3182
|
-
|
|
3471
|
+
date: {
|
|
3183
3472
|
type: 'string',
|
|
3184
|
-
description: '
|
|
3185
|
-
|
|
3186
|
-
expectedAmount: {
|
|
3187
|
-
type: 'number',
|
|
3188
|
-
description: 'Expected amount'
|
|
3473
|
+
description: 'Price date (ISO 8601 format)',
|
|
3474
|
+
example: '2024-11-05'
|
|
3189
3475
|
},
|
|
3190
|
-
|
|
3476
|
+
metadata: {
|
|
3191
3477
|
type: 'object',
|
|
3192
|
-
description:
|
|
3478
|
+
description:
|
|
3479
|
+
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
3480
|
+
example: {
|
|
3481
|
+
source: 'MANUAL',
|
|
3482
|
+
note: 'Bank valuation report',
|
|
3483
|
+
confidence: 0.95
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
},
|
|
3487
|
+
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
3488
|
+
} as const;
|
|
3489
|
+
|
|
3490
|
+
export const $PriceResponseDto = {
|
|
3491
|
+
type: 'object',
|
|
3492
|
+
properties: {
|
|
3493
|
+
id: {
|
|
3494
|
+
type: 'string',
|
|
3495
|
+
description: 'Unique identifier',
|
|
3496
|
+
example: 'uuid-123-456'
|
|
3193
3497
|
},
|
|
3194
|
-
|
|
3195
|
-
type: '
|
|
3196
|
-
description: '
|
|
3498
|
+
userId: {
|
|
3499
|
+
type: 'string',
|
|
3500
|
+
description: 'User ID (owner of the price)',
|
|
3501
|
+
example: 'user-123'
|
|
3197
3502
|
},
|
|
3198
3503
|
currency: {
|
|
3199
3504
|
type: 'string',
|
|
3200
|
-
description: 'Currency
|
|
3505
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
3506
|
+
example: 'BTC'
|
|
3201
3507
|
},
|
|
3202
|
-
|
|
3203
|
-
type: '
|
|
3204
|
-
description: '
|
|
3508
|
+
quoteCurrency: {
|
|
3509
|
+
type: 'string',
|
|
3510
|
+
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
3511
|
+
example: 'USD'
|
|
3205
3512
|
},
|
|
3206
|
-
|
|
3513
|
+
amount: {
|
|
3207
3514
|
type: 'number',
|
|
3208
|
-
description:
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
type: 'object',
|
|
3212
|
-
description: 'Default expense account'
|
|
3213
|
-
},
|
|
3214
|
-
defaultPaymentAccount: {
|
|
3215
|
-
type: 'object',
|
|
3216
|
-
description: 'Default payment account'
|
|
3217
|
-
},
|
|
3218
|
-
defaultPayee: {
|
|
3219
|
-
type: 'object',
|
|
3220
|
-
description: 'Default payee'
|
|
3221
|
-
},
|
|
3222
|
-
isActive: {
|
|
3223
|
-
type: 'boolean',
|
|
3224
|
-
description: 'Whether rule is active'
|
|
3515
|
+
description:
|
|
3516
|
+
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
3517
|
+
example: 50000
|
|
3225
3518
|
},
|
|
3226
|
-
|
|
3519
|
+
date: {
|
|
3227
3520
|
type: 'string',
|
|
3228
|
-
description:
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
3232
|
-
description: 'Rule end date (YYYY-MM-DD)'
|
|
3233
|
-
},
|
|
3234
|
-
autoCreate: {
|
|
3235
|
-
type: 'boolean',
|
|
3236
|
-
description: 'Auto-create transaction on expected date'
|
|
3521
|
+
description:
|
|
3522
|
+
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
3523
|
+
example: '2024-01-01',
|
|
3524
|
+
format: 'date'
|
|
3237
3525
|
},
|
|
3238
|
-
|
|
3526
|
+
meta: {
|
|
3239
3527
|
type: 'object',
|
|
3240
|
-
description:
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3528
|
+
description:
|
|
3529
|
+
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
3530
|
+
example: {
|
|
3531
|
+
source: 'MANUAL',
|
|
3532
|
+
note: 'User-defined price',
|
|
3533
|
+
confidence: 1
|
|
3534
|
+
}
|
|
3245
3535
|
},
|
|
3246
3536
|
createdAt: {
|
|
3247
3537
|
format: 'date-time',
|
|
3248
3538
|
type: 'string',
|
|
3249
|
-
description: '
|
|
3539
|
+
description: 'Creation timestamp',
|
|
3540
|
+
example: '2024-11-03T10:00:00Z'
|
|
3250
3541
|
},
|
|
3251
3542
|
updatedAt: {
|
|
3252
3543
|
format: 'date-time',
|
|
3253
3544
|
type: 'string',
|
|
3254
|
-
description: '
|
|
3545
|
+
description: 'Last update timestamp',
|
|
3546
|
+
example: '2024-11-03T10:00:00Z'
|
|
3255
3547
|
}
|
|
3256
3548
|
},
|
|
3257
3549
|
required: [
|
|
3258
3550
|
'id',
|
|
3259
3551
|
'userId',
|
|
3260
|
-
'name',
|
|
3261
|
-
'frequency',
|
|
3262
|
-
'expectedAmount',
|
|
3263
3552
|
'currency',
|
|
3264
|
-
'
|
|
3265
|
-
'
|
|
3266
|
-
'
|
|
3267
|
-
'
|
|
3268
|
-
'totalCount',
|
|
3553
|
+
'quoteCurrency',
|
|
3554
|
+
'amount',
|
|
3555
|
+
'date',
|
|
3556
|
+
'meta',
|
|
3269
3557
|
'createdAt',
|
|
3270
3558
|
'updatedAt'
|
|
3271
3559
|
]
|
|
3272
3560
|
} as const;
|
|
3273
3561
|
|
|
3274
|
-
export const $
|
|
3562
|
+
export const $PriceListResponseDto = {
|
|
3275
3563
|
type: 'object',
|
|
3276
3564
|
properties: {
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
'
|
|
3282
|
-
|
|
3283
|
-
'MONTHLY',
|
|
3284
|
-
'BIMONTHLY',
|
|
3285
|
-
'QUARTERLY',
|
|
3286
|
-
'YEARLY',
|
|
3287
|
-
'CUSTOM'
|
|
3288
|
-
],
|
|
3289
|
-
example: 'MONTHLY'
|
|
3290
|
-
},
|
|
3291
|
-
name: {
|
|
3292
|
-
type: 'string',
|
|
3293
|
-
description: 'Optional name override (default: transaction payee)',
|
|
3294
|
-
maxLength: 100
|
|
3565
|
+
items: {
|
|
3566
|
+
description: 'List of prices',
|
|
3567
|
+
type: 'array',
|
|
3568
|
+
items: {
|
|
3569
|
+
$ref: '#/components/schemas/PriceResponseDto'
|
|
3570
|
+
}
|
|
3295
3571
|
},
|
|
3296
|
-
|
|
3297
|
-
type: '
|
|
3298
|
-
description: '
|
|
3299
|
-
|
|
3572
|
+
total: {
|
|
3573
|
+
type: 'number',
|
|
3574
|
+
description: 'Total number of prices',
|
|
3575
|
+
example: 42
|
|
3300
3576
|
}
|
|
3301
3577
|
},
|
|
3302
|
-
required: ['
|
|
3578
|
+
required: ['items', 'total']
|
|
3303
3579
|
} as const;
|
|
3304
3580
|
|
|
3305
|
-
export const $
|
|
3581
|
+
export const $UpdateBeanPriceDto = {
|
|
3306
3582
|
type: 'object',
|
|
3307
3583
|
properties: {
|
|
3308
|
-
|
|
3584
|
+
currency: {
|
|
3309
3585
|
type: 'string',
|
|
3310
|
-
description: '
|
|
3586
|
+
description: 'Currency being priced'
|
|
3311
3587
|
},
|
|
3312
|
-
|
|
3588
|
+
quoteCurrency: {
|
|
3313
3589
|
type: 'string',
|
|
3314
|
-
description: '
|
|
3590
|
+
description: 'Quote currency (pricing currency)'
|
|
3315
3591
|
},
|
|
3316
|
-
|
|
3592
|
+
amount: {
|
|
3593
|
+
type: 'number',
|
|
3594
|
+
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
3595
|
+
minimum: 0
|
|
3596
|
+
},
|
|
3597
|
+
date: {
|
|
3317
3598
|
type: 'string',
|
|
3318
|
-
description: '
|
|
3599
|
+
description: 'Price date (ISO 8601 format)'
|
|
3319
3600
|
},
|
|
3320
|
-
|
|
3601
|
+
metadata: {
|
|
3321
3602
|
type: 'object',
|
|
3322
|
-
description: '
|
|
3323
|
-
}
|
|
3324
|
-
|
|
3603
|
+
description: 'Metadata'
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
} as const;
|
|
3607
|
+
|
|
3608
|
+
export const $DeleteOwnUserDto = {
|
|
3609
|
+
type: 'object',
|
|
3610
|
+
properties: {
|
|
3611
|
+
accessToken: {
|
|
3325
3612
|
type: 'string',
|
|
3326
|
-
description: '
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3613
|
+
description: 'Access token for user verification',
|
|
3614
|
+
example: 'abc123xyz'
|
|
3615
|
+
}
|
|
3616
|
+
},
|
|
3617
|
+
required: ['accessToken']
|
|
3618
|
+
} as const;
|
|
3619
|
+
|
|
3620
|
+
export const $UserSettingsResponseDto = {
|
|
3621
|
+
type: 'object',
|
|
3622
|
+
properties: {
|
|
3623
|
+
baseCurrency: {
|
|
3624
|
+
type: 'string',
|
|
3625
|
+
description:
|
|
3626
|
+
'Stored base currency choice (ISO 4217) for net-worth/report aggregation. null = user never chose; aggregates fall back to the region default at display time (#713).',
|
|
3627
|
+
example: 'USD',
|
|
3628
|
+
nullable: true
|
|
3629
|
+
}
|
|
3630
|
+
},
|
|
3631
|
+
required: ['baseCurrency']
|
|
3632
|
+
} as const;
|
|
3633
|
+
|
|
3634
|
+
export const $UserResponseDto = {
|
|
3635
|
+
type: 'object',
|
|
3636
|
+
properties: {
|
|
3637
|
+
id: {
|
|
3638
|
+
type: 'string',
|
|
3639
|
+
description: 'User ID'
|
|
3331
3640
|
},
|
|
3332
|
-
|
|
3333
|
-
type: '
|
|
3334
|
-
description: '
|
|
3641
|
+
role: {
|
|
3642
|
+
type: 'string',
|
|
3643
|
+
description: 'Assigned user role'
|
|
3335
3644
|
},
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3645
|
+
permissions: {
|
|
3646
|
+
description: 'Permission strings',
|
|
3647
|
+
type: 'array',
|
|
3648
|
+
items: {
|
|
3649
|
+
type: 'string'
|
|
3650
|
+
}
|
|
3339
3651
|
},
|
|
3340
|
-
|
|
3652
|
+
settings: {
|
|
3653
|
+
description: 'User settings',
|
|
3654
|
+
allOf: [
|
|
3655
|
+
{
|
|
3656
|
+
$ref: '#/components/schemas/UserSettingsResponseDto'
|
|
3657
|
+
}
|
|
3658
|
+
]
|
|
3659
|
+
}
|
|
3660
|
+
},
|
|
3661
|
+
required: ['id', 'role', 'permissions', 'settings']
|
|
3662
|
+
} as const;
|
|
3663
|
+
|
|
3664
|
+
export const $SignupDto = {
|
|
3665
|
+
type: 'object',
|
|
3666
|
+
properties: {
|
|
3667
|
+
turnstileToken: {
|
|
3341
3668
|
type: 'string',
|
|
3342
|
-
description:
|
|
3669
|
+
description:
|
|
3670
|
+
'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
|
|
3671
|
+
example: '0.abc123def456...'
|
|
3672
|
+
}
|
|
3673
|
+
}
|
|
3674
|
+
} as const;
|
|
3675
|
+
|
|
3676
|
+
export const $SignupResponseDto = {
|
|
3677
|
+
type: 'object',
|
|
3678
|
+
properties: {
|
|
3679
|
+
authToken: {
|
|
3680
|
+
type: 'string',
|
|
3681
|
+
description: 'JWT auth token',
|
|
3682
|
+
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
3343
3683
|
},
|
|
3344
|
-
|
|
3345
|
-
type: '
|
|
3346
|
-
description: '
|
|
3684
|
+
accessToken: {
|
|
3685
|
+
type: 'string',
|
|
3686
|
+
description: 'Auto-generated access token'
|
|
3347
3687
|
},
|
|
3348
|
-
|
|
3688
|
+
role: {
|
|
3689
|
+
type: 'string',
|
|
3690
|
+
description: 'Assigned user role',
|
|
3691
|
+
enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
|
|
3692
|
+
}
|
|
3693
|
+
},
|
|
3694
|
+
required: ['authToken', 'accessToken', 'role']
|
|
3695
|
+
} as const;
|
|
3696
|
+
|
|
3697
|
+
export const $UpdateUserSettingDto = {
|
|
3698
|
+
type: 'object',
|
|
3699
|
+
properties: {
|
|
3700
|
+
secId: {
|
|
3349
3701
|
type: 'number',
|
|
3350
|
-
description: '
|
|
3702
|
+
description: 'Security ID'
|
|
3351
3703
|
},
|
|
3352
|
-
|
|
3353
|
-
type: '
|
|
3354
|
-
description: '
|
|
3704
|
+
annualInterestRate: {
|
|
3705
|
+
type: 'number',
|
|
3706
|
+
description: 'Annual interest rate',
|
|
3707
|
+
example: 0.05
|
|
3355
3708
|
},
|
|
3356
|
-
|
|
3357
|
-
type: '
|
|
3358
|
-
description: '
|
|
3709
|
+
currency: {
|
|
3710
|
+
type: 'string',
|
|
3711
|
+
description: 'Currency code',
|
|
3712
|
+
example: 'USD'
|
|
3359
3713
|
},
|
|
3360
|
-
|
|
3361
|
-
type: '
|
|
3362
|
-
description: '
|
|
3714
|
+
baseCurrency: {
|
|
3715
|
+
type: 'string',
|
|
3716
|
+
description: 'Base currency code',
|
|
3717
|
+
example: 'USD'
|
|
3363
3718
|
},
|
|
3364
|
-
|
|
3365
|
-
type: '
|
|
3366
|
-
description: '
|
|
3719
|
+
benchmark: {
|
|
3720
|
+
type: 'string',
|
|
3721
|
+
description: 'Benchmark symbol',
|
|
3722
|
+
example: 'SPY'
|
|
3367
3723
|
},
|
|
3368
|
-
|
|
3724
|
+
colorScheme: {
|
|
3369
3725
|
type: 'string',
|
|
3370
|
-
description: '
|
|
3726
|
+
description: 'Color scheme',
|
|
3727
|
+
enum: ['DARK', 'LIGHT']
|
|
3371
3728
|
},
|
|
3372
|
-
|
|
3373
|
-
type: '
|
|
3374
|
-
description: '
|
|
3729
|
+
dateRange: {
|
|
3730
|
+
type: 'string',
|
|
3731
|
+
description: 'Date range filter',
|
|
3732
|
+
example: '1y'
|
|
3375
3733
|
},
|
|
3376
|
-
|
|
3377
|
-
type: '
|
|
3378
|
-
description: '
|
|
3734
|
+
emergencyFund: {
|
|
3735
|
+
type: 'number',
|
|
3736
|
+
description: 'Emergency fund amount',
|
|
3737
|
+
example: 10000
|
|
3379
3738
|
},
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3739
|
+
'filters.accounts': {
|
|
3740
|
+
description: 'Account filter IDs',
|
|
3741
|
+
type: 'array',
|
|
3742
|
+
items: {
|
|
3743
|
+
type: 'string'
|
|
3744
|
+
}
|
|
3383
3745
|
},
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3746
|
+
'filters.assetClasses': {
|
|
3747
|
+
description: 'Asset class filters',
|
|
3748
|
+
type: 'array',
|
|
3749
|
+
items: {
|
|
3750
|
+
type: 'string'
|
|
3751
|
+
}
|
|
3387
3752
|
},
|
|
3388
|
-
|
|
3389
|
-
format: 'date-time',
|
|
3753
|
+
'filters.dataSource': {
|
|
3390
3754
|
type: 'string',
|
|
3391
|
-
description: '
|
|
3755
|
+
description: 'Data source filter'
|
|
3392
3756
|
},
|
|
3393
|
-
|
|
3394
|
-
format: 'date-time',
|
|
3757
|
+
'filters.symbol': {
|
|
3395
3758
|
type: 'string',
|
|
3396
|
-
description: '
|
|
3759
|
+
description: 'Symbol filter'
|
|
3397
3760
|
},
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3761
|
+
'filters.tags': {
|
|
3762
|
+
description: 'Tag filters',
|
|
3763
|
+
type: 'array',
|
|
3764
|
+
items: {
|
|
3765
|
+
type: 'string'
|
|
3766
|
+
}
|
|
3401
3767
|
},
|
|
3402
|
-
|
|
3403
|
-
type: '
|
|
3404
|
-
description: '
|
|
3768
|
+
isExperimentalFeatures: {
|
|
3769
|
+
type: 'boolean',
|
|
3770
|
+
description: 'Enable experimental features'
|
|
3405
3771
|
},
|
|
3406
|
-
|
|
3407
|
-
type: '
|
|
3408
|
-
description: '
|
|
3772
|
+
isRestrictedView: {
|
|
3773
|
+
type: 'boolean',
|
|
3774
|
+
description: 'Enable restricted view mode'
|
|
3409
3775
|
},
|
|
3410
|
-
|
|
3411
|
-
type: '
|
|
3412
|
-
description: '
|
|
3776
|
+
language: {
|
|
3777
|
+
type: 'string',
|
|
3778
|
+
description: 'Language code',
|
|
3779
|
+
example: 'en'
|
|
3413
3780
|
},
|
|
3414
|
-
|
|
3415
|
-
type: '
|
|
3416
|
-
description: '
|
|
3781
|
+
locale: {
|
|
3782
|
+
type: 'string',
|
|
3783
|
+
description: 'Locale code',
|
|
3784
|
+
example: 'en-US'
|
|
3417
3785
|
},
|
|
3418
|
-
|
|
3786
|
+
projectedTotalAmount: {
|
|
3419
3787
|
type: 'number',
|
|
3420
|
-
description: '
|
|
3421
|
-
|
|
3422
|
-
firstDate: {
|
|
3423
|
-
type: 'object',
|
|
3424
|
-
description: 'First matched transaction date (YYYY-MM-DD)'
|
|
3788
|
+
description: 'Projected total amount',
|
|
3789
|
+
example: 1000000
|
|
3425
3790
|
},
|
|
3426
|
-
|
|
3427
|
-
type: '
|
|
3428
|
-
description: '
|
|
3791
|
+
retirementDate: {
|
|
3792
|
+
type: 'string',
|
|
3793
|
+
description: 'Retirement date in ISO 8601 format',
|
|
3794
|
+
example: '2050-01-01'
|
|
3429
3795
|
},
|
|
3430
|
-
|
|
3796
|
+
savingsRate: {
|
|
3431
3797
|
type: 'number',
|
|
3432
|
-
description: '
|
|
3798
|
+
description: 'Savings rate percentage',
|
|
3799
|
+
example: 0.2
|
|
3433
3800
|
},
|
|
3434
|
-
|
|
3435
|
-
type: '
|
|
3436
|
-
description: '
|
|
3801
|
+
viewMode: {
|
|
3802
|
+
type: 'string',
|
|
3803
|
+
description: 'View mode',
|
|
3804
|
+
enum: ['DEFAULT', 'ZEN']
|
|
3805
|
+
}
|
|
3806
|
+
}
|
|
3807
|
+
} as const;
|
|
3808
|
+
|
|
3809
|
+
export const $UpdatePropertyDto = {
|
|
3810
|
+
type: 'object',
|
|
3811
|
+
properties: {
|
|
3812
|
+
value: {
|
|
3813
|
+
type: 'string',
|
|
3814
|
+
description: 'Property value'
|
|
3437
3815
|
}
|
|
3438
3816
|
},
|
|
3439
|
-
required: [
|
|
3440
|
-
'id',
|
|
3441
|
-
'userId',
|
|
3442
|
-
'name',
|
|
3443
|
-
'frequency',
|
|
3444
|
-
'expectedAmount',
|
|
3445
|
-
'currency',
|
|
3446
|
-
'matchAmountTolerance',
|
|
3447
|
-
'isActive',
|
|
3448
|
-
'startDate',
|
|
3449
|
-
'autoCreate',
|
|
3450
|
-
'totalCount',
|
|
3451
|
-
'createdAt',
|
|
3452
|
-
'updatedAt',
|
|
3453
|
-
'pendingCount',
|
|
3454
|
-
'overdueCount',
|
|
3455
|
-
'totalAmount',
|
|
3456
|
-
'averageAmount',
|
|
3457
|
-
'transactionCount',
|
|
3458
|
-
'variance',
|
|
3459
|
-
'upcomingCount'
|
|
3460
|
-
]
|
|
3817
|
+
required: ['value']
|
|
3461
3818
|
} as const;
|
|
3462
3819
|
|
|
3463
|
-
export const $
|
|
3820
|
+
export const $CreateRecurringRuleDto = {
|
|
3464
3821
|
type: 'object',
|
|
3465
3822
|
properties: {
|
|
3466
3823
|
name: {
|
|
3467
3824
|
type: 'string',
|
|
3468
|
-
description: 'Rule name',
|
|
3825
|
+
description: 'Rule name (unique per user)',
|
|
3469
3826
|
maxLength: 100
|
|
3470
3827
|
},
|
|
3471
3828
|
icon: {
|
|
@@ -3488,7 +3845,7 @@ export const $UpdateRecurringRuleDto = {
|
|
|
3488
3845
|
},
|
|
3489
3846
|
expectedAmount: {
|
|
3490
3847
|
type: 'number',
|
|
3491
|
-
description: 'Expected amount',
|
|
3848
|
+
description: 'Expected amount (positive number)',
|
|
3492
3849
|
minimum: 0
|
|
3493
3850
|
},
|
|
3494
3851
|
expectedDay: {
|
|
@@ -3499,7 +3856,7 @@ export const $UpdateRecurringRuleDto = {
|
|
|
3499
3856
|
},
|
|
3500
3857
|
customIntervalDays: {
|
|
3501
3858
|
type: 'number',
|
|
3502
|
-
description: 'Custom interval in days',
|
|
3859
|
+
description: 'Custom interval in days (required for CUSTOM frequency)',
|
|
3503
3860
|
minimum: 1
|
|
3504
3861
|
},
|
|
3505
3862
|
currency: {
|
|
@@ -3509,118 +3866,136 @@ export const $UpdateRecurringRuleDto = {
|
|
|
3509
3866
|
},
|
|
3510
3867
|
matchPayeePattern: {
|
|
3511
3868
|
type: 'string',
|
|
3512
|
-
description: 'Payee matching pattern',
|
|
3869
|
+
description: 'Payee matching pattern (supports wildcards)',
|
|
3513
3870
|
maxLength: 200
|
|
3514
3871
|
},
|
|
3515
3872
|
matchAmountTolerance: {
|
|
3516
3873
|
type: 'number',
|
|
3517
3874
|
description: 'Amount tolerance percentage (0-1)',
|
|
3875
|
+
default: 0.075,
|
|
3518
3876
|
minimum: 0,
|
|
3519
3877
|
maximum: 1
|
|
3520
3878
|
},
|
|
3521
3879
|
defaultExpenseAccount: {
|
|
3522
3880
|
type: 'string',
|
|
3523
|
-
description: 'Default expense account',
|
|
3881
|
+
description: 'Default expense account for auto-create',
|
|
3524
3882
|
maxLength: 200
|
|
3525
3883
|
},
|
|
3526
3884
|
defaultPaymentAccount: {
|
|
3527
3885
|
type: 'string',
|
|
3528
|
-
description: 'Default payment account',
|
|
3886
|
+
description: 'Default payment account for auto-create',
|
|
3529
3887
|
maxLength: 200
|
|
3530
3888
|
},
|
|
3531
3889
|
defaultPayee: {
|
|
3532
3890
|
type: 'string',
|
|
3533
|
-
description: 'Default payee',
|
|
3891
|
+
description: 'Default payee for auto-create',
|
|
3534
3892
|
maxLength: 200
|
|
3535
3893
|
},
|
|
3536
3894
|
autoCreate: {
|
|
3537
3895
|
type: 'boolean',
|
|
3538
|
-
description: 'Auto-create transaction'
|
|
3896
|
+
description: 'Auto-create transaction when expected date arrives',
|
|
3897
|
+
default: false
|
|
3539
3898
|
},
|
|
3540
|
-
|
|
3541
|
-
type: '
|
|
3542
|
-
description: 'Rule
|
|
3899
|
+
startDate: {
|
|
3900
|
+
type: 'string',
|
|
3901
|
+
description: 'Rule start date (ISO format)'
|
|
3543
3902
|
},
|
|
3544
3903
|
endDate: {
|
|
3545
3904
|
type: 'string',
|
|
3546
3905
|
description: 'Rule end date (ISO format)'
|
|
3547
3906
|
}
|
|
3548
|
-
}
|
|
3907
|
+
},
|
|
3908
|
+
required: [
|
|
3909
|
+
'name',
|
|
3910
|
+
'frequency',
|
|
3911
|
+
'expectedAmount',
|
|
3912
|
+
'matchAmountTolerance',
|
|
3913
|
+
'autoCreate'
|
|
3914
|
+
]
|
|
3549
3915
|
} as const;
|
|
3550
3916
|
|
|
3551
|
-
export const $
|
|
3917
|
+
export const $RecurringRuleResponseDto = {
|
|
3552
3918
|
type: 'object',
|
|
3553
3919
|
properties: {
|
|
3920
|
+
id: {
|
|
3921
|
+
type: 'string',
|
|
3922
|
+
description: 'Rule ID'
|
|
3923
|
+
},
|
|
3924
|
+
userId: {
|
|
3925
|
+
type: 'string',
|
|
3926
|
+
description: 'User ID'
|
|
3927
|
+
},
|
|
3554
3928
|
name: {
|
|
3555
3929
|
type: 'string',
|
|
3556
3930
|
description: 'Rule name'
|
|
3557
3931
|
},
|
|
3558
3932
|
icon: {
|
|
3559
|
-
type: '
|
|
3560
|
-
description: '
|
|
3933
|
+
type: 'string',
|
|
3934
|
+
description: 'Icon emoji'
|
|
3561
3935
|
},
|
|
3562
3936
|
frequency: {
|
|
3563
3937
|
type: 'string',
|
|
3564
|
-
description: '
|
|
3938
|
+
description: 'Recurring frequency'
|
|
3939
|
+
},
|
|
3940
|
+
expectedAmount: {
|
|
3941
|
+
type: 'number',
|
|
3942
|
+
description: 'Expected amount'
|
|
3943
|
+
},
|
|
3944
|
+
expectedDay: {
|
|
3945
|
+
type: 'number',
|
|
3946
|
+
description: 'Expected day of month'
|
|
3947
|
+
},
|
|
3948
|
+
customIntervalDays: {
|
|
3949
|
+
type: 'number',
|
|
3950
|
+
description: 'Custom interval in days'
|
|
3565
3951
|
},
|
|
3566
3952
|
currency: {
|
|
3567
3953
|
type: 'string',
|
|
3568
3954
|
description: 'Currency code'
|
|
3569
|
-
}
|
|
3570
|
-
},
|
|
3571
|
-
required: ['name', 'frequency', 'currency']
|
|
3572
|
-
} as const;
|
|
3573
|
-
|
|
3574
|
-
export const $ExpectedTransactionResponseDto = {
|
|
3575
|
-
type: 'object',
|
|
3576
|
-
properties: {
|
|
3577
|
-
id: {
|
|
3578
|
-
type: 'string',
|
|
3579
|
-
description: 'Expected transaction ID'
|
|
3580
3955
|
},
|
|
3581
|
-
|
|
3956
|
+
matchPayeePattern: {
|
|
3582
3957
|
type: 'string',
|
|
3583
|
-
description: '
|
|
3958
|
+
description: 'Payee matching pattern'
|
|
3584
3959
|
},
|
|
3585
|
-
|
|
3586
|
-
type: '
|
|
3587
|
-
description: '
|
|
3960
|
+
matchAmountTolerance: {
|
|
3961
|
+
type: 'number',
|
|
3962
|
+
description: 'Amount tolerance percentage'
|
|
3588
3963
|
},
|
|
3589
|
-
|
|
3964
|
+
defaultExpenseAccount: {
|
|
3590
3965
|
type: 'string',
|
|
3591
|
-
description: '
|
|
3966
|
+
description: 'Default expense account'
|
|
3592
3967
|
},
|
|
3593
|
-
|
|
3594
|
-
type: '
|
|
3595
|
-
description: '
|
|
3968
|
+
defaultPaymentAccount: {
|
|
3969
|
+
type: 'string',
|
|
3970
|
+
description: 'Default payment account'
|
|
3596
3971
|
},
|
|
3597
|
-
|
|
3972
|
+
defaultPayee: {
|
|
3598
3973
|
type: 'string',
|
|
3599
|
-
description: '
|
|
3974
|
+
description: 'Default payee'
|
|
3600
3975
|
},
|
|
3601
|
-
|
|
3602
|
-
type: '
|
|
3603
|
-
description: '
|
|
3976
|
+
isActive: {
|
|
3977
|
+
type: 'boolean',
|
|
3978
|
+
description: 'Whether rule is active'
|
|
3604
3979
|
},
|
|
3605
|
-
|
|
3606
|
-
type: '
|
|
3607
|
-
description: '
|
|
3980
|
+
startDate: {
|
|
3981
|
+
type: 'string',
|
|
3982
|
+
description: 'Rule start date (YYYY-MM-DD)'
|
|
3608
3983
|
},
|
|
3609
|
-
|
|
3610
|
-
type: '
|
|
3611
|
-
description: '
|
|
3984
|
+
endDate: {
|
|
3985
|
+
type: 'string',
|
|
3986
|
+
description: 'Rule end date (YYYY-MM-DD)'
|
|
3612
3987
|
},
|
|
3613
|
-
|
|
3988
|
+
autoCreate: {
|
|
3614
3989
|
type: 'boolean',
|
|
3615
|
-
description: '
|
|
3990
|
+
description: 'Auto-create transaction on expected date'
|
|
3616
3991
|
},
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3992
|
+
lastOccurrence: {
|
|
3993
|
+
type: 'string',
|
|
3994
|
+
description: 'Last matched occurrence date (YYYY-MM-DD)'
|
|
3995
|
+
},
|
|
3996
|
+
totalCount: {
|
|
3997
|
+
type: 'number',
|
|
3998
|
+
description: 'Total matched transactions count'
|
|
3624
3999
|
},
|
|
3625
4000
|
createdAt: {
|
|
3626
4001
|
format: 'date-time',
|
|
@@ -3636,691 +4011,581 @@ export const $ExpectedTransactionResponseDto = {
|
|
|
3636
4011
|
required: [
|
|
3637
4012
|
'id',
|
|
3638
4013
|
'userId',
|
|
3639
|
-
'
|
|
3640
|
-
'
|
|
4014
|
+
'name',
|
|
4015
|
+
'frequency',
|
|
3641
4016
|
'expectedAmount',
|
|
3642
|
-
'
|
|
3643
|
-
'
|
|
3644
|
-
'
|
|
4017
|
+
'currency',
|
|
4018
|
+
'matchAmountTolerance',
|
|
4019
|
+
'isActive',
|
|
4020
|
+
'startDate',
|
|
4021
|
+
'autoCreate',
|
|
4022
|
+
'totalCount',
|
|
3645
4023
|
'createdAt',
|
|
3646
4024
|
'updatedAt'
|
|
3647
4025
|
]
|
|
3648
4026
|
} as const;
|
|
3649
4027
|
|
|
3650
|
-
export const $
|
|
4028
|
+
export const $CreateRuleFromTransactionDto = {
|
|
3651
4029
|
type: 'object',
|
|
3652
4030
|
properties: {
|
|
3653
|
-
|
|
3654
|
-
type: '
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
4031
|
+
frequency: {
|
|
4032
|
+
type: 'string',
|
|
4033
|
+
description: 'Recurring frequency',
|
|
4034
|
+
enum: [
|
|
4035
|
+
'WEEKLY',
|
|
4036
|
+
'BIWEEKLY',
|
|
4037
|
+
'MONTHLY',
|
|
4038
|
+
'BIMONTHLY',
|
|
4039
|
+
'QUARTERLY',
|
|
4040
|
+
'YEARLY',
|
|
4041
|
+
'CUSTOM'
|
|
4042
|
+
],
|
|
4043
|
+
example: 'MONTHLY'
|
|
3658
4044
|
},
|
|
3659
|
-
|
|
3660
|
-
type: 'number',
|
|
3661
|
-
description: 'Total count'
|
|
3662
|
-
}
|
|
3663
|
-
},
|
|
3664
|
-
required: ['items', 'total']
|
|
3665
|
-
} as const;
|
|
3666
|
-
|
|
3667
|
-
export const $ConfirmMatchDto = {
|
|
3668
|
-
type: 'object',
|
|
3669
|
-
properties: {
|
|
3670
|
-
transactionId: {
|
|
4045
|
+
name: {
|
|
3671
4046
|
type: 'string',
|
|
3672
|
-
description: '
|
|
4047
|
+
description: 'Optional name override (default: transaction payee)',
|
|
4048
|
+
maxLength: 100
|
|
4049
|
+
},
|
|
4050
|
+
icon: {
|
|
4051
|
+
type: 'string',
|
|
4052
|
+
description: 'Optional icon emoji',
|
|
4053
|
+
maxLength: 10
|
|
3673
4054
|
}
|
|
3674
4055
|
},
|
|
3675
|
-
required: ['
|
|
4056
|
+
required: ['frequency']
|
|
3676
4057
|
} as const;
|
|
3677
4058
|
|
|
3678
|
-
export const $
|
|
4059
|
+
export const $RecurringRuleWithStatsResponseDto = {
|
|
3679
4060
|
type: 'object',
|
|
3680
4061
|
properties: {
|
|
3681
|
-
|
|
4062
|
+
id: {
|
|
3682
4063
|
type: 'string',
|
|
3683
|
-
description:
|
|
3684
|
-
'Override expense account (uses rule default if not provided)',
|
|
3685
|
-
maxLength: 200
|
|
4064
|
+
description: 'Rule ID'
|
|
3686
4065
|
},
|
|
3687
|
-
|
|
4066
|
+
userId: {
|
|
3688
4067
|
type: 'string',
|
|
3689
|
-
description:
|
|
3690
|
-
'Override payment account (uses rule default if not provided)',
|
|
3691
|
-
maxLength: 200
|
|
4068
|
+
description: 'User ID'
|
|
3692
4069
|
},
|
|
3693
|
-
|
|
3694
|
-
type: '
|
|
3695
|
-
description: '
|
|
3696
|
-
minimum: 0
|
|
4070
|
+
name: {
|
|
4071
|
+
type: 'string',
|
|
4072
|
+
description: 'Rule name'
|
|
3697
4073
|
},
|
|
3698
|
-
|
|
4074
|
+
icon: {
|
|
3699
4075
|
type: 'string',
|
|
3700
|
-
description: '
|
|
3701
|
-
maxLength: 200
|
|
4076
|
+
description: 'Icon emoji'
|
|
3702
4077
|
},
|
|
3703
|
-
|
|
4078
|
+
frequency: {
|
|
3704
4079
|
type: 'string',
|
|
3705
|
-
description: '
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
4080
|
+
description: 'Recurring frequency'
|
|
4081
|
+
},
|
|
4082
|
+
expectedAmount: {
|
|
4083
|
+
type: 'number',
|
|
4084
|
+
description: 'Expected amount'
|
|
4085
|
+
},
|
|
4086
|
+
expectedDay: {
|
|
4087
|
+
type: 'number',
|
|
4088
|
+
description: 'Expected day of month'
|
|
4089
|
+
},
|
|
4090
|
+
customIntervalDays: {
|
|
4091
|
+
type: 'number',
|
|
4092
|
+
description: 'Custom interval in days'
|
|
4093
|
+
},
|
|
4094
|
+
currency: {
|
|
3715
4095
|
type: 'string',
|
|
3716
|
-
description: '
|
|
3717
|
-
example: 'Rent'
|
|
4096
|
+
description: 'Currency code'
|
|
3718
4097
|
},
|
|
3719
|
-
|
|
4098
|
+
matchPayeePattern: {
|
|
3720
4099
|
type: 'string',
|
|
3721
|
-
description: '
|
|
3722
|
-
example: 'clx123...'
|
|
4100
|
+
description: 'Payee matching pattern'
|
|
3723
4101
|
},
|
|
3724
|
-
|
|
4102
|
+
matchAmountTolerance: {
|
|
3725
4103
|
type: 'number',
|
|
3726
|
-
description: '
|
|
3727
|
-
example: 3000
|
|
4104
|
+
description: 'Amount tolerance percentage'
|
|
3728
4105
|
},
|
|
3729
|
-
|
|
4106
|
+
defaultExpenseAccount: {
|
|
3730
4107
|
type: 'string',
|
|
3731
|
-
description: '
|
|
3732
|
-
example: '2024-04-01'
|
|
4108
|
+
description: 'Default expense account'
|
|
3733
4109
|
},
|
|
3734
|
-
|
|
4110
|
+
defaultPaymentAccount: {
|
|
3735
4111
|
type: 'string',
|
|
3736
|
-
description: '
|
|
3737
|
-
example: '🏠',
|
|
3738
|
-
nullable: true
|
|
4112
|
+
description: 'Default payment account'
|
|
3739
4113
|
},
|
|
3740
|
-
|
|
4114
|
+
defaultPayee: {
|
|
3741
4115
|
type: 'string',
|
|
3742
|
-
description: '
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
}
|
|
3748
|
-
|
|
3749
|
-
export const $MonthlyForecastDto = {
|
|
3750
|
-
type: 'object',
|
|
3751
|
-
properties: {
|
|
3752
|
-
month: {
|
|
4116
|
+
description: 'Default payee'
|
|
4117
|
+
},
|
|
4118
|
+
isActive: {
|
|
4119
|
+
type: 'boolean',
|
|
4120
|
+
description: 'Whether rule is active'
|
|
4121
|
+
},
|
|
4122
|
+
startDate: {
|
|
3753
4123
|
type: 'string',
|
|
3754
|
-
description: '
|
|
3755
|
-
example: '2024-04'
|
|
4124
|
+
description: 'Rule start date (YYYY-MM-DD)'
|
|
3756
4125
|
},
|
|
3757
|
-
|
|
4126
|
+
endDate: {
|
|
4127
|
+
type: 'string',
|
|
4128
|
+
description: 'Rule end date (YYYY-MM-DD)'
|
|
4129
|
+
},
|
|
4130
|
+
autoCreate: {
|
|
4131
|
+
type: 'boolean',
|
|
4132
|
+
description: 'Auto-create transaction on expected date'
|
|
4133
|
+
},
|
|
4134
|
+
lastOccurrence: {
|
|
4135
|
+
type: 'string',
|
|
4136
|
+
description: 'Last matched occurrence date (YYYY-MM-DD)'
|
|
4137
|
+
},
|
|
4138
|
+
totalCount: {
|
|
3758
4139
|
type: 'number',
|
|
3759
|
-
description: 'Total
|
|
3760
|
-
example: 8500
|
|
4140
|
+
description: 'Total matched transactions count'
|
|
3761
4141
|
},
|
|
3762
|
-
|
|
4142
|
+
createdAt: {
|
|
4143
|
+
format: 'date-time',
|
|
4144
|
+
type: 'string',
|
|
4145
|
+
description: 'Created at timestamp'
|
|
4146
|
+
},
|
|
4147
|
+
updatedAt: {
|
|
4148
|
+
format: 'date-time',
|
|
4149
|
+
type: 'string',
|
|
4150
|
+
description: 'Updated at timestamp'
|
|
4151
|
+
},
|
|
4152
|
+
pendingCount: {
|
|
3763
4153
|
type: 'number',
|
|
3764
|
-
description: 'Number of expected transactions'
|
|
3765
|
-
example: 3
|
|
4154
|
+
description: 'Number of pending expected transactions'
|
|
3766
4155
|
},
|
|
3767
|
-
|
|
3768
|
-
type: '
|
|
3769
|
-
description: '
|
|
3770
|
-
example: {
|
|
3771
|
-
CNY: 8500,
|
|
3772
|
-
USD: 100
|
|
3773
|
-
}
|
|
4156
|
+
overdueCount: {
|
|
4157
|
+
type: 'number',
|
|
4158
|
+
description: 'Number of overdue expected transactions'
|
|
3774
4159
|
},
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
items: {
|
|
3779
|
-
$ref: '#/components/schemas/ForecastItemDto'
|
|
3780
|
-
}
|
|
3781
|
-
}
|
|
3782
|
-
},
|
|
3783
|
-
required: ['month', 'expectedOutflow', 'itemCount', 'byCurrency', 'items']
|
|
3784
|
-
} as const;
|
|
3785
|
-
|
|
3786
|
-
export const $ForecastResponseDto = {
|
|
3787
|
-
type: 'object',
|
|
3788
|
-
properties: {
|
|
3789
|
-
forecast: {
|
|
3790
|
-
description: 'Monthly forecast data',
|
|
3791
|
-
type: 'array',
|
|
3792
|
-
items: {
|
|
3793
|
-
$ref: '#/components/schemas/MonthlyForecastDto'
|
|
3794
|
-
}
|
|
4160
|
+
nextExpectedDate: {
|
|
4161
|
+
type: 'string',
|
|
4162
|
+
description: 'Next expected date (YYYY-MM-DD)'
|
|
3795
4163
|
},
|
|
3796
|
-
|
|
4164
|
+
totalAmount: {
|
|
3797
4165
|
type: 'number',
|
|
3798
|
-
description: 'Total
|
|
3799
|
-
example: 25500
|
|
4166
|
+
description: 'Total amount of all matched transactions'
|
|
3800
4167
|
},
|
|
3801
|
-
|
|
3802
|
-
type: '
|
|
3803
|
-
description: '
|
|
3804
|
-
example: {
|
|
3805
|
-
CNY: 25500,
|
|
3806
|
-
USD: 300
|
|
3807
|
-
}
|
|
4168
|
+
averageAmount: {
|
|
4169
|
+
type: 'number',
|
|
4170
|
+
description: 'Average amount per transaction'
|
|
3808
4171
|
},
|
|
3809
|
-
|
|
4172
|
+
transactionCount: {
|
|
3810
4173
|
type: 'number',
|
|
3811
|
-
description: 'Number of
|
|
3812
|
-
example: 5
|
|
4174
|
+
description: 'Number of matched transactions'
|
|
3813
4175
|
},
|
|
3814
|
-
|
|
4176
|
+
firstDate: {
|
|
3815
4177
|
type: 'string',
|
|
3816
|
-
description: '
|
|
3817
|
-
example: '2024-04-01'
|
|
4178
|
+
description: 'First matched transaction date (YYYY-MM-DD)'
|
|
3818
4179
|
},
|
|
3819
|
-
|
|
4180
|
+
lastDate: {
|
|
3820
4181
|
type: 'string',
|
|
3821
|
-
description: '
|
|
3822
|
-
|
|
4182
|
+
description: 'Last matched transaction date (YYYY-MM-DD)'
|
|
4183
|
+
},
|
|
4184
|
+
variance: {
|
|
4185
|
+
type: 'number',
|
|
4186
|
+
description: 'Amount variance (standard deviation squared)'
|
|
4187
|
+
},
|
|
4188
|
+
upcomingCount: {
|
|
4189
|
+
type: 'number',
|
|
4190
|
+
description: 'Number of upcoming expected transactions'
|
|
3823
4191
|
}
|
|
3824
4192
|
},
|
|
3825
4193
|
required: [
|
|
3826
|
-
'
|
|
3827
|
-
'
|
|
3828
|
-
'
|
|
3829
|
-
'
|
|
3830
|
-
'
|
|
3831
|
-
'
|
|
4194
|
+
'id',
|
|
4195
|
+
'userId',
|
|
4196
|
+
'name',
|
|
4197
|
+
'frequency',
|
|
4198
|
+
'expectedAmount',
|
|
4199
|
+
'currency',
|
|
4200
|
+
'matchAmountTolerance',
|
|
4201
|
+
'isActive',
|
|
4202
|
+
'startDate',
|
|
4203
|
+
'autoCreate',
|
|
4204
|
+
'totalCount',
|
|
4205
|
+
'createdAt',
|
|
4206
|
+
'updatedAt',
|
|
4207
|
+
'pendingCount',
|
|
4208
|
+
'overdueCount',
|
|
4209
|
+
'totalAmount',
|
|
4210
|
+
'averageAmount',
|
|
4211
|
+
'transactionCount',
|
|
4212
|
+
'variance',
|
|
4213
|
+
'upcomingCount'
|
|
3832
4214
|
]
|
|
3833
4215
|
} as const;
|
|
3834
4216
|
|
|
3835
|
-
export const $
|
|
4217
|
+
export const $UpdateRecurringRuleDto = {
|
|
3836
4218
|
type: 'object',
|
|
3837
4219
|
properties: {
|
|
3838
|
-
|
|
4220
|
+
name: {
|
|
3839
4221
|
type: 'string',
|
|
3840
|
-
description: '
|
|
3841
|
-
|
|
4222
|
+
description: 'Rule name (unique per user)',
|
|
4223
|
+
maxLength: 100
|
|
3842
4224
|
},
|
|
3843
|
-
|
|
3844
|
-
type: 'string',
|
|
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: {
|
|
4225
|
+
icon: {
|
|
3856
4226
|
type: 'string',
|
|
3857
|
-
description: '
|
|
3858
|
-
|
|
4227
|
+
description: 'Icon emoji',
|
|
4228
|
+
maxLength: 10
|
|
3859
4229
|
},
|
|
3860
|
-
|
|
4230
|
+
frequency: {
|
|
3861
4231
|
type: 'string',
|
|
3862
|
-
description: '
|
|
3863
|
-
|
|
4232
|
+
description: 'Recurring frequency',
|
|
4233
|
+
enum: [
|
|
4234
|
+
'WEEKLY',
|
|
4235
|
+
'BIWEEKLY',
|
|
4236
|
+
'MONTHLY',
|
|
4237
|
+
'BIMONTHLY',
|
|
4238
|
+
'QUARTERLY',
|
|
4239
|
+
'YEARLY',
|
|
4240
|
+
'CUSTOM'
|
|
4241
|
+
]
|
|
3864
4242
|
},
|
|
3865
|
-
|
|
3866
|
-
type: '
|
|
3867
|
-
description: '
|
|
3868
|
-
|
|
4243
|
+
expectedAmount: {
|
|
4244
|
+
type: 'number',
|
|
4245
|
+
description: 'Expected amount (positive number)',
|
|
4246
|
+
minimum: 0
|
|
3869
4247
|
},
|
|
3870
|
-
|
|
3871
|
-
type: '
|
|
3872
|
-
description: '
|
|
3873
|
-
|
|
4248
|
+
expectedDay: {
|
|
4249
|
+
type: 'number',
|
|
4250
|
+
description: 'Expected day of month (1-31)',
|
|
4251
|
+
minimum: 1,
|
|
4252
|
+
maximum: 31
|
|
3874
4253
|
},
|
|
3875
|
-
|
|
4254
|
+
currency: {
|
|
3876
4255
|
type: 'string',
|
|
3877
|
-
description: '
|
|
3878
|
-
|
|
4256
|
+
description: 'Currency code',
|
|
4257
|
+
maxLength: 10
|
|
3879
4258
|
},
|
|
3880
|
-
|
|
3881
|
-
description: 'Multi-currency breakdown for this point',
|
|
3882
|
-
type: 'array',
|
|
3883
|
-
items: {
|
|
3884
|
-
$ref: '#/components/schemas/CurrencyBalanceDto'
|
|
3885
|
-
}
|
|
3886
|
-
}
|
|
3887
|
-
},
|
|
3888
|
-
required: ['date', 'value']
|
|
3889
|
-
} as const;
|
|
3890
|
-
|
|
3891
|
-
export const $TrendSummaryDto = {
|
|
3892
|
-
type: 'object',
|
|
3893
|
-
properties: {
|
|
3894
|
-
startValue: {
|
|
4259
|
+
matchPayeePattern: {
|
|
3895
4260
|
type: 'string',
|
|
3896
|
-
description: '
|
|
3897
|
-
|
|
4261
|
+
description: 'Payee matching pattern (supports wildcards)',
|
|
4262
|
+
maxLength: 200
|
|
3898
4263
|
},
|
|
3899
|
-
|
|
4264
|
+
matchAmountTolerance: {
|
|
4265
|
+
type: 'number',
|
|
4266
|
+
description: 'Amount tolerance percentage (0-1)',
|
|
4267
|
+
default: 0.075,
|
|
4268
|
+
minimum: 0,
|
|
4269
|
+
maximum: 1
|
|
4270
|
+
},
|
|
4271
|
+
defaultExpenseAccount: {
|
|
3900
4272
|
type: 'string',
|
|
3901
|
-
description: '
|
|
3902
|
-
|
|
4273
|
+
description: 'Default expense account for auto-create',
|
|
4274
|
+
maxLength: 200
|
|
3903
4275
|
},
|
|
3904
|
-
|
|
4276
|
+
defaultPaymentAccount: {
|
|
3905
4277
|
type: 'string',
|
|
3906
|
-
description: '
|
|
3907
|
-
|
|
4278
|
+
description: 'Default payment account for auto-create',
|
|
4279
|
+
maxLength: 200
|
|
3908
4280
|
},
|
|
3909
|
-
|
|
4281
|
+
defaultPayee: {
|
|
3910
4282
|
type: 'string',
|
|
3911
|
-
description: '
|
|
3912
|
-
|
|
3913
|
-
}
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
properties: {
|
|
3921
|
-
date: {
|
|
4283
|
+
description: 'Default payee for auto-create',
|
|
4284
|
+
maxLength: 200
|
|
4285
|
+
},
|
|
4286
|
+
autoCreate: {
|
|
4287
|
+
type: 'boolean',
|
|
4288
|
+
description: 'Auto-create transaction when expected date arrives',
|
|
4289
|
+
default: false
|
|
4290
|
+
},
|
|
4291
|
+
endDate: {
|
|
3922
4292
|
type: 'string',
|
|
3923
|
-
description: '
|
|
3924
|
-
example: '2024-06-15'
|
|
4293
|
+
description: 'Rule end date (ISO format)'
|
|
3925
4294
|
},
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
4295
|
+
customIntervalDays: {
|
|
4296
|
+
type: 'number',
|
|
4297
|
+
description: 'Custom interval in days',
|
|
4298
|
+
minimum: 1
|
|
4299
|
+
},
|
|
4300
|
+
isActive: {
|
|
4301
|
+
type: 'boolean',
|
|
4302
|
+
description: 'Rule active status'
|
|
3932
4303
|
}
|
|
3933
|
-
}
|
|
3934
|
-
required: ['date', 'byCurrency']
|
|
4304
|
+
}
|
|
3935
4305
|
} as const;
|
|
3936
4306
|
|
|
3937
|
-
export const $
|
|
4307
|
+
export const $ExpectedTransactionRuleDto = {
|
|
3938
4308
|
type: 'object',
|
|
3939
4309
|
properties: {
|
|
3940
|
-
|
|
3941
|
-
|
|
3942
|
-
|
|
3943
|
-
items: {
|
|
3944
|
-
$ref: '#/components/schemas/TimeSeriesPointDto'
|
|
3945
|
-
}
|
|
3946
|
-
},
|
|
3947
|
-
summary: {
|
|
3948
|
-
description: 'Period summary',
|
|
3949
|
-
allOf: [
|
|
3950
|
-
{
|
|
3951
|
-
$ref: '#/components/schemas/TrendSummaryDto'
|
|
3952
|
-
}
|
|
3953
|
-
]
|
|
4310
|
+
name: {
|
|
4311
|
+
type: 'string',
|
|
4312
|
+
description: 'Rule name'
|
|
3954
4313
|
},
|
|
3955
|
-
|
|
4314
|
+
icon: {
|
|
3956
4315
|
type: 'string',
|
|
3957
|
-
description: '
|
|
3958
|
-
example: '6m'
|
|
4316
|
+
description: 'Rule icon'
|
|
3959
4317
|
},
|
|
3960
|
-
|
|
4318
|
+
frequency: {
|
|
3961
4319
|
type: 'string',
|
|
3962
|
-
description: '
|
|
3963
|
-
example: 'month'
|
|
4320
|
+
description: 'Rule frequency'
|
|
3964
4321
|
},
|
|
3965
4322
|
currency: {
|
|
3966
4323
|
type: 'string',
|
|
3967
|
-
description: '
|
|
3968
|
-
example: 'CNY'
|
|
3969
|
-
},
|
|
3970
|
-
byCurrency: {
|
|
3971
|
-
description:
|
|
3972
|
-
'Multi-currency time series (each point has currency breakdown)',
|
|
3973
|
-
type: 'array',
|
|
3974
|
-
items: {
|
|
3975
|
-
$ref: '#/components/schemas/MultiCurrencyPointDto'
|
|
3976
|
-
}
|
|
3977
|
-
},
|
|
3978
|
-
warnings: {
|
|
3979
|
-
description: 'Exchange rate warnings',
|
|
3980
|
-
type: 'array',
|
|
3981
|
-
items: {
|
|
3982
|
-
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
3983
|
-
}
|
|
4324
|
+
description: 'Currency code'
|
|
3984
4325
|
}
|
|
3985
4326
|
},
|
|
3986
|
-
required: ['
|
|
4327
|
+
required: ['name', 'frequency', 'currency']
|
|
3987
4328
|
} as const;
|
|
3988
4329
|
|
|
3989
|
-
export const $
|
|
4330
|
+
export const $ExpectedTransactionResponseDto = {
|
|
3990
4331
|
type: 'object',
|
|
3991
4332
|
properties: {
|
|
3992
|
-
|
|
4333
|
+
id: {
|
|
3993
4334
|
type: 'string',
|
|
3994
|
-
description: '
|
|
3995
|
-
example: '2024-03'
|
|
4335
|
+
description: 'Expected transaction ID'
|
|
3996
4336
|
},
|
|
3997
|
-
|
|
4337
|
+
userId: {
|
|
3998
4338
|
type: 'string',
|
|
3999
|
-
description: '
|
|
4000
|
-
example: '10000.00'
|
|
4339
|
+
description: 'User ID'
|
|
4001
4340
|
},
|
|
4002
|
-
|
|
4341
|
+
ruleId: {
|
|
4003
4342
|
type: 'string',
|
|
4004
|
-
description: '
|
|
4005
|
-
example: '5000.00'
|
|
4343
|
+
description: 'Associated rule ID'
|
|
4006
4344
|
},
|
|
4007
|
-
|
|
4008
|
-
type: 'string',
|
|
4009
|
-
description: 'netSavings = income − expense (savings positive)',
|
|
4010
|
-
example: '5000.00'
|
|
4011
|
-
}
|
|
4012
|
-
},
|
|
4013
|
-
required: ['month', 'income', 'expense', 'netSavings']
|
|
4014
|
-
} as const;
|
|
4015
|
-
|
|
4016
|
-
export const $CashFlowTrendSummaryDto = {
|
|
4017
|
-
type: 'object',
|
|
4018
|
-
properties: {
|
|
4019
|
-
totalIncome: {
|
|
4345
|
+
expectedDate: {
|
|
4020
4346
|
type: 'string',
|
|
4021
|
-
description: '
|
|
4022
|
-
|
|
4347
|
+
description: 'Expected date (YYYY-MM-DD)'
|
|
4348
|
+
},
|
|
4349
|
+
expectedAmount: {
|
|
4350
|
+
type: 'number',
|
|
4351
|
+
description: 'Expected amount'
|
|
4023
4352
|
},
|
|
4024
|
-
|
|
4353
|
+
status: {
|
|
4025
4354
|
type: 'string',
|
|
4026
|
-
description: '
|
|
4027
|
-
example: '30000.00'
|
|
4355
|
+
description: 'Status (PENDING, COMPLETED, SKIPPED)'
|
|
4028
4356
|
},
|
|
4029
|
-
|
|
4357
|
+
matchedTransactionId: {
|
|
4030
4358
|
type: 'string',
|
|
4031
|
-
description: '
|
|
4032
|
-
example: '30000.00'
|
|
4359
|
+
description: 'Matched transaction ID'
|
|
4033
4360
|
},
|
|
4034
|
-
|
|
4361
|
+
matchedAt: {
|
|
4035
4362
|
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',
|
|
4056
|
-
items: {
|
|
4057
|
-
$ref: '#/components/schemas/CashFlowPointDto'
|
|
4058
|
-
}
|
|
4363
|
+
description: 'Match timestamp (ISO 8601)'
|
|
4059
4364
|
},
|
|
4060
|
-
|
|
4061
|
-
|
|
4365
|
+
matchConfidence: {
|
|
4366
|
+
type: 'number',
|
|
4367
|
+
description: 'Match confidence score (0-1)'
|
|
4368
|
+
},
|
|
4369
|
+
isOverdue: {
|
|
4370
|
+
type: 'boolean',
|
|
4371
|
+
description: 'Whether this expected transaction is overdue'
|
|
4372
|
+
},
|
|
4373
|
+
rule: {
|
|
4374
|
+
description: 'Rule information',
|
|
4062
4375
|
allOf: [
|
|
4063
4376
|
{
|
|
4064
|
-
$ref: '#/components/schemas/
|
|
4377
|
+
$ref: '#/components/schemas/ExpectedTransactionRuleDto'
|
|
4065
4378
|
}
|
|
4066
4379
|
]
|
|
4067
4380
|
},
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
description: 'Period requested',
|
|
4071
|
-
example: '6m'
|
|
4072
|
-
},
|
|
4073
|
-
granularity: {
|
|
4381
|
+
createdAt: {
|
|
4382
|
+
format: 'date-time',
|
|
4074
4383
|
type: 'string',
|
|
4075
|
-
description: '
|
|
4076
|
-
example: 'month'
|
|
4384
|
+
description: 'Created at timestamp'
|
|
4077
4385
|
},
|
|
4078
|
-
|
|
4386
|
+
updatedAt: {
|
|
4387
|
+
format: 'date-time',
|
|
4079
4388
|
type: 'string',
|
|
4080
|
-
description: '
|
|
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
|
-
}
|
|
4389
|
+
description: 'Updated at timestamp'
|
|
4089
4390
|
}
|
|
4090
4391
|
},
|
|
4091
|
-
required: [
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
export const $BackfillSnapshotsBody = {
|
|
4105
|
-
type: 'object',
|
|
4106
|
-
properties: {}
|
|
4107
|
-
} as const;
|
|
4108
|
-
|
|
4109
|
-
export const $BackfillSnapshotsResponse = {
|
|
4110
|
-
type: 'object',
|
|
4111
|
-
properties: {}
|
|
4392
|
+
required: [
|
|
4393
|
+
'id',
|
|
4394
|
+
'userId',
|
|
4395
|
+
'ruleId',
|
|
4396
|
+
'expectedDate',
|
|
4397
|
+
'expectedAmount',
|
|
4398
|
+
'status',
|
|
4399
|
+
'isOverdue',
|
|
4400
|
+
'rule',
|
|
4401
|
+
'createdAt',
|
|
4402
|
+
'updatedAt'
|
|
4403
|
+
]
|
|
4112
4404
|
} as const;
|
|
4113
4405
|
|
|
4114
|
-
export const $
|
|
4406
|
+
export const $ExpectedTransactionListResponseDto = {
|
|
4115
4407
|
type: 'object',
|
|
4116
4408
|
properties: {
|
|
4117
|
-
|
|
4118
|
-
type: '
|
|
4119
|
-
|
|
4120
|
-
|
|
4409
|
+
items: {
|
|
4410
|
+
type: 'array',
|
|
4411
|
+
items: {
|
|
4412
|
+
$ref: '#/components/schemas/ExpectedTransactionResponseDto'
|
|
4413
|
+
}
|
|
4414
|
+
},
|
|
4415
|
+
total: {
|
|
4416
|
+
type: 'number',
|
|
4417
|
+
description: 'Total count'
|
|
4121
4418
|
}
|
|
4122
4419
|
},
|
|
4123
|
-
required: ['
|
|
4420
|
+
required: ['items', 'total']
|
|
4124
4421
|
} as const;
|
|
4125
4422
|
|
|
4126
|
-
export const $
|
|
4423
|
+
export const $ConfirmMatchDto = {
|
|
4127
4424
|
type: 'object',
|
|
4128
4425
|
properties: {
|
|
4129
|
-
|
|
4426
|
+
transactionId: {
|
|
4130
4427
|
type: 'string',
|
|
4131
|
-
description:
|
|
4132
|
-
'Base currency (ISO 4217) for net-worth/report aggregation. Independent of region (ADR-0006).',
|
|
4133
|
-
example: 'USD',
|
|
4134
|
-
nullable: true
|
|
4428
|
+
description: 'Transaction ID to match with'
|
|
4135
4429
|
}
|
|
4136
4430
|
},
|
|
4137
|
-
required: ['
|
|
4431
|
+
required: ['transactionId']
|
|
4138
4432
|
} as const;
|
|
4139
4433
|
|
|
4140
|
-
export const $
|
|
4434
|
+
export const $EnterNowDto = {
|
|
4141
4435
|
type: 'object',
|
|
4142
4436
|
properties: {
|
|
4143
|
-
|
|
4437
|
+
expenseAccount: {
|
|
4144
4438
|
type: 'string',
|
|
4145
|
-
description:
|
|
4439
|
+
description:
|
|
4440
|
+
'Override expense account (uses rule default if not provided)',
|
|
4441
|
+
maxLength: 200
|
|
4146
4442
|
},
|
|
4147
|
-
|
|
4443
|
+
paymentAccount: {
|
|
4148
4444
|
type: 'string',
|
|
4149
|
-
description:
|
|
4445
|
+
description:
|
|
4446
|
+
'Override payment account (uses rule default if not provided)',
|
|
4447
|
+
maxLength: 200
|
|
4150
4448
|
},
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
type: 'string'
|
|
4156
|
-
}
|
|
4449
|
+
amount: {
|
|
4450
|
+
type: 'number',
|
|
4451
|
+
description: 'Override amount (uses expected amount if not provided)',
|
|
4452
|
+
minimum: 0
|
|
4157
4453
|
},
|
|
4158
|
-
|
|
4159
|
-
description: 'User settings',
|
|
4160
|
-
allOf: [
|
|
4161
|
-
{
|
|
4162
|
-
$ref: '#/components/schemas/UserSettingsResponseDto'
|
|
4163
|
-
}
|
|
4164
|
-
]
|
|
4165
|
-
}
|
|
4166
|
-
},
|
|
4167
|
-
required: ['id', 'role', 'permissions', 'settings']
|
|
4168
|
-
} as const;
|
|
4169
|
-
|
|
4170
|
-
export const $SignupDto = {
|
|
4171
|
-
type: 'object',
|
|
4172
|
-
properties: {
|
|
4173
|
-
turnstileToken: {
|
|
4454
|
+
payee: {
|
|
4174
4455
|
type: 'string',
|
|
4175
|
-
description:
|
|
4176
|
-
|
|
4177
|
-
|
|
4456
|
+
description: 'Override payee (uses rule default if not provided)',
|
|
4457
|
+
maxLength: 200
|
|
4458
|
+
},
|
|
4459
|
+
narration: {
|
|
4460
|
+
type: 'string',
|
|
4461
|
+
description: 'Optional narration',
|
|
4462
|
+
maxLength: 500
|
|
4178
4463
|
}
|
|
4179
4464
|
}
|
|
4180
4465
|
} as const;
|
|
4181
4466
|
|
|
4182
|
-
export const $
|
|
4467
|
+
export const $ForecastItemDto = {
|
|
4183
4468
|
type: 'object',
|
|
4184
4469
|
properties: {
|
|
4185
|
-
|
|
4186
|
-
type: 'string',
|
|
4187
|
-
description: 'JWT auth token',
|
|
4188
|
-
example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
|
|
4189
|
-
},
|
|
4190
|
-
accessToken: {
|
|
4470
|
+
rule: {
|
|
4191
4471
|
type: 'string',
|
|
4192
|
-
description: '
|
|
4472
|
+
description: 'Rule name',
|
|
4473
|
+
example: 'Rent'
|
|
4193
4474
|
},
|
|
4194
|
-
|
|
4475
|
+
ruleId: {
|
|
4195
4476
|
type: 'string',
|
|
4196
|
-
description: '
|
|
4197
|
-
|
|
4198
|
-
}
|
|
4199
|
-
},
|
|
4200
|
-
required: ['authToken', 'accessToken', 'role']
|
|
4201
|
-
} as const;
|
|
4202
|
-
|
|
4203
|
-
export const $UpdateUserSettingDto = {
|
|
4204
|
-
type: 'object',
|
|
4205
|
-
properties: {
|
|
4206
|
-
secId: {
|
|
4207
|
-
type: 'number',
|
|
4208
|
-
description: 'Security ID'
|
|
4477
|
+
description: 'Rule ID',
|
|
4478
|
+
example: 'clx123...'
|
|
4209
4479
|
},
|
|
4210
|
-
|
|
4480
|
+
amount: {
|
|
4211
4481
|
type: 'number',
|
|
4212
|
-
description: '
|
|
4213
|
-
example:
|
|
4214
|
-
},
|
|
4215
|
-
currency: {
|
|
4216
|
-
type: 'string',
|
|
4217
|
-
description: 'Currency code',
|
|
4218
|
-
example: 'USD'
|
|
4482
|
+
description: 'Expected amount',
|
|
4483
|
+
example: 3000
|
|
4219
4484
|
},
|
|
4220
|
-
|
|
4485
|
+
date: {
|
|
4221
4486
|
type: 'string',
|
|
4222
|
-
description: '
|
|
4223
|
-
example: '
|
|
4487
|
+
description: 'Expected date (YYYY-MM-DD)',
|
|
4488
|
+
example: '2024-04-01'
|
|
4224
4489
|
},
|
|
4225
|
-
|
|
4490
|
+
icon: {
|
|
4226
4491
|
type: 'string',
|
|
4227
|
-
description: '
|
|
4228
|
-
example: '
|
|
4492
|
+
description: 'Rule icon emoji',
|
|
4493
|
+
example: '🏠',
|
|
4494
|
+
nullable: true
|
|
4229
4495
|
},
|
|
4230
|
-
|
|
4496
|
+
currency: {
|
|
4231
4497
|
type: 'string',
|
|
4232
|
-
description: '
|
|
4233
|
-
|
|
4234
|
-
}
|
|
4235
|
-
|
|
4498
|
+
description: 'Currency code',
|
|
4499
|
+
example: 'CNY'
|
|
4500
|
+
}
|
|
4501
|
+
},
|
|
4502
|
+
required: ['rule', 'ruleId', 'amount', 'date', 'icon', 'currency']
|
|
4503
|
+
} as const;
|
|
4504
|
+
|
|
4505
|
+
export const $MonthlyForecastDto = {
|
|
4506
|
+
type: 'object',
|
|
4507
|
+
properties: {
|
|
4508
|
+
month: {
|
|
4236
4509
|
type: 'string',
|
|
4237
|
-
description: '
|
|
4238
|
-
example: '
|
|
4510
|
+
description: 'Month (YYYY-MM)',
|
|
4511
|
+
example: '2024-04'
|
|
4239
4512
|
},
|
|
4240
|
-
|
|
4513
|
+
expectedOutflow: {
|
|
4241
4514
|
type: 'number',
|
|
4242
|
-
description: '
|
|
4243
|
-
example:
|
|
4515
|
+
description: 'Total expected outflow for the month',
|
|
4516
|
+
example: 8500
|
|
4244
4517
|
},
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4518
|
+
itemCount: {
|
|
4519
|
+
type: 'number',
|
|
4520
|
+
description: 'Number of expected transactions',
|
|
4521
|
+
example: 3
|
|
4522
|
+
},
|
|
4523
|
+
byCurrency: {
|
|
4524
|
+
type: 'object',
|
|
4525
|
+
description: 'Breakdown by currency',
|
|
4526
|
+
example: {
|
|
4527
|
+
CNY: 8500,
|
|
4528
|
+
USD: 100
|
|
4250
4529
|
}
|
|
4251
4530
|
},
|
|
4252
|
-
|
|
4253
|
-
description: '
|
|
4531
|
+
items: {
|
|
4532
|
+
description: 'Individual forecast items',
|
|
4254
4533
|
type: 'array',
|
|
4255
4534
|
items: {
|
|
4256
|
-
|
|
4535
|
+
$ref: '#/components/schemas/ForecastItemDto'
|
|
4257
4536
|
}
|
|
4258
|
-
}
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
description: 'Tag filters',
|
|
4537
|
+
}
|
|
4538
|
+
},
|
|
4539
|
+
required: ['month', 'expectedOutflow', 'itemCount', 'byCurrency', 'items']
|
|
4540
|
+
} as const;
|
|
4541
|
+
|
|
4542
|
+
export const $ForecastResponseDto = {
|
|
4543
|
+
type: 'object',
|
|
4544
|
+
properties: {
|
|
4545
|
+
forecast: {
|
|
4546
|
+
description: 'Monthly forecast data',
|
|
4269
4547
|
type: 'array',
|
|
4270
4548
|
items: {
|
|
4271
|
-
|
|
4549
|
+
$ref: '#/components/schemas/MonthlyForecastDto'
|
|
4272
4550
|
}
|
|
4273
4551
|
},
|
|
4274
|
-
|
|
4275
|
-
type: 'boolean',
|
|
4276
|
-
description: 'Enable experimental features'
|
|
4277
|
-
},
|
|
4278
|
-
isRestrictedView: {
|
|
4279
|
-
type: 'boolean',
|
|
4280
|
-
description: 'Enable restricted view mode'
|
|
4281
|
-
},
|
|
4282
|
-
language: {
|
|
4283
|
-
type: 'string',
|
|
4284
|
-
description: 'Language code',
|
|
4285
|
-
example: 'en'
|
|
4286
|
-
},
|
|
4287
|
-
locale: {
|
|
4288
|
-
type: 'string',
|
|
4289
|
-
description: 'Locale code',
|
|
4290
|
-
example: 'en-US'
|
|
4291
|
-
},
|
|
4292
|
-
projectedTotalAmount: {
|
|
4552
|
+
totalOutflow: {
|
|
4293
4553
|
type: 'number',
|
|
4294
|
-
description: '
|
|
4295
|
-
example:
|
|
4554
|
+
description: 'Total expected outflow across all months',
|
|
4555
|
+
example: 25500
|
|
4296
4556
|
},
|
|
4297
|
-
|
|
4298
|
-
type: '
|
|
4299
|
-
description: '
|
|
4300
|
-
example:
|
|
4557
|
+
totalByCurrency: {
|
|
4558
|
+
type: 'object',
|
|
4559
|
+
description: 'Total by currency across all months',
|
|
4560
|
+
example: {
|
|
4561
|
+
CNY: 25500,
|
|
4562
|
+
USD: 300
|
|
4563
|
+
}
|
|
4301
4564
|
},
|
|
4302
|
-
|
|
4565
|
+
rulesCount: {
|
|
4303
4566
|
type: 'number',
|
|
4304
|
-
description: '
|
|
4305
|
-
example:
|
|
4567
|
+
description: 'Number of active recurring rules included',
|
|
4568
|
+
example: 5
|
|
4306
4569
|
},
|
|
4307
|
-
|
|
4570
|
+
periodStart: {
|
|
4308
4571
|
type: 'string',
|
|
4309
|
-
description: '
|
|
4310
|
-
|
|
4311
|
-
}
|
|
4312
|
-
|
|
4313
|
-
} as const;
|
|
4314
|
-
|
|
4315
|
-
export const $UpdatePropertyDto = {
|
|
4316
|
-
type: 'object',
|
|
4317
|
-
properties: {
|
|
4318
|
-
value: {
|
|
4572
|
+
description: 'Forecast period start date',
|
|
4573
|
+
example: '2024-04-01'
|
|
4574
|
+
},
|
|
4575
|
+
periodEnd: {
|
|
4319
4576
|
type: 'string',
|
|
4320
|
-
description: '
|
|
4577
|
+
description: 'Forecast period end date',
|
|
4578
|
+
example: '2024-06-30'
|
|
4321
4579
|
}
|
|
4322
4580
|
},
|
|
4323
|
-
required: [
|
|
4581
|
+
required: [
|
|
4582
|
+
'forecast',
|
|
4583
|
+
'totalOutflow',
|
|
4584
|
+
'totalByCurrency',
|
|
4585
|
+
'rulesCount',
|
|
4586
|
+
'periodStart',
|
|
4587
|
+
'periodEnd'
|
|
4588
|
+
]
|
|
4324
4589
|
} as const;
|
|
4325
4590
|
|
|
4326
4591
|
export const $CreateTransactionRuleDto = {
|
|
@@ -4882,7 +5147,8 @@ export const $UpdateTransactionRuleDto = {
|
|
|
4882
5147
|
},
|
|
4883
5148
|
matchLogic: {
|
|
4884
5149
|
type: 'string',
|
|
4885
|
-
enum: ['OR', 'AND']
|
|
5150
|
+
enum: ['OR', 'AND'],
|
|
5151
|
+
default: 'OR'
|
|
4886
5152
|
},
|
|
4887
5153
|
amountMin: {
|
|
4888
5154
|
type: 'number',
|
|
@@ -4896,13 +5162,10 @@ export const $UpdateTransactionRuleDto = {
|
|
|
4896
5162
|
},
|
|
4897
5163
|
priority: {
|
|
4898
5164
|
type: 'number',
|
|
5165
|
+
default: 50,
|
|
4899
5166
|
minimum: 0,
|
|
4900
5167
|
maximum: 1000
|
|
4901
5168
|
},
|
|
4902
|
-
enabled: {
|
|
4903
|
-
type: 'boolean',
|
|
4904
|
-
description: 'Enable or disable the rule'
|
|
4905
|
-
},
|
|
4906
5169
|
additionalTags: {
|
|
4907
5170
|
items: {
|
|
4908
5171
|
type: 'array'
|
|
@@ -4912,6 +5175,10 @@ export const $UpdateTransactionRuleDto = {
|
|
|
4912
5175
|
},
|
|
4913
5176
|
additionalMetadata: {
|
|
4914
5177
|
type: 'object'
|
|
5178
|
+
},
|
|
5179
|
+
enabled: {
|
|
5180
|
+
type: 'boolean',
|
|
5181
|
+
description: 'Enable or disable the rule'
|
|
4915
5182
|
}
|
|
4916
5183
|
}
|
|
4917
5184
|
} as const;
|
|
@@ -5005,9 +5272,23 @@ export const $CategoryCatalogEntryDto = {
|
|
|
5005
5272
|
items: {
|
|
5006
5273
|
type: 'string'
|
|
5007
5274
|
}
|
|
5275
|
+
},
|
|
5276
|
+
categoryAccounts: {
|
|
5277
|
+
description:
|
|
5278
|
+
"Beancount account paths (categoryAccount) of the region-enabled system rules whose categoryKeywords include this slug (#816). System rules only (public endpoint — user rules excluded); one-to-many by design (e.g. 'utilities' → Electricity/Water/Internet/Gas), sorted, [] when no rule maps the slug.",
|
|
5279
|
+
example: [
|
|
5280
|
+
'Expenses:Utilities:Electricity',
|
|
5281
|
+
'Expenses:Utilities:Gas',
|
|
5282
|
+
'Expenses:Utilities:Internet',
|
|
5283
|
+
'Expenses:Utilities:Water'
|
|
5284
|
+
],
|
|
5285
|
+
type: 'array',
|
|
5286
|
+
items: {
|
|
5287
|
+
type: 'string'
|
|
5288
|
+
}
|
|
5008
5289
|
}
|
|
5009
5290
|
},
|
|
5010
|
-
required: ['slug', 'scenario', 'icon', 'regions']
|
|
5291
|
+
required: ['slug', 'scenario', 'icon', 'regions', 'categoryAccounts']
|
|
5011
5292
|
} as const;
|
|
5012
5293
|
|
|
5013
5294
|
export const $CategoryCatalogListResponseDto = {
|
|
@@ -5198,6 +5479,14 @@ export const $OnboardingAccountDto = {
|
|
|
5198
5479
|
description:
|
|
5199
5480
|
'Platform ID to bind the account to (references Platform.id); omit for unbound',
|
|
5200
5481
|
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
5482
|
+
},
|
|
5483
|
+
displayName: {
|
|
5484
|
+
type: 'string',
|
|
5485
|
+
description:
|
|
5486
|
+
'User-set display name override (omit/null = keep the derived name)',
|
|
5487
|
+
nullable: true,
|
|
5488
|
+
maxLength: 50,
|
|
5489
|
+
example: 'Salary card'
|
|
5201
5490
|
}
|
|
5202
5491
|
},
|
|
5203
5492
|
required: ['path', 'currency']
|
|
@@ -6118,8 +6407,9 @@ export const $ClientParsedDataDto = {
|
|
|
6118
6407
|
},
|
|
6119
6408
|
category: {
|
|
6120
6409
|
type: 'string',
|
|
6121
|
-
description:
|
|
6122
|
-
|
|
6410
|
+
description:
|
|
6411
|
+
'Category in canonical form (catalog slug or Stage-2 rule keyword token, ADR-0116) — echo back verbatim from parsedData.category. Foreign forms (locale display names, account paths) are rejected with nlp.category.invalid.',
|
|
6412
|
+
example: 'food'
|
|
6123
6413
|
},
|
|
6124
6414
|
incomeType: {
|
|
6125
6415
|
type: 'string',
|
|
@@ -6217,8 +6507,27 @@ export const $ProcessNlpDto = {
|
|
|
6217
6507
|
selectedAccount: {
|
|
6218
6508
|
type: 'string',
|
|
6219
6509
|
description:
|
|
6220
|
-
'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.',
|
|
6510
|
+
'confirm_account echo-back: account path selected from the prior confirm_account response (suggestedAccount, similarAccounts[i].path, or a typed path). Applied directly when the session is confirming_account — no NL re-parse.',
|
|
6221
6511
|
example: 'Expenses:Food:Coffee'
|
|
6512
|
+
},
|
|
6513
|
+
viewpointAccount: {
|
|
6514
|
+
type: 'string',
|
|
6515
|
+
description:
|
|
6516
|
+
'Viewpoint account hint: the beancount path the user drilled into (e.g. from an account drill-down). Tie-break only — never overrides accounts resolved from the text. Must be an owned, OPEN Assets:/Liabilities: account; unresolvable hints are silently ignored.',
|
|
6517
|
+
example: 'Assets:CN:Bank:ICBC'
|
|
6518
|
+
},
|
|
6519
|
+
viewpointCategory: {
|
|
6520
|
+
type: 'string',
|
|
6521
|
+
description:
|
|
6522
|
+
"Viewpoint category hint: the ADR-0075 Group segment the user drilled into (e.g. 'Food'). Resolved to a concrete OPEN account in that group; tie-break only — never overrides a category resolved from the text.",
|
|
6523
|
+
example: 'Food'
|
|
6524
|
+
},
|
|
6525
|
+
viewpointFlow: {
|
|
6526
|
+
type: 'string',
|
|
6527
|
+
description:
|
|
6528
|
+
"Companion flow root for viewpointCategory ('income' | 'expense'), mirroring the ADR-0126 list-endpoint invariant. Derived from the session's routed intent (multi-turn) when absent; a first-turn flow-less category hint is dropped — send the flow explicitly.",
|
|
6529
|
+
enum: ['income', 'expense'],
|
|
6530
|
+
example: 'expense'
|
|
6222
6531
|
}
|
|
6223
6532
|
}
|
|
6224
6533
|
} as const;
|
|
@@ -6286,7 +6595,9 @@ export const $NlpParsedDataDto = {
|
|
|
6286
6595
|
},
|
|
6287
6596
|
category: {
|
|
6288
6597
|
type: 'string',
|
|
6289
|
-
description:
|
|
6598
|
+
description:
|
|
6599
|
+
'Category in canonical form: a CATEGORY_CATALOG slug (GET /{region}/bean/categories) or a Stage-2 rule categoryKeywords token (ADR-0116 D2). Never a locale display name or a beancount account path. Echo back verbatim on confirm.',
|
|
6600
|
+
example: 'food'
|
|
6290
6601
|
},
|
|
6291
6602
|
incomeType: {
|
|
6292
6603
|
type: 'string',
|
|
@@ -6532,6 +6843,24 @@ export const $NlpRuleConfirmationDataDto = {
|
|
|
6532
6843
|
]
|
|
6533
6844
|
} as const;
|
|
6534
6845
|
|
|
6846
|
+
export const $NlpAccountCandidateDto = {
|
|
6847
|
+
type: 'object',
|
|
6848
|
+
properties: {
|
|
6849
|
+
path: {
|
|
6850
|
+
type: 'string',
|
|
6851
|
+
description: 'Canonical beancount account path (echo back on selection)',
|
|
6852
|
+
example: 'Expenses:Food:Dining'
|
|
6853
|
+
},
|
|
6854
|
+
name: {
|
|
6855
|
+
type: 'string',
|
|
6856
|
+
description:
|
|
6857
|
+
'Localized display name (ADR-0114 read-time projection, user locale)',
|
|
6858
|
+
example: '餐饮'
|
|
6859
|
+
}
|
|
6860
|
+
},
|
|
6861
|
+
required: ['path', 'name']
|
|
6862
|
+
} as const;
|
|
6863
|
+
|
|
6535
6864
|
export const $NlpAccountConfirmationDataDto = {
|
|
6536
6865
|
type: 'object',
|
|
6537
6866
|
properties: {
|
|
@@ -6547,10 +6876,11 @@ export const $NlpAccountConfirmationDataDto = {
|
|
|
6547
6876
|
example: 'Expenses:Food:Drinks'
|
|
6548
6877
|
},
|
|
6549
6878
|
similarAccounts: {
|
|
6550
|
-
description:
|
|
6879
|
+
description:
|
|
6880
|
+
'Similar accounts for user selection (path + localized name, #680)',
|
|
6551
6881
|
type: 'array',
|
|
6552
6882
|
items: {
|
|
6553
|
-
|
|
6883
|
+
$ref: '#/components/schemas/NlpAccountCandidateDto'
|
|
6554
6884
|
}
|
|
6555
6885
|
},
|
|
6556
6886
|
errorMessage: {
|
|
@@ -7127,55 +7457,128 @@ export const $PlatformMatchResultDto = {
|
|
|
7127
7457
|
category: {
|
|
7128
7458
|
type: 'string',
|
|
7129
7459
|
description:
|
|
7130
|
-
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
7460
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
|
|
7461
|
+
nullable: true,
|
|
7462
|
+
example: 'DigitalWallet'
|
|
7463
|
+
},
|
|
7464
|
+
matchType: {
|
|
7465
|
+
type: 'string',
|
|
7466
|
+
description: "How this row matched: 'exact' > 'prefix' > 'substring'",
|
|
7467
|
+
enum: ['exact', 'prefix', 'substring']
|
|
7468
|
+
}
|
|
7469
|
+
},
|
|
7470
|
+
required: [
|
|
7471
|
+
'id',
|
|
7472
|
+
'name',
|
|
7473
|
+
'canonical',
|
|
7474
|
+
'type',
|
|
7475
|
+
'suggestedSegment',
|
|
7476
|
+
'logoUrl',
|
|
7477
|
+
'countryCode',
|
|
7478
|
+
'category',
|
|
7479
|
+
'matchType'
|
|
7480
|
+
]
|
|
7481
|
+
} as const;
|
|
7482
|
+
|
|
7483
|
+
export const $PlatformMatchResponseDto = {
|
|
7484
|
+
type: 'object',
|
|
7485
|
+
properties: {
|
|
7486
|
+
platforms: {
|
|
7487
|
+
description: 'Ranked matches, best tier first (at most 10 rows)',
|
|
7488
|
+
type: 'array',
|
|
7489
|
+
items: {
|
|
7490
|
+
$ref: '#/components/schemas/PlatformMatchResultDto'
|
|
7491
|
+
}
|
|
7492
|
+
},
|
|
7493
|
+
matchType: {
|
|
7494
|
+
type: 'string',
|
|
7495
|
+
description:
|
|
7496
|
+
"Overall match quality — top row's tier, or 'none' when no hits",
|
|
7497
|
+
enum: ['none', 'exact', 'prefix', 'substring']
|
|
7498
|
+
},
|
|
7499
|
+
total: {
|
|
7500
|
+
type: 'number',
|
|
7501
|
+
description: 'Total matches before LIMIT (truncation transparency)'
|
|
7502
|
+
},
|
|
7503
|
+
hasMore: {
|
|
7504
|
+
type: 'boolean',
|
|
7505
|
+
description: 'true when total > platforms.length (more matches exist)'
|
|
7506
|
+
}
|
|
7507
|
+
},
|
|
7508
|
+
required: ['platforms', 'matchType', 'total', 'hasMore']
|
|
7509
|
+
} as const;
|
|
7510
|
+
|
|
7511
|
+
export const $PlatformStandardsPlatformDto = {
|
|
7512
|
+
type: 'object',
|
|
7513
|
+
properties: {
|
|
7514
|
+
id: {
|
|
7515
|
+
type: 'string',
|
|
7516
|
+
description: 'Global platform ID'
|
|
7517
|
+
},
|
|
7518
|
+
name: {
|
|
7519
|
+
type: 'string',
|
|
7520
|
+
description: 'Platform name (e.g., "ICBC")'
|
|
7521
|
+
},
|
|
7522
|
+
canonical: {
|
|
7523
|
+
type: 'string',
|
|
7524
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
7525
|
+
},
|
|
7526
|
+
suggestedSegment: {
|
|
7527
|
+
type: 'string',
|
|
7528
|
+
description:
|
|
7529
|
+
'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
|
|
7530
|
+
},
|
|
7531
|
+
type: {
|
|
7532
|
+
type: 'string',
|
|
7533
|
+
description: 'Platform type',
|
|
7534
|
+
enum: [
|
|
7535
|
+
'BANK',
|
|
7536
|
+
'BROKERAGE',
|
|
7537
|
+
'CRYPTO_EXCHANGE',
|
|
7538
|
+
'PAYMENT',
|
|
7539
|
+
'INVESTMENT',
|
|
7540
|
+
'INSURANCE',
|
|
7541
|
+
'OTHER'
|
|
7542
|
+
]
|
|
7543
|
+
},
|
|
7544
|
+
category: {
|
|
7545
|
+
type: 'string',
|
|
7546
|
+
description:
|
|
7547
|
+
'Region-aware category (institution vocab, e.g. DigitalWallet/Bank) resolved against the final region. null = no region-aware suggestion; fall back to type.',
|
|
7131
7548
|
nullable: true,
|
|
7132
|
-
example: '
|
|
7133
|
-
},
|
|
7134
|
-
matchType: {
|
|
7135
|
-
type: 'string',
|
|
7136
|
-
description: "How this row matched: 'exact' > 'prefix' > 'substring'",
|
|
7137
|
-
enum: ['exact', 'prefix', 'substring']
|
|
7549
|
+
example: 'Bank'
|
|
7138
7550
|
}
|
|
7139
7551
|
},
|
|
7140
|
-
required: [
|
|
7141
|
-
'id',
|
|
7142
|
-
'name',
|
|
7143
|
-
'canonical',
|
|
7144
|
-
'type',
|
|
7145
|
-
'suggestedSegment',
|
|
7146
|
-
'logoUrl',
|
|
7147
|
-
'countryCode',
|
|
7148
|
-
'category',
|
|
7149
|
-
'matchType'
|
|
7150
|
-
]
|
|
7552
|
+
required: ['id', 'name', 'canonical', 'suggestedSegment', 'type', 'category']
|
|
7151
7553
|
} as const;
|
|
7152
7554
|
|
|
7153
|
-
export const $
|
|
7555
|
+
export const $PlatformStandardsResponseDto = {
|
|
7154
7556
|
type: 'object',
|
|
7155
7557
|
properties: {
|
|
7156
|
-
|
|
7157
|
-
description: '
|
|
7158
|
-
|
|
7159
|
-
|
|
7160
|
-
|
|
7161
|
-
|
|
7558
|
+
platform: {
|
|
7559
|
+
description: 'The selected platform (institution lock source)',
|
|
7560
|
+
allOf: [
|
|
7561
|
+
{
|
|
7562
|
+
$ref: '#/components/schemas/PlatformStandardsPlatformDto'
|
|
7563
|
+
}
|
|
7564
|
+
]
|
|
7162
7565
|
},
|
|
7163
|
-
|
|
7566
|
+
region: {
|
|
7164
7567
|
type: 'string',
|
|
7165
7568
|
description:
|
|
7166
|
-
"
|
|
7167
|
-
|
|
7168
|
-
},
|
|
7169
|
-
total: {
|
|
7170
|
-
type: 'number',
|
|
7171
|
-
description: 'Total matches before LIMIT (truncation transparency)'
|
|
7569
|
+
"Resolved template region (ISO 3166-1 alpha-2, UPPERCASE): the platform's own countryCode when set, else the region query param. For regions without a regional template file the template list falls back to the universal-only catalog while region still echoes the code.",
|
|
7570
|
+
example: 'CN'
|
|
7172
7571
|
},
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7572
|
+
templates: {
|
|
7573
|
+
description:
|
|
7574
|
+
'Candidate account-standard templates of the resolved region (groupable by productCategory client-side)',
|
|
7575
|
+
type: 'array',
|
|
7576
|
+
items: {
|
|
7577
|
+
$ref: '#/components/schemas/AccountStandardResponseDto'
|
|
7578
|
+
}
|
|
7176
7579
|
}
|
|
7177
7580
|
},
|
|
7178
|
-
required: ['
|
|
7581
|
+
required: ['platform', 'region', 'templates']
|
|
7179
7582
|
} as const;
|
|
7180
7583
|
|
|
7181
7584
|
export const $CreatePlatformDto = {
|
|
@@ -7279,7 +7682,8 @@ export const $UpdatePlatformDto = {
|
|
|
7279
7682
|
},
|
|
7280
7683
|
isActive: {
|
|
7281
7684
|
type: 'boolean',
|
|
7282
|
-
description: 'Whether the platform is active'
|
|
7685
|
+
description: 'Whether the platform is active',
|
|
7686
|
+
default: true
|
|
7283
7687
|
}
|
|
7284
7688
|
}
|
|
7285
7689
|
} as const;
|
|
@@ -7442,7 +7846,8 @@ export const $AccountItemDto = {
|
|
|
7442
7846
|
},
|
|
7443
7847
|
displayName: {
|
|
7444
7848
|
type: 'string',
|
|
7445
|
-
description:
|
|
7849
|
+
description:
|
|
7850
|
+
'Display name: user-set name if provided (#762), else the ADR-0114 chain — request-locale catalog name, en pivot, then the last part of the account path (#771)',
|
|
7446
7851
|
example: 'Savings'
|
|
7447
7852
|
},
|
|
7448
7853
|
balance: {
|
|
@@ -7478,7 +7883,8 @@ export const $PlatformGroupDto = {
|
|
|
7478
7883
|
example: 'CMB Bank'
|
|
7479
7884
|
},
|
|
7480
7885
|
accounts: {
|
|
7481
|
-
description:
|
|
7886
|
+
description:
|
|
7887
|
+
'Accounts within this platform (Assets and Liabilities rows, #696)',
|
|
7482
7888
|
type: 'array',
|
|
7483
7889
|
items: {
|
|
7484
7890
|
$ref: '#/components/schemas/AccountItemDto'
|
|
@@ -7486,7 +7892,8 @@ export const $PlatformGroupDto = {
|
|
|
7486
7892
|
},
|
|
7487
7893
|
totalBalance: {
|
|
7488
7894
|
type: 'string',
|
|
7489
|
-
description:
|
|
7895
|
+
description:
|
|
7896
|
+
'FX-converted total balance in base currency (nets Assets + Liabilities rows; can be negative)',
|
|
7490
7897
|
example: '100000.00'
|
|
7491
7898
|
},
|
|
7492
7899
|
balanceByCurrency: {
|
|
@@ -7505,7 +7912,7 @@ export const $PlatformGroupDto = {
|
|
|
7505
7912
|
sharePct: {
|
|
7506
7913
|
type: 'number',
|
|
7507
7914
|
description:
|
|
7508
|
-
'Share of the grand
|
|
7915
|
+
'Share of the converted asset-side grand total (0-100); liability balances are excluded from the basis; 0 when grand total is 0 (#696)',
|
|
7509
7916
|
example: 42.5
|
|
7510
7917
|
}
|
|
7511
7918
|
},
|
|
@@ -7553,7 +7960,8 @@ export const $AccountsSummaryDto = {
|
|
|
7553
7960
|
properties: {
|
|
7554
7961
|
totalAccounts: {
|
|
7555
7962
|
type: 'number',
|
|
7556
|
-
description:
|
|
7963
|
+
description:
|
|
7964
|
+
'Total number of accounts (balance sheet: Assets + Liabilities, #696)'
|
|
7557
7965
|
},
|
|
7558
7966
|
totalPlatforms: {
|
|
7559
7967
|
type: 'number',
|
|
@@ -7611,7 +8019,8 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
7611
8019
|
},
|
|
7612
8020
|
displayName: {
|
|
7613
8021
|
type: 'string',
|
|
7614
|
-
description:
|
|
8022
|
+
description:
|
|
8023
|
+
'Display name: user-set name if provided (#762), else the ADR-0114 chain — request-locale catalog name, en pivot, then the last part of the account path (#771)',
|
|
7615
8024
|
example: 'Savings'
|
|
7616
8025
|
},
|
|
7617
8026
|
balance: {
|
|
@@ -8097,7 +8506,7 @@ export const $MonetaryDto = {
|
|
|
8097
8506
|
example: 'USD'
|
|
8098
8507
|
},
|
|
8099
8508
|
baseCcyEquivalent: {
|
|
8100
|
-
type: '
|
|
8509
|
+
type: 'string',
|
|
8101
8510
|
description: 'Converted to user base currency (Decimal string)',
|
|
8102
8511
|
example: '21600',
|
|
8103
8512
|
nullable: true
|
|
@@ -8173,13 +8582,13 @@ export const $HoldingPnlRowDto = {
|
|
|
8173
8582
|
example: 'Assets:US:Broker:AAPL'
|
|
8174
8583
|
},
|
|
8175
8584
|
accountCcy: {
|
|
8176
|
-
type: '
|
|
8585
|
+
type: 'string',
|
|
8177
8586
|
description: 'Account settlement currency (ISO 4217), from cost currency',
|
|
8178
8587
|
nullable: true,
|
|
8179
8588
|
example: 'USD'
|
|
8180
8589
|
},
|
|
8181
8590
|
brokerType: {
|
|
8182
|
-
type: '
|
|
8591
|
+
type: 'string',
|
|
8183
8592
|
description: 'Broker type derived from Platform.type',
|
|
8184
8593
|
nullable: true,
|
|
8185
8594
|
example: 'broker'
|
|
@@ -8200,7 +8609,7 @@ export const $HoldingPnlRowDto = {
|
|
|
8200
8609
|
example: 'EQUITY'
|
|
8201
8610
|
},
|
|
8202
8611
|
assetSubClass: {
|
|
8203
|
-
type: '
|
|
8612
|
+
type: 'string',
|
|
8204
8613
|
nullable: true,
|
|
8205
8614
|
example: 'STOCK'
|
|
8206
8615
|
},
|
|
@@ -8247,14 +8656,14 @@ export const $HoldingPnlRowDto = {
|
|
|
8247
8656
|
]
|
|
8248
8657
|
},
|
|
8249
8658
|
unrealizedPnlBase: {
|
|
8250
|
-
type: '
|
|
8659
|
+
type: 'string',
|
|
8251
8660
|
description:
|
|
8252
8661
|
'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
|
|
8253
8662
|
nullable: true,
|
|
8254
8663
|
example: '6000'
|
|
8255
8664
|
},
|
|
8256
8665
|
unrealizedPnlPct: {
|
|
8257
|
-
type: '
|
|
8666
|
+
type: 'string',
|
|
8258
8667
|
description: 'Unrealized P&L % (Decimal string)',
|
|
8259
8668
|
nullable: true,
|
|
8260
8669
|
example: '25'
|
|
@@ -8278,7 +8687,7 @@ export const $HoldingPnlRowDto = {
|
|
|
8278
8687
|
]
|
|
8279
8688
|
},
|
|
8280
8689
|
pctOfInvestedAssets: {
|
|
8281
|
-
type: '
|
|
8690
|
+
type: 'string',
|
|
8282
8691
|
description:
|
|
8283
8692
|
'Share of invested assets % (Decimal string); only for invested chartTokens',
|
|
8284
8693
|
nullable: true,
|
|
@@ -8323,15 +8732,15 @@ export const $HoldingPnlWarningDto = {
|
|
|
8323
8732
|
]
|
|
8324
8733
|
},
|
|
8325
8734
|
symbol: {
|
|
8326
|
-
type: '
|
|
8735
|
+
type: 'string',
|
|
8327
8736
|
nullable: true
|
|
8328
8737
|
},
|
|
8329
8738
|
accountId: {
|
|
8330
|
-
type: '
|
|
8739
|
+
type: 'string',
|
|
8331
8740
|
nullable: true
|
|
8332
8741
|
},
|
|
8333
8742
|
currency: {
|
|
8334
|
-
type: '
|
|
8743
|
+
type: 'string',
|
|
8335
8744
|
nullable: true
|
|
8336
8745
|
}
|
|
8337
8746
|
},
|
|
@@ -8395,6 +8804,216 @@ export const $AnonymousLoginResponseDto = {
|
|
|
8395
8804
|
required: ['authToken']
|
|
8396
8805
|
} as const;
|
|
8397
8806
|
|
|
8807
|
+
export const $ParserContributionMetaDto = {
|
|
8808
|
+
type: 'object',
|
|
8809
|
+
properties: {
|
|
8810
|
+
institution: {
|
|
8811
|
+
type: 'string',
|
|
8812
|
+
description: 'Institution slug (lowercase kebab-case)',
|
|
8813
|
+
pattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
|
|
8814
|
+
example: 'icbc'
|
|
8815
|
+
},
|
|
8816
|
+
region: {
|
|
8817
|
+
type: 'string',
|
|
8818
|
+
enum: [
|
|
8819
|
+
'cn',
|
|
8820
|
+
'us',
|
|
8821
|
+
'de',
|
|
8822
|
+
'fr',
|
|
8823
|
+
'gb',
|
|
8824
|
+
'hk',
|
|
8825
|
+
'jp',
|
|
8826
|
+
'sg',
|
|
8827
|
+
'au',
|
|
8828
|
+
'ca',
|
|
8829
|
+
'other'
|
|
8830
|
+
]
|
|
8831
|
+
},
|
|
8832
|
+
accountType: {
|
|
8833
|
+
type: 'string',
|
|
8834
|
+
enum: ['checking', 'savings', 'credit', 'debit', 'investment']
|
|
8835
|
+
},
|
|
8836
|
+
format: {
|
|
8837
|
+
type: 'string',
|
|
8838
|
+
enum: ['csv', 'xlsx', 'pdf', 'ofx', 'qif']
|
|
8839
|
+
},
|
|
8840
|
+
institutionDisplayName: {
|
|
8841
|
+
type: 'string',
|
|
8842
|
+
example: '中国工商银行'
|
|
8843
|
+
},
|
|
8844
|
+
encoding: {
|
|
8845
|
+
type: 'string',
|
|
8846
|
+
example: 'utf-8'
|
|
8847
|
+
},
|
|
8848
|
+
delimiter: {
|
|
8849
|
+
type: 'string',
|
|
8850
|
+
description: 'CSV delimiter character: ",", ";", "\\t" or "|"'
|
|
8851
|
+
},
|
|
8852
|
+
headerRows: {
|
|
8853
|
+
type: 'number',
|
|
8854
|
+
default: 1,
|
|
8855
|
+
description: 'Header row count; the client omits the field when it is 1'
|
|
8856
|
+
},
|
|
8857
|
+
notes: {
|
|
8858
|
+
type: 'string',
|
|
8859
|
+
maxLength: 2000
|
|
8860
|
+
}
|
|
8861
|
+
},
|
|
8862
|
+
required: ['institution', 'region', 'accountType', 'format']
|
|
8863
|
+
} as const;
|
|
8864
|
+
|
|
8865
|
+
export const $ParserContributionSamplesDto = {
|
|
8866
|
+
type: 'object',
|
|
8867
|
+
properties: {
|
|
8868
|
+
rows: {
|
|
8869
|
+
description:
|
|
8870
|
+
'Client-sanitized sample rows (key = column name, value = cell)',
|
|
8871
|
+
type: 'array',
|
|
8872
|
+
items: {
|
|
8873
|
+
type: 'object'
|
|
8874
|
+
}
|
|
8875
|
+
},
|
|
8876
|
+
rawHeaders: {
|
|
8877
|
+
type: 'array',
|
|
8878
|
+
items: {
|
|
8879
|
+
type: 'string'
|
|
8880
|
+
}
|
|
8881
|
+
}
|
|
8882
|
+
},
|
|
8883
|
+
required: ['rows']
|
|
8884
|
+
} as const;
|
|
8885
|
+
|
|
8886
|
+
export const $FieldHintDto = {
|
|
8887
|
+
type: 'object',
|
|
8888
|
+
properties: {
|
|
8889
|
+
columnName: {
|
|
8890
|
+
type: 'string',
|
|
8891
|
+
example: '交易日期'
|
|
8892
|
+
},
|
|
8893
|
+
format: {
|
|
8894
|
+
type: 'string',
|
|
8895
|
+
description: 'Date format, e.g. yyyy-MM-dd HH:mm',
|
|
8896
|
+
example: 'yyyy-MM-dd'
|
|
8897
|
+
},
|
|
8898
|
+
signConvention: {
|
|
8899
|
+
type: 'string',
|
|
8900
|
+
enum: ['negative-expense', 'positive-expense', 'separate-columns']
|
|
8901
|
+
},
|
|
8902
|
+
creditColumn: {
|
|
8903
|
+
type: 'string'
|
|
8904
|
+
},
|
|
8905
|
+
debitColumn: {
|
|
8906
|
+
type: 'string'
|
|
8907
|
+
}
|
|
8908
|
+
},
|
|
8909
|
+
required: ['columnName']
|
|
8910
|
+
} as const;
|
|
8911
|
+
|
|
8912
|
+
export const $ParserContributionFieldHintsDto = {
|
|
8913
|
+
type: 'object',
|
|
8914
|
+
properties: {
|
|
8915
|
+
date: {
|
|
8916
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8917
|
+
},
|
|
8918
|
+
amount: {
|
|
8919
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8920
|
+
},
|
|
8921
|
+
description: {
|
|
8922
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8923
|
+
},
|
|
8924
|
+
balance: {
|
|
8925
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8926
|
+
},
|
|
8927
|
+
payee: {
|
|
8928
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8929
|
+
},
|
|
8930
|
+
reference: {
|
|
8931
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8932
|
+
},
|
|
8933
|
+
category: {
|
|
8934
|
+
$ref: '#/components/schemas/FieldHintDto'
|
|
8935
|
+
}
|
|
8936
|
+
},
|
|
8937
|
+
required: ['date', 'amount']
|
|
8938
|
+
} as const;
|
|
8939
|
+
|
|
8940
|
+
export const $ExpectedTransactionDto = {
|
|
8941
|
+
type: 'object',
|
|
8942
|
+
properties: {
|
|
8943
|
+
date: {
|
|
8944
|
+
type: 'string',
|
|
8945
|
+
example: '2026-08-01'
|
|
8946
|
+
},
|
|
8947
|
+
amount: {
|
|
8948
|
+
type: 'number',
|
|
8949
|
+
example: -45.5
|
|
8950
|
+
},
|
|
8951
|
+
description: {
|
|
8952
|
+
type: 'string',
|
|
8953
|
+
example: '星巴克-***店'
|
|
8954
|
+
},
|
|
8955
|
+
payee: {
|
|
8956
|
+
type: 'string'
|
|
8957
|
+
},
|
|
8958
|
+
category: {
|
|
8959
|
+
type: 'string'
|
|
8960
|
+
}
|
|
8961
|
+
},
|
|
8962
|
+
required: ['date', 'amount', 'description']
|
|
8963
|
+
} as const;
|
|
8964
|
+
|
|
8965
|
+
export const $ParserContributionExamplesDto = {
|
|
8966
|
+
type: 'object',
|
|
8967
|
+
properties: {
|
|
8968
|
+
expectedTransactions: {
|
|
8969
|
+
type: 'array',
|
|
8970
|
+
items: {
|
|
8971
|
+
$ref: '#/components/schemas/ExpectedTransactionDto'
|
|
8972
|
+
}
|
|
8973
|
+
}
|
|
8974
|
+
},
|
|
8975
|
+
required: ['expectedTransactions']
|
|
8976
|
+
} as const;
|
|
8977
|
+
|
|
8978
|
+
export const $ParserContributionRequestDto = {
|
|
8979
|
+
type: 'object',
|
|
8980
|
+
properties: {
|
|
8981
|
+
meta: {
|
|
8982
|
+
$ref: '#/components/schemas/ParserContributionMetaDto'
|
|
8983
|
+
},
|
|
8984
|
+
samples: {
|
|
8985
|
+
$ref: '#/components/schemas/ParserContributionSamplesDto'
|
|
8986
|
+
},
|
|
8987
|
+
fieldHints: {
|
|
8988
|
+
$ref: '#/components/schemas/ParserContributionFieldHintsDto'
|
|
8989
|
+
},
|
|
8990
|
+
examples: {
|
|
8991
|
+
description: 'Omitted entirely by the client when empty',
|
|
8992
|
+
allOf: [
|
|
8993
|
+
{
|
|
8994
|
+
$ref: '#/components/schemas/ParserContributionExamplesDto'
|
|
8995
|
+
}
|
|
8996
|
+
]
|
|
8997
|
+
}
|
|
8998
|
+
},
|
|
8999
|
+
required: ['meta', 'samples', 'fieldHints']
|
|
9000
|
+
} as const;
|
|
9001
|
+
|
|
9002
|
+
export const $ParserContributionRelayResponseDto = {
|
|
9003
|
+
type: 'object',
|
|
9004
|
+
properties: {
|
|
9005
|
+
issueUrl: {
|
|
9006
|
+
type: 'string',
|
|
9007
|
+
example: 'https://github.com/fire-zu/firela-vlt/issues/42'
|
|
9008
|
+
},
|
|
9009
|
+
issueNumber: {
|
|
9010
|
+
type: 'number',
|
|
9011
|
+
example: 42
|
|
9012
|
+
}
|
|
9013
|
+
},
|
|
9014
|
+
required: ['issueUrl', 'issueNumber']
|
|
9015
|
+
} as const;
|
|
9016
|
+
|
|
8398
9017
|
export const $SymbolSearchResultDto = {
|
|
8399
9018
|
type: 'object',
|
|
8400
9019
|
properties: {
|
|
@@ -8403,35 +9022,35 @@ export const $SymbolSearchResultDto = {
|
|
|
8403
9022
|
example: 'AAPL'
|
|
8404
9023
|
},
|
|
8405
9024
|
name: {
|
|
8406
|
-
type: '
|
|
9025
|
+
type: 'string',
|
|
8407
9026
|
example: 'Apple Inc.',
|
|
8408
9027
|
nullable: true
|
|
8409
9028
|
},
|
|
8410
9029
|
exchange: {
|
|
8411
|
-
type: '
|
|
9030
|
+
type: 'string',
|
|
8412
9031
|
example: 'US',
|
|
8413
9032
|
nullable: true
|
|
8414
9033
|
},
|
|
8415
9034
|
assetType: {
|
|
8416
|
-
type: '
|
|
9035
|
+
type: 'string',
|
|
8417
9036
|
description: 'OpenBB asset_type (e.g. stock, etf)',
|
|
8418
9037
|
example: 'stock',
|
|
8419
9038
|
nullable: true
|
|
8420
9039
|
},
|
|
8421
9040
|
assetClass: {
|
|
8422
|
-
type: '
|
|
9041
|
+
type: 'string',
|
|
8423
9042
|
description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
|
|
8424
9043
|
example: 'EQUITY',
|
|
8425
9044
|
nullable: true
|
|
8426
9045
|
},
|
|
8427
9046
|
assetSubClass: {
|
|
8428
|
-
type: '
|
|
9047
|
+
type: 'string',
|
|
8429
9048
|
description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
|
|
8430
9049
|
example: 'STOCK',
|
|
8431
9050
|
nullable: true
|
|
8432
9051
|
},
|
|
8433
9052
|
currency: {
|
|
8434
|
-
type: '
|
|
9053
|
+
type: 'string',
|
|
8435
9054
|
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8436
9055
|
example: 'USD',
|
|
8437
9056
|
nullable: true
|
|
@@ -8448,90 +9067,90 @@ export const $SymbolQuoteDto = {
|
|
|
8448
9067
|
example: 'AAPL'
|
|
8449
9068
|
},
|
|
8450
9069
|
name: {
|
|
8451
|
-
type: '
|
|
9070
|
+
type: 'string',
|
|
8452
9071
|
example: 'Apple Inc.',
|
|
8453
9072
|
nullable: true
|
|
8454
9073
|
},
|
|
8455
9074
|
exchange: {
|
|
8456
|
-
type: '
|
|
9075
|
+
type: 'string',
|
|
8457
9076
|
example: 'US',
|
|
8458
9077
|
nullable: true
|
|
8459
9078
|
},
|
|
8460
9079
|
assetType: {
|
|
8461
|
-
type: '
|
|
9080
|
+
type: 'string',
|
|
8462
9081
|
description: 'OpenBB asset_type',
|
|
8463
9082
|
example: 'stock',
|
|
8464
9083
|
nullable: true
|
|
8465
9084
|
},
|
|
8466
9085
|
assetClass: {
|
|
8467
|
-
type: '
|
|
9086
|
+
type: 'string',
|
|
8468
9087
|
description: 'IGN asset class',
|
|
8469
9088
|
example: 'EQUITY',
|
|
8470
9089
|
nullable: true
|
|
8471
9090
|
},
|
|
8472
9091
|
assetSubClass: {
|
|
8473
|
-
type: '
|
|
9092
|
+
type: 'string',
|
|
8474
9093
|
description: 'IGN asset sub-class',
|
|
8475
9094
|
example: 'STOCK',
|
|
8476
9095
|
nullable: true
|
|
8477
9096
|
},
|
|
8478
9097
|
currency: {
|
|
8479
|
-
type: '
|
|
9098
|
+
type: 'string',
|
|
8480
9099
|
description: 'Trading currency (extra_data or inferred from exchange)',
|
|
8481
9100
|
example: 'USD',
|
|
8482
9101
|
nullable: true
|
|
8483
9102
|
},
|
|
8484
9103
|
price: {
|
|
8485
|
-
type: '
|
|
9104
|
+
type: 'string',
|
|
8486
9105
|
description: 'Latest price (Decimal string)',
|
|
8487
9106
|
example: '189.84',
|
|
8488
9107
|
nullable: true
|
|
8489
9108
|
},
|
|
8490
9109
|
priceDate: {
|
|
8491
|
-
type: '
|
|
9110
|
+
type: 'string',
|
|
8492
9111
|
description: 'Date the price was observed (ISO yyyy-MM-dd)',
|
|
8493
9112
|
example: '2026-08-05',
|
|
8494
9113
|
nullable: true
|
|
8495
9114
|
},
|
|
8496
9115
|
changePercent: {
|
|
8497
|
-
type: '
|
|
9116
|
+
type: 'number',
|
|
8498
9117
|
description:
|
|
8499
9118
|
'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.',
|
|
8500
9119
|
example: 1.7,
|
|
8501
9120
|
nullable: true
|
|
8502
9121
|
},
|
|
8503
9122
|
prevClose: {
|
|
8504
|
-
type: '
|
|
9123
|
+
type: 'string',
|
|
8505
9124
|
description: 'Previous close (Decimal string)',
|
|
8506
9125
|
nullable: true
|
|
8507
9126
|
},
|
|
8508
9127
|
open: {
|
|
8509
|
-
type: '
|
|
9128
|
+
type: 'string',
|
|
8510
9129
|
description: 'Day open (Decimal string)',
|
|
8511
9130
|
nullable: true
|
|
8512
9131
|
},
|
|
8513
9132
|
high: {
|
|
8514
|
-
type: '
|
|
9133
|
+
type: 'string',
|
|
8515
9134
|
description: 'Day high (Decimal string)',
|
|
8516
9135
|
nullable: true
|
|
8517
9136
|
},
|
|
8518
9137
|
low: {
|
|
8519
|
-
type: '
|
|
9138
|
+
type: 'string',
|
|
8520
9139
|
description: 'Day low (Decimal string)',
|
|
8521
9140
|
nullable: true
|
|
8522
9141
|
},
|
|
8523
9142
|
volume: {
|
|
8524
|
-
type: '
|
|
9143
|
+
type: 'string',
|
|
8525
9144
|
description: 'Day volume (Decimal string)',
|
|
8526
9145
|
nullable: true
|
|
8527
9146
|
},
|
|
8528
9147
|
yearHigh: {
|
|
8529
|
-
type: '
|
|
9148
|
+
type: 'string',
|
|
8530
9149
|
description: '52-week high (Decimal string)',
|
|
8531
9150
|
nullable: true
|
|
8532
9151
|
},
|
|
8533
9152
|
yearLow: {
|
|
8534
|
-
type: '
|
|
9153
|
+
type: 'string',
|
|
8535
9154
|
description: '52-week low (Decimal string)',
|
|
8536
9155
|
nullable: true
|
|
8537
9156
|
}
|