@firela/api-types 0.0.0-canary.54e42bbc → 0.0.0-canary.5580d446

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.
@@ -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: 'Localized display name (ADR-0114, read-time projection)',
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: 'object',
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: 'Short localized display name',
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: 'Account description (stable semantics only)',
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: 'Account tags for categorization',
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, raw Beancount sign). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.',
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/TransactionDetailDto'
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']
@@ -2340,10 +2563,10 @@ export const $UpdatePayeeDto = {
2340
2563
  meta: {
2341
2564
  type: 'object',
2342
2565
  description:
2343
- 'Metadata for extended information (location, notes, contact info, etc.). Will merge with existing metadata.',
2566
+ 'Metadata for extended information (location, notes, contact info, etc.)',
2344
2567
  example: {
2345
2568
  location: 'Zhongguancun',
2346
- note: 'Updated note',
2569
+ note: 'Near subway station',
2347
2570
  favorite: true
2348
2571
  }
2349
2572
  },
@@ -2904,568 +3127,660 @@ export const $UpdateCommodityDto = {
2904
3127
  }
2905
3128
  } as const;
2906
3129
 
2907
- export const $CreateBeanPriceDto = {
3130
+ export const $CurrencyBalanceDto = {
2908
3131
  type: 'object',
2909
3132
  properties: {
2910
3133
  currency: {
2911
3134
  type: 'string',
2912
- description: 'Currency being priced (e.g., USD, AAPL, BTC)',
2913
- example: 'USD'
2914
- },
2915
- quoteCurrency: {
2916
- type: 'string',
2917
- description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
3135
+ description: 'ISO 4217 currency code',
2918
3136
  example: 'CNY'
2919
3137
  },
2920
- amount: {
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: {
3138
+ balance: {
2928
3139
  type: 'string',
2929
- description: 'Price date (ISO 8601 format)',
2930
- example: '2024-11-05'
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
- }
3140
+ description: 'Balance amount',
3141
+ example: '500000.00'
2941
3142
  }
2942
3143
  },
2943
- required: ['currency', 'quoteCurrency', 'amount', 'date']
3144
+ required: ['currency', 'balance']
2944
3145
  } as const;
2945
3146
 
2946
- export const $PriceResponseDto = {
3147
+ export const $TimeSeriesPointDto = {
2947
3148
  type: 'object',
2948
3149
  properties: {
2949
- id: {
3150
+ date: {
2950
3151
  type: 'string',
2951
- description: 'Unique identifier',
2952
- example: 'uuid-123-456'
3152
+ description: 'Date in YYYY-MM-DD format',
3153
+ example: '2024-06-15'
2953
3154
  },
2954
- userId: {
3155
+ value: {
2955
3156
  type: 'string',
2956
- description: 'User ID (owner of the price)',
2957
- example: 'user-123'
3157
+ description: 'Value at this date (in base currency)',
3158
+ example: '500000.00'
2958
3159
  },
2959
- currency: {
3160
+ change: {
2960
3161
  type: 'string',
2961
- description: 'Currency being priced (e.g., USD, AAPL, BTC)',
2962
- example: 'BTC'
3162
+ description: 'Change from previous point',
3163
+ example: '5000.00'
2963
3164
  },
2964
- quoteCurrency: {
3165
+ assets: {
2965
3166
  type: 'string',
2966
- description: 'Quote currency (pricing currency, e.g., USD, CNY)',
2967
- example: 'USD'
3167
+ description: 'Total assets at this date (in base currency)',
3168
+ example: '494338.00'
2968
3169
  },
2969
- amount: {
2970
- type: 'number',
2971
- description:
2972
- 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
2973
- example: 50000
2974
- },
2975
- date: {
2976
- type: 'string',
2977
- description:
2978
- 'Price date (ISO 8601 format). Represents the date this price was valid.',
2979
- example: '2024-01-01',
2980
- format: 'date'
2981
- },
2982
- meta: {
2983
- type: 'object',
2984
- description:
2985
- 'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
2986
- example: {
2987
- source: 'MANUAL',
2988
- note: 'User-defined price',
2989
- confidence: 1
2990
- }
2991
- },
2992
- createdAt: {
2993
- format: 'date-time',
3170
+ liabilities: {
2994
3171
  type: 'string',
2995
- description: 'Creation timestamp',
2996
- example: '2024-11-03T10:00:00Z'
3172
+ description: 'Total liabilities at this date (in base currency)',
3173
+ example: '310098.00'
2997
3174
  },
2998
- updatedAt: {
2999
- format: 'date-time',
3000
- type: 'string',
3001
- description: 'Last update timestamp',
3002
- example: '2024-11-03T10:00:00Z'
3003
- }
3004
- },
3005
- required: [
3006
- 'id',
3007
- 'userId',
3008
- 'currency',
3009
- 'quoteCurrency',
3010
- 'amount',
3011
- 'date',
3012
- 'meta',
3013
- 'createdAt',
3014
- 'updatedAt'
3015
- ]
3016
- } as const;
3017
-
3018
- export const $PriceListResponseDto = {
3019
- type: 'object',
3020
- properties: {
3021
- items: {
3022
- description: 'List of prices',
3175
+ byCurrency: {
3176
+ description: 'Multi-currency breakdown for this point',
3023
3177
  type: 'array',
3024
3178
  items: {
3025
- $ref: '#/components/schemas/PriceResponseDto'
3179
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3026
3180
  }
3027
- },
3028
- total: {
3029
- type: 'number',
3030
- description: 'Total number of prices',
3031
- example: 42
3032
3181
  }
3033
3182
  },
3034
- required: ['items', 'total']
3183
+ required: ['date', 'value']
3035
3184
  } as const;
3036
3185
 
3037
- export const $UpdateBeanPriceDto = {
3186
+ export const $TrendSummaryDto = {
3038
3187
  type: 'object',
3039
3188
  properties: {
3040
- currency: {
3189
+ startValue: {
3041
3190
  type: 'string',
3042
- description: 'Currency being priced'
3191
+ description: 'Value at start of period',
3192
+ example: '450000.00'
3043
3193
  },
3044
- quoteCurrency: {
3194
+ endValue: {
3045
3195
  type: 'string',
3046
- description: 'Quote currency (pricing currency)'
3047
- },
3048
- amount: {
3049
- type: 'number',
3050
- description: 'Price amount (MUST be >= 0 per Beancount spec)',
3051
- minimum: 0
3196
+ description: 'Value at end of period',
3197
+ example: '500000.00'
3052
3198
  },
3053
- date: {
3199
+ totalChange: {
3054
3200
  type: 'string',
3055
- description: 'Price date (ISO 8601 format)'
3201
+ description: 'Total change over period',
3202
+ example: '50000.00'
3056
3203
  },
3057
- metadata: {
3058
- type: 'object',
3059
- description: 'Metadata'
3204
+ totalChangePercentage: {
3205
+ type: 'string',
3206
+ description: 'Total change percentage',
3207
+ example: '+11.11%'
3060
3208
  }
3061
- }
3209
+ },
3210
+ required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
3062
3211
  } as const;
3063
3212
 
3064
- export const $CreateRecurringRuleDto = {
3213
+ export const $MultiCurrencyPointDto = {
3065
3214
  type: 'object',
3066
3215
  properties: {
3067
- name: {
3216
+ date: {
3068
3217
  type: 'string',
3069
- description: 'Rule name (unique per user)',
3070
- maxLength: 100
3218
+ description: 'Date in YYYY-MM-DD format',
3219
+ example: '2024-06-15'
3071
3220
  },
3072
- icon: {
3073
- type: 'string',
3074
- description: 'Icon emoji',
3075
- maxLength: 10
3221
+ byCurrency: {
3222
+ description: 'Balances by currency',
3223
+ type: 'array',
3224
+ items: {
3225
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3226
+ }
3227
+ }
3228
+ },
3229
+ required: ['date', 'byCurrency']
3230
+ } as const;
3231
+
3232
+ export const $PortfolioTrendsResponseDto = {
3233
+ type: 'object',
3234
+ properties: {
3235
+ series: {
3236
+ description: 'Time series data points',
3237
+ type: 'array',
3238
+ items: {
3239
+ $ref: '#/components/schemas/TimeSeriesPointDto'
3240
+ }
3076
3241
  },
3077
- frequency: {
3078
- type: 'string',
3079
- description: 'Recurring frequency',
3080
- enum: [
3081
- 'WEEKLY',
3082
- 'BIWEEKLY',
3083
- 'MONTHLY',
3084
- 'BIMONTHLY',
3085
- 'QUARTERLY',
3086
- 'YEARLY',
3087
- 'CUSTOM'
3242
+ summary: {
3243
+ description: 'Period summary',
3244
+ allOf: [
3245
+ {
3246
+ $ref: '#/components/schemas/TrendSummaryDto'
3247
+ }
3088
3248
  ]
3089
3249
  },
3090
- expectedAmount: {
3091
- type: 'number',
3092
- description: 'Expected amount (positive number)',
3093
- minimum: 0
3094
- },
3095
- expectedDay: {
3096
- type: 'number',
3097
- description: 'Expected day of month (1-31)',
3098
- minimum: 1,
3099
- maximum: 31
3100
- },
3101
- customIntervalDays: {
3102
- type: 'number',
3103
- description: 'Custom interval in days (required for CUSTOM frequency)',
3104
- minimum: 1
3105
- },
3106
- currency: {
3250
+ period: {
3107
3251
  type: 'string',
3108
- description: 'Currency code',
3109
- default: 'CNY',
3110
- maxLength: 10
3252
+ description: 'Period requested',
3253
+ example: '6m'
3111
3254
  },
3112
- matchPayeePattern: {
3255
+ granularity: {
3113
3256
  type: 'string',
3114
- description: 'Payee matching pattern (supports wildcards)',
3115
- maxLength: 200
3116
- },
3117
- matchAmountTolerance: {
3118
- type: 'number',
3119
- description: 'Amount tolerance percentage (0-1)',
3120
- default: 0.075,
3121
- minimum: 0,
3122
- maximum: 1
3257
+ description: 'Data granularity',
3258
+ example: 'month'
3123
3259
  },
3124
- defaultExpenseAccount: {
3260
+ currency: {
3125
3261
  type: 'string',
3126
- description: 'Default expense account for auto-create',
3127
- maxLength: 200
3262
+ description: 'Base currency for converted values',
3263
+ example: 'CNY'
3128
3264
  },
3129
- defaultPaymentAccount: {
3130
- type: 'string',
3131
- description: 'Default payment account for auto-create',
3132
- maxLength: 200
3265
+ byCurrency: {
3266
+ description:
3267
+ 'Multi-currency time series (each point has currency breakdown)',
3268
+ type: 'array',
3269
+ items: {
3270
+ $ref: '#/components/schemas/MultiCurrencyPointDto'
3271
+ }
3133
3272
  },
3134
- defaultPayee: {
3273
+ warnings: {
3274
+ description: 'Exchange rate warnings',
3275
+ type: 'array',
3276
+ items: {
3277
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3278
+ }
3279
+ }
3280
+ },
3281
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3282
+ } as const;
3283
+
3284
+ export const $CashFlowPointDto = {
3285
+ type: 'object',
3286
+ properties: {
3287
+ month: {
3135
3288
  type: 'string',
3136
- description: 'Default payee for auto-create',
3137
- maxLength: 200
3289
+ description: 'Month key (YYYY-MM)',
3290
+ example: '2024-03'
3138
3291
  },
3139
- autoCreate: {
3140
- type: 'boolean',
3141
- description: 'Auto-create transaction when expected date arrives',
3142
- default: false
3292
+ income: {
3293
+ type: 'string',
3294
+ description: 'Income in base currency (absolute, converted)',
3295
+ example: '10000.00'
3143
3296
  },
3144
- startDate: {
3297
+ expense: {
3145
3298
  type: 'string',
3146
- description: 'Rule start date (ISO format)'
3299
+ description: 'Expense in base currency (absolute, converted)',
3300
+ example: '5000.00'
3147
3301
  },
3148
- endDate: {
3302
+ netSavings: {
3149
3303
  type: 'string',
3150
- description: 'Rule end date (ISO format)'
3304
+ description: 'netSavings = income − expense (savings positive)',
3305
+ example: '5000.00'
3151
3306
  }
3152
3307
  },
3153
- required: [
3154
- 'name',
3155
- 'frequency',
3156
- 'expectedAmount',
3157
- 'currency',
3158
- 'matchAmountTolerance',
3159
- 'autoCreate'
3160
- ]
3308
+ required: ['month', 'income', 'expense', 'netSavings']
3161
3309
  } as const;
3162
3310
 
3163
- export const $RecurringRuleResponseDto = {
3311
+ export const $CashFlowTrendSummaryDto = {
3164
3312
  type: 'object',
3165
3313
  properties: {
3166
- id: {
3314
+ totalIncome: {
3167
3315
  type: 'string',
3168
- description: 'Rule ID'
3316
+ description: 'Total income across the period',
3317
+ example: '60000.00'
3169
3318
  },
3170
- userId: {
3319
+ totalExpense: {
3171
3320
  type: 'string',
3172
- description: 'User ID'
3321
+ description: 'Total expense across the period',
3322
+ example: '30000.00'
3173
3323
  },
3174
- name: {
3324
+ totalNetSavings: {
3175
3325
  type: 'string',
3176
- description: 'Rule name'
3177
- },
3178
- icon: {
3179
- type: 'object',
3180
- description: 'Icon emoji'
3326
+ description: 'income − expense across the period',
3327
+ example: '30000.00'
3181
3328
  },
3182
- frequency: {
3329
+ averageMonthlyNetSavings: {
3183
3330
  type: 'string',
3184
- description: 'Recurring frequency'
3331
+ description:
3332
+ 'totalNetSavings divided by the window length (N months, incl. zero-filled)',
3333
+ example: '5000.00'
3334
+ }
3335
+ },
3336
+ required: [
3337
+ 'totalIncome',
3338
+ 'totalExpense',
3339
+ 'totalNetSavings',
3340
+ 'averageMonthlyNetSavings'
3341
+ ]
3342
+ } as const;
3343
+
3344
+ export const $CashFlowTrendsResponseDto = {
3345
+ type: 'object',
3346
+ properties: {
3347
+ series: {
3348
+ description:
3349
+ 'Monthly cash-flow series (fixed N-month window, zero-filled)',
3350
+ type: 'array',
3351
+ items: {
3352
+ $ref: '#/components/schemas/CashFlowPointDto'
3353
+ }
3185
3354
  },
3186
- expectedAmount: {
3187
- type: 'number',
3188
- description: 'Expected amount'
3355
+ summary: {
3356
+ description: 'Period totals',
3357
+ allOf: [
3358
+ {
3359
+ $ref: '#/components/schemas/CashFlowTrendSummaryDto'
3360
+ }
3361
+ ]
3189
3362
  },
3190
- expectedDay: {
3191
- type: 'object',
3192
- description: 'Expected day of month'
3363
+ period: {
3364
+ type: 'string',
3365
+ description: 'Period requested',
3366
+ example: '6m'
3193
3367
  },
3194
- customIntervalDays: {
3195
- type: 'object',
3196
- description: 'Custom interval in days'
3368
+ granularity: {
3369
+ type: 'string',
3370
+ description: 'Data granularity (v1 returns month buckets)',
3371
+ example: 'month'
3197
3372
  },
3198
3373
  currency: {
3199
3374
  type: 'string',
3200
- description: 'Currency code'
3375
+ description: 'Base currency for converted values',
3376
+ example: 'CNY'
3201
3377
  },
3202
- matchPayeePattern: {
3203
- type: 'object',
3204
- description: 'Payee matching pattern'
3378
+ warnings: {
3379
+ description: 'Exchange rate warnings (e.g. missing rate for a currency)',
3380
+ type: 'array',
3381
+ items: {
3382
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3383
+ }
3384
+ }
3385
+ },
3386
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3387
+ } as const;
3388
+
3389
+ export const $GenerateSnapshotBody = {
3390
+ type: 'object',
3391
+ properties: {}
3392
+ } as const;
3393
+
3394
+ export const $GenerateSnapshotResponse = {
3395
+ type: 'object',
3396
+ properties: {}
3397
+ } as const;
3398
+
3399
+ export const $BackfillSnapshotsBody = {
3400
+ type: 'object',
3401
+ properties: {}
3402
+ } as const;
3403
+
3404
+ export const $BackfillSnapshotsResponse = {
3405
+ type: 'object',
3406
+ properties: {}
3407
+ } as const;
3408
+
3409
+ export const $CreateBeanPriceDto = {
3410
+ type: 'object',
3411
+ properties: {
3412
+ currency: {
3413
+ type: 'string',
3414
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
3415
+ example: 'USD'
3205
3416
  },
3206
- matchAmountTolerance: {
3417
+ quoteCurrency: {
3418
+ type: 'string',
3419
+ description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
3420
+ example: 'CNY'
3421
+ },
3422
+ amount: {
3207
3423
  type: 'number',
3208
- description: 'Amount tolerance percentage'
3424
+ description:
3425
+ 'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
3426
+ example: 175.5,
3427
+ minimum: 0
3209
3428
  },
3210
- defaultExpenseAccount: {
3211
- type: 'object',
3212
- description: 'Default expense account'
3429
+ date: {
3430
+ type: 'string',
3431
+ description: 'Price date (ISO 8601 format)',
3432
+ example: '2024-11-05'
3213
3433
  },
3214
- defaultPaymentAccount: {
3434
+ metadata: {
3215
3435
  type: 'object',
3216
- description: 'Default payment account'
3436
+ description:
3437
+ 'Metadata (validated by Zod schema, max field lengths enforced)',
3438
+ example: {
3439
+ source: 'MANUAL',
3440
+ note: 'Bank valuation report',
3441
+ confidence: 0.95
3442
+ }
3443
+ }
3444
+ },
3445
+ required: ['currency', 'quoteCurrency', 'amount', 'date']
3446
+ } as const;
3447
+
3448
+ export const $PriceResponseDto = {
3449
+ type: 'object',
3450
+ properties: {
3451
+ id: {
3452
+ type: 'string',
3453
+ description: 'Unique identifier',
3454
+ example: 'uuid-123-456'
3217
3455
  },
3218
- defaultPayee: {
3219
- type: 'object',
3220
- description: 'Default payee'
3456
+ userId: {
3457
+ type: 'string',
3458
+ description: 'User ID (owner of the price)',
3459
+ example: 'user-123'
3221
3460
  },
3222
- isActive: {
3223
- type: 'boolean',
3224
- description: 'Whether rule is active'
3461
+ currency: {
3462
+ type: 'string',
3463
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
3464
+ example: 'BTC'
3225
3465
  },
3226
- startDate: {
3466
+ quoteCurrency: {
3227
3467
  type: 'string',
3228
- description: 'Rule start date (YYYY-MM-DD)'
3468
+ description: 'Quote currency (pricing currency, e.g., USD, CNY)',
3469
+ example: 'USD'
3229
3470
  },
3230
- endDate: {
3231
- type: 'object',
3232
- description: 'Rule end date (YYYY-MM-DD)'
3471
+ amount: {
3472
+ type: 'number',
3473
+ description:
3474
+ 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
3475
+ example: 50000
3233
3476
  },
3234
- autoCreate: {
3235
- type: 'boolean',
3236
- description: 'Auto-create transaction on expected date'
3477
+ date: {
3478
+ type: 'string',
3479
+ description:
3480
+ 'Price date (ISO 8601 format). Represents the date this price was valid.',
3481
+ example: '2024-01-01',
3482
+ format: 'date'
3237
3483
  },
3238
- lastOccurrence: {
3484
+ meta: {
3239
3485
  type: 'object',
3240
- description: 'Last matched occurrence date (YYYY-MM-DD)'
3241
- },
3242
- totalCount: {
3243
- type: 'number',
3244
- description: 'Total matched transactions count'
3486
+ description:
3487
+ 'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
3488
+ example: {
3489
+ source: 'MANUAL',
3490
+ note: 'User-defined price',
3491
+ confidence: 1
3492
+ }
3245
3493
  },
3246
3494
  createdAt: {
3247
3495
  format: 'date-time',
3248
3496
  type: 'string',
3249
- description: 'Created at timestamp'
3497
+ description: 'Creation timestamp',
3498
+ example: '2024-11-03T10:00:00Z'
3250
3499
  },
3251
3500
  updatedAt: {
3252
3501
  format: 'date-time',
3253
3502
  type: 'string',
3254
- description: 'Updated at timestamp'
3503
+ description: 'Last update timestamp',
3504
+ example: '2024-11-03T10:00:00Z'
3255
3505
  }
3256
3506
  },
3257
3507
  required: [
3258
3508
  'id',
3259
3509
  'userId',
3260
- 'name',
3261
- 'frequency',
3262
- 'expectedAmount',
3263
3510
  'currency',
3264
- 'matchAmountTolerance',
3265
- 'isActive',
3266
- 'startDate',
3267
- 'autoCreate',
3268
- 'totalCount',
3511
+ 'quoteCurrency',
3512
+ 'amount',
3513
+ 'date',
3514
+ 'meta',
3269
3515
  'createdAt',
3270
3516
  'updatedAt'
3271
3517
  ]
3272
3518
  } as const;
3273
3519
 
3274
- export const $CreateRuleFromTransactionDto = {
3520
+ export const $PriceListResponseDto = {
3275
3521
  type: 'object',
3276
3522
  properties: {
3277
- frequency: {
3278
- type: 'string',
3279
- description: 'Recurring frequency',
3280
- enum: [
3281
- 'WEEKLY',
3282
- 'BIWEEKLY',
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
3523
+ items: {
3524
+ description: 'List of prices',
3525
+ type: 'array',
3526
+ items: {
3527
+ $ref: '#/components/schemas/PriceResponseDto'
3528
+ }
3295
3529
  },
3296
- icon: {
3297
- type: 'string',
3298
- description: 'Optional icon emoji',
3299
- maxLength: 10
3530
+ total: {
3531
+ type: 'number',
3532
+ description: 'Total number of prices',
3533
+ example: 42
3300
3534
  }
3301
3535
  },
3302
- required: ['frequency']
3536
+ required: ['items', 'total']
3303
3537
  } as const;
3304
3538
 
3305
- export const $RecurringRuleWithStatsResponseDto = {
3539
+ export const $UpdateBeanPriceDto = {
3306
3540
  type: 'object',
3307
3541
  properties: {
3308
- id: {
3542
+ currency: {
3309
3543
  type: 'string',
3310
- description: 'Rule ID'
3544
+ description: 'Currency being priced'
3311
3545
  },
3312
- userId: {
3546
+ quoteCurrency: {
3313
3547
  type: 'string',
3314
- description: 'User ID'
3548
+ description: 'Quote currency (pricing currency)'
3315
3549
  },
3316
- name: {
3550
+ amount: {
3551
+ type: 'number',
3552
+ description: 'Price amount (MUST be >= 0 per Beancount spec)',
3553
+ minimum: 0
3554
+ },
3555
+ date: {
3317
3556
  type: 'string',
3318
- description: 'Rule name'
3557
+ description: 'Price date (ISO 8601 format)'
3319
3558
  },
3320
- icon: {
3559
+ metadata: {
3321
3560
  type: 'object',
3322
- description: 'Icon emoji'
3323
- },
3324
- frequency: {
3561
+ description: 'Metadata'
3562
+ }
3563
+ }
3564
+ } as const;
3565
+
3566
+ export const $DeleteOwnUserDto = {
3567
+ type: 'object',
3568
+ properties: {
3569
+ accessToken: {
3325
3570
  type: 'string',
3326
- description: 'Recurring frequency'
3327
- },
3328
- expectedAmount: {
3329
- type: 'number',
3330
- description: 'Expected amount'
3571
+ description: 'Access token for user verification',
3572
+ example: 'abc123xyz'
3573
+ }
3574
+ },
3575
+ required: ['accessToken']
3576
+ } as const;
3577
+
3578
+ export const $UserSettingsResponseDto = {
3579
+ type: 'object',
3580
+ properties: {
3581
+ baseCurrency: {
3582
+ type: 'string',
3583
+ description:
3584
+ '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).',
3585
+ example: 'USD',
3586
+ nullable: true
3587
+ }
3588
+ },
3589
+ required: ['baseCurrency']
3590
+ } as const;
3591
+
3592
+ export const $UserResponseDto = {
3593
+ type: 'object',
3594
+ properties: {
3595
+ id: {
3596
+ type: 'string',
3597
+ description: 'User ID'
3331
3598
  },
3332
- expectedDay: {
3333
- type: 'object',
3334
- description: 'Expected day of month'
3599
+ role: {
3600
+ type: 'string',
3601
+ description: 'Assigned user role'
3335
3602
  },
3336
- customIntervalDays: {
3337
- type: 'object',
3338
- description: 'Custom interval in days'
3603
+ permissions: {
3604
+ description: 'Permission strings',
3605
+ type: 'array',
3606
+ items: {
3607
+ type: 'string'
3608
+ }
3339
3609
  },
3340
- currency: {
3610
+ settings: {
3611
+ description: 'User settings',
3612
+ allOf: [
3613
+ {
3614
+ $ref: '#/components/schemas/UserSettingsResponseDto'
3615
+ }
3616
+ ]
3617
+ }
3618
+ },
3619
+ required: ['id', 'role', 'permissions', 'settings']
3620
+ } as const;
3621
+
3622
+ export const $SignupDto = {
3623
+ type: 'object',
3624
+ properties: {
3625
+ turnstileToken: {
3341
3626
  type: 'string',
3342
- description: 'Currency code'
3627
+ description:
3628
+ 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
3629
+ example: '0.abc123def456...'
3630
+ }
3631
+ }
3632
+ } as const;
3633
+
3634
+ export const $SignupResponseDto = {
3635
+ type: 'object',
3636
+ properties: {
3637
+ authToken: {
3638
+ type: 'string',
3639
+ description: 'JWT auth token',
3640
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
3343
3641
  },
3344
- matchPayeePattern: {
3345
- type: 'object',
3346
- description: 'Payee matching pattern'
3642
+ accessToken: {
3643
+ type: 'string',
3644
+ description: 'Auto-generated access token'
3347
3645
  },
3348
- matchAmountTolerance: {
3646
+ role: {
3647
+ type: 'string',
3648
+ description: 'Assigned user role',
3649
+ enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
3650
+ }
3651
+ },
3652
+ required: ['authToken', 'accessToken', 'role']
3653
+ } as const;
3654
+
3655
+ export const $UpdateUserSettingDto = {
3656
+ type: 'object',
3657
+ properties: {
3658
+ secId: {
3349
3659
  type: 'number',
3350
- description: 'Amount tolerance percentage'
3660
+ description: 'Security ID'
3351
3661
  },
3352
- defaultExpenseAccount: {
3353
- type: 'object',
3354
- description: 'Default expense account'
3662
+ annualInterestRate: {
3663
+ type: 'number',
3664
+ description: 'Annual interest rate',
3665
+ example: 0.05
3355
3666
  },
3356
- defaultPaymentAccount: {
3357
- type: 'object',
3358
- description: 'Default payment account'
3667
+ currency: {
3668
+ type: 'string',
3669
+ description: 'Currency code',
3670
+ example: 'USD'
3359
3671
  },
3360
- defaultPayee: {
3361
- type: 'object',
3362
- description: 'Default payee'
3672
+ baseCurrency: {
3673
+ type: 'string',
3674
+ description: 'Base currency code',
3675
+ example: 'USD'
3363
3676
  },
3364
- isActive: {
3365
- type: 'boolean',
3366
- description: 'Whether rule is active'
3677
+ benchmark: {
3678
+ type: 'string',
3679
+ description: 'Benchmark symbol',
3680
+ example: 'SPY'
3367
3681
  },
3368
- startDate: {
3682
+ colorScheme: {
3369
3683
  type: 'string',
3370
- description: 'Rule start date (YYYY-MM-DD)'
3684
+ description: 'Color scheme',
3685
+ enum: ['DARK', 'LIGHT']
3371
3686
  },
3372
- endDate: {
3373
- type: 'object',
3374
- description: 'Rule end date (YYYY-MM-DD)'
3687
+ dateRange: {
3688
+ type: 'string',
3689
+ description: 'Date range filter',
3690
+ example: '1y'
3375
3691
  },
3376
- autoCreate: {
3377
- type: 'boolean',
3378
- description: 'Auto-create transaction on expected date'
3692
+ emergencyFund: {
3693
+ type: 'number',
3694
+ description: 'Emergency fund amount',
3695
+ example: 10000
3379
3696
  },
3380
- lastOccurrence: {
3381
- type: 'object',
3382
- description: 'Last matched occurrence date (YYYY-MM-DD)'
3697
+ 'filters.accounts': {
3698
+ description: 'Account filter IDs',
3699
+ type: 'array',
3700
+ items: {
3701
+ type: 'string'
3702
+ }
3383
3703
  },
3384
- totalCount: {
3385
- type: 'number',
3386
- description: 'Total matched transactions count'
3704
+ 'filters.assetClasses': {
3705
+ description: 'Asset class filters',
3706
+ type: 'array',
3707
+ items: {
3708
+ type: 'string'
3709
+ }
3387
3710
  },
3388
- createdAt: {
3389
- format: 'date-time',
3711
+ 'filters.dataSource': {
3390
3712
  type: 'string',
3391
- description: 'Created at timestamp'
3713
+ description: 'Data source filter'
3392
3714
  },
3393
- updatedAt: {
3394
- format: 'date-time',
3715
+ 'filters.symbol': {
3395
3716
  type: 'string',
3396
- description: 'Updated at timestamp'
3717
+ description: 'Symbol filter'
3397
3718
  },
3398
- pendingCount: {
3399
- type: 'number',
3400
- description: 'Number of pending expected transactions'
3719
+ 'filters.tags': {
3720
+ description: 'Tag filters',
3721
+ type: 'array',
3722
+ items: {
3723
+ type: 'string'
3724
+ }
3401
3725
  },
3402
- overdueCount: {
3403
- type: 'number',
3404
- description: 'Number of overdue expected transactions'
3726
+ isExperimentalFeatures: {
3727
+ type: 'boolean',
3728
+ description: 'Enable experimental features'
3405
3729
  },
3406
- nextExpectedDate: {
3407
- type: 'object',
3408
- description: 'Next expected date (YYYY-MM-DD)'
3730
+ isRestrictedView: {
3731
+ type: 'boolean',
3732
+ description: 'Enable restricted view mode'
3409
3733
  },
3410
- totalAmount: {
3411
- type: 'number',
3412
- description: 'Total amount of all matched transactions'
3734
+ language: {
3735
+ type: 'string',
3736
+ description: 'Language code',
3737
+ example: 'en'
3413
3738
  },
3414
- averageAmount: {
3415
- type: 'number',
3416
- description: 'Average amount per transaction'
3739
+ locale: {
3740
+ type: 'string',
3741
+ description: 'Locale code',
3742
+ example: 'en-US'
3417
3743
  },
3418
- transactionCount: {
3744
+ projectedTotalAmount: {
3419
3745
  type: 'number',
3420
- description: 'Number of matched transactions'
3421
- },
3422
- firstDate: {
3423
- type: 'object',
3424
- description: 'First matched transaction date (YYYY-MM-DD)'
3746
+ description: 'Projected total amount',
3747
+ example: 1000000
3425
3748
  },
3426
- lastDate: {
3427
- type: 'object',
3428
- description: 'Last matched transaction date (YYYY-MM-DD)'
3749
+ retirementDate: {
3750
+ type: 'string',
3751
+ description: 'Retirement date in ISO 8601 format',
3752
+ example: '2050-01-01'
3429
3753
  },
3430
- variance: {
3754
+ savingsRate: {
3431
3755
  type: 'number',
3432
- description: 'Amount variance (standard deviation squared)'
3756
+ description: 'Savings rate percentage',
3757
+ example: 0.2
3433
3758
  },
3434
- upcomingCount: {
3435
- type: 'number',
3436
- description: 'Number of upcoming expected transactions'
3759
+ viewMode: {
3760
+ type: 'string',
3761
+ description: 'View mode',
3762
+ enum: ['DEFAULT', 'ZEN']
3763
+ }
3764
+ }
3765
+ } as const;
3766
+
3767
+ export const $UpdatePropertyDto = {
3768
+ type: 'object',
3769
+ properties: {
3770
+ value: {
3771
+ type: 'string',
3772
+ description: 'Property value'
3437
3773
  }
3438
3774
  },
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
- ]
3775
+ required: ['value']
3461
3776
  } as const;
3462
3777
 
3463
- export const $UpdateRecurringRuleDto = {
3778
+ export const $CreateRecurringRuleDto = {
3464
3779
  type: 'object',
3465
3780
  properties: {
3466
3781
  name: {
3467
3782
  type: 'string',
3468
- description: 'Rule name',
3783
+ description: 'Rule name (unique per user)',
3469
3784
  maxLength: 100
3470
3785
  },
3471
3786
  icon: {
@@ -3488,7 +3803,7 @@ export const $UpdateRecurringRuleDto = {
3488
3803
  },
3489
3804
  expectedAmount: {
3490
3805
  type: 'number',
3491
- description: 'Expected amount',
3806
+ description: 'Expected amount (positive number)',
3492
3807
  minimum: 0
3493
3808
  },
3494
3809
  expectedDay: {
@@ -3499,7 +3814,7 @@ export const $UpdateRecurringRuleDto = {
3499
3814
  },
3500
3815
  customIntervalDays: {
3501
3816
  type: 'number',
3502
- description: 'Custom interval in days',
3817
+ description: 'Custom interval in days (required for CUSTOM frequency)',
3503
3818
  minimum: 1
3504
3819
  },
3505
3820
  currency: {
@@ -3509,818 +3824,726 @@ export const $UpdateRecurringRuleDto = {
3509
3824
  },
3510
3825
  matchPayeePattern: {
3511
3826
  type: 'string',
3512
- description: 'Payee matching pattern',
3827
+ description: 'Payee matching pattern (supports wildcards)',
3513
3828
  maxLength: 200
3514
3829
  },
3515
3830
  matchAmountTolerance: {
3516
3831
  type: 'number',
3517
3832
  description: 'Amount tolerance percentage (0-1)',
3833
+ default: 0.075,
3518
3834
  minimum: 0,
3519
3835
  maximum: 1
3520
3836
  },
3521
3837
  defaultExpenseAccount: {
3522
3838
  type: 'string',
3523
- description: 'Default expense account',
3839
+ description: 'Default expense account for auto-create',
3524
3840
  maxLength: 200
3525
3841
  },
3526
3842
  defaultPaymentAccount: {
3527
3843
  type: 'string',
3528
- description: 'Default payment account',
3844
+ description: 'Default payment account for auto-create',
3529
3845
  maxLength: 200
3530
3846
  },
3531
3847
  defaultPayee: {
3532
3848
  type: 'string',
3533
- description: 'Default payee',
3849
+ description: 'Default payee for auto-create',
3534
3850
  maxLength: 200
3535
3851
  },
3536
3852
  autoCreate: {
3537
3853
  type: 'boolean',
3538
- description: 'Auto-create transaction'
3854
+ description: 'Auto-create transaction when expected date arrives',
3855
+ default: false
3539
3856
  },
3540
- isActive: {
3541
- type: 'boolean',
3542
- description: 'Rule active status'
3857
+ startDate: {
3858
+ type: 'string',
3859
+ description: 'Rule start date (ISO format)'
3543
3860
  },
3544
3861
  endDate: {
3545
3862
  type: 'string',
3546
3863
  description: 'Rule end date (ISO format)'
3547
3864
  }
3548
- }
3549
- } as const;
3550
-
3551
- export const $ExpectedTransactionRuleDto = {
3552
- type: 'object',
3553
- properties: {
3554
- name: {
3555
- type: 'string',
3556
- description: 'Rule name'
3557
- },
3558
- icon: {
3559
- type: 'object',
3560
- description: 'Rule icon'
3561
- },
3562
- frequency: {
3563
- type: 'string',
3564
- description: 'Rule frequency'
3565
- },
3566
- currency: {
3567
- type: 'string',
3568
- description: 'Currency code'
3569
- }
3570
3865
  },
3571
- required: ['name', 'frequency', 'currency']
3866
+ required: [
3867
+ 'name',
3868
+ 'frequency',
3869
+ 'expectedAmount',
3870
+ 'matchAmountTolerance',
3871
+ 'autoCreate'
3872
+ ]
3572
3873
  } as const;
3573
3874
 
3574
- export const $ExpectedTransactionResponseDto = {
3875
+ export const $RecurringRuleResponseDto = {
3575
3876
  type: 'object',
3576
3877
  properties: {
3577
3878
  id: {
3578
3879
  type: 'string',
3579
- description: 'Expected transaction ID'
3880
+ description: 'Rule ID'
3580
3881
  },
3581
3882
  userId: {
3582
3883
  type: 'string',
3583
3884
  description: 'User ID'
3584
3885
  },
3585
- ruleId: {
3886
+ name: {
3586
3887
  type: 'string',
3587
- description: 'Associated rule ID'
3888
+ description: 'Rule name'
3588
3889
  },
3589
- expectedDate: {
3890
+ icon: {
3590
3891
  type: 'string',
3591
- description: 'Expected date (YYYY-MM-DD)'
3892
+ description: 'Icon emoji'
3893
+ },
3894
+ frequency: {
3895
+ type: 'string',
3896
+ description: 'Recurring frequency'
3592
3897
  },
3593
3898
  expectedAmount: {
3594
3899
  type: 'number',
3595
3900
  description: 'Expected amount'
3596
3901
  },
3597
- status: {
3598
- type: 'string',
3599
- description: 'Status (PENDING, COMPLETED, SKIPPED)'
3902
+ expectedDay: {
3903
+ type: 'number',
3904
+ description: 'Expected day of month'
3600
3905
  },
3601
- matchedTransactionId: {
3602
- type: 'object',
3603
- description: 'Matched transaction ID'
3906
+ customIntervalDays: {
3907
+ type: 'number',
3908
+ description: 'Custom interval in days'
3604
3909
  },
3605
- matchedAt: {
3606
- type: 'object',
3607
- description: 'Match timestamp (ISO 8601)'
3910
+ currency: {
3911
+ type: 'string',
3912
+ description: 'Currency code'
3608
3913
  },
3609
- matchConfidence: {
3610
- type: 'object',
3611
- description: 'Match confidence score (0-1)'
3914
+ matchPayeePattern: {
3915
+ type: 'string',
3916
+ description: 'Payee matching pattern'
3612
3917
  },
3613
- isOverdue: {
3614
- type: 'boolean',
3615
- description: 'Whether this expected transaction is overdue'
3918
+ matchAmountTolerance: {
3919
+ type: 'number',
3920
+ description: 'Amount tolerance percentage'
3616
3921
  },
3617
- rule: {
3618
- description: 'Rule information',
3619
- allOf: [
3620
- {
3621
- $ref: '#/components/schemas/ExpectedTransactionRuleDto'
3622
- }
3623
- ]
3922
+ defaultExpenseAccount: {
3923
+ type: 'string',
3924
+ description: 'Default expense account'
3624
3925
  },
3625
- createdAt: {
3626
- format: 'date-time',
3926
+ defaultPaymentAccount: {
3627
3927
  type: 'string',
3628
- description: 'Created at timestamp'
3928
+ description: 'Default payment account'
3629
3929
  },
3630
- updatedAt: {
3631
- format: 'date-time',
3930
+ defaultPayee: {
3632
3931
  type: 'string',
3633
- description: 'Updated at timestamp'
3634
- }
3635
- },
3636
- required: [
3637
- 'id',
3638
- 'userId',
3639
- 'ruleId',
3640
- 'expectedDate',
3641
- 'expectedAmount',
3642
- 'status',
3643
- 'isOverdue',
3644
- 'rule',
3645
- 'createdAt',
3646
- 'updatedAt'
3647
- ]
3648
- } as const;
3649
-
3650
- export const $ExpectedTransactionListResponseDto = {
3651
- type: 'object',
3652
- properties: {
3653
- items: {
3654
- type: 'array',
3655
- items: {
3656
- $ref: '#/components/schemas/ExpectedTransactionResponseDto'
3657
- }
3932
+ description: 'Default payee'
3658
3933
  },
3659
- total: {
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: {
3934
+ isActive: {
3935
+ type: 'boolean',
3936
+ description: 'Whether rule is active'
3937
+ },
3938
+ startDate: {
3671
3939
  type: 'string',
3672
- description: 'Transaction ID to match with'
3673
- }
3674
- },
3675
- required: ['transactionId']
3676
- } as const;
3677
-
3678
- export const $EnterNowDto = {
3679
- type: 'object',
3680
- properties: {
3681
- expenseAccount: {
3940
+ description: 'Rule start date (YYYY-MM-DD)'
3941
+ },
3942
+ endDate: {
3682
3943
  type: 'string',
3683
- description:
3684
- 'Override expense account (uses rule default if not provided)',
3685
- maxLength: 200
3944
+ description: 'Rule end date (YYYY-MM-DD)'
3686
3945
  },
3687
- paymentAccount: {
3946
+ autoCreate: {
3947
+ type: 'boolean',
3948
+ description: 'Auto-create transaction on expected date'
3949
+ },
3950
+ lastOccurrence: {
3688
3951
  type: 'string',
3689
- description:
3690
- 'Override payment account (uses rule default if not provided)',
3691
- maxLength: 200
3952
+ description: 'Last matched occurrence date (YYYY-MM-DD)'
3692
3953
  },
3693
- amount: {
3954
+ totalCount: {
3694
3955
  type: 'number',
3695
- description: 'Override amount (uses expected amount if not provided)',
3696
- minimum: 0
3956
+ description: 'Total matched transactions count'
3697
3957
  },
3698
- payee: {
3958
+ createdAt: {
3959
+ format: 'date-time',
3699
3960
  type: 'string',
3700
- description: 'Override payee (uses rule default if not provided)',
3701
- maxLength: 200
3961
+ description: 'Created at timestamp'
3702
3962
  },
3703
- narration: {
3963
+ updatedAt: {
3964
+ format: 'date-time',
3704
3965
  type: 'string',
3705
- description: 'Optional narration',
3706
- maxLength: 500
3966
+ description: 'Updated at timestamp'
3707
3967
  }
3708
- }
3968
+ },
3969
+ required: [
3970
+ 'id',
3971
+ 'userId',
3972
+ 'name',
3973
+ 'frequency',
3974
+ 'expectedAmount',
3975
+ 'currency',
3976
+ 'matchAmountTolerance',
3977
+ 'isActive',
3978
+ 'startDate',
3979
+ 'autoCreate',
3980
+ 'totalCount',
3981
+ 'createdAt',
3982
+ 'updatedAt'
3983
+ ]
3709
3984
  } as const;
3710
3985
 
3711
- export const $ForecastItemDto = {
3986
+ export const $CreateRuleFromTransactionDto = {
3712
3987
  type: 'object',
3713
3988
  properties: {
3714
- rule: {
3715
- type: 'string',
3716
- description: 'Rule name',
3717
- example: 'Rent'
3718
- },
3719
- ruleId: {
3989
+ frequency: {
3720
3990
  type: 'string',
3721
- description: 'Rule ID',
3722
- example: 'clx123...'
3723
- },
3724
- amount: {
3725
- type: 'number',
3726
- description: 'Expected amount',
3727
- example: 3000
3991
+ description: 'Recurring frequency',
3992
+ enum: [
3993
+ 'WEEKLY',
3994
+ 'BIWEEKLY',
3995
+ 'MONTHLY',
3996
+ 'BIMONTHLY',
3997
+ 'QUARTERLY',
3998
+ 'YEARLY',
3999
+ 'CUSTOM'
4000
+ ],
4001
+ example: 'MONTHLY'
3728
4002
  },
3729
- date: {
4003
+ name: {
3730
4004
  type: 'string',
3731
- description: 'Expected date (YYYY-MM-DD)',
3732
- example: '2024-04-01'
4005
+ description: 'Optional name override (default: transaction payee)',
4006
+ maxLength: 100
3733
4007
  },
3734
4008
  icon: {
3735
4009
  type: 'string',
3736
- description: 'Rule icon emoji',
3737
- example: '🏠',
3738
- nullable: true
3739
- },
3740
- currency: {
3741
- type: 'string',
3742
- description: 'Currency code',
3743
- example: 'CNY'
4010
+ description: 'Optional icon emoji',
4011
+ maxLength: 10
3744
4012
  }
3745
4013
  },
3746
- required: ['rule', 'ruleId', 'amount', 'date', 'icon', 'currency']
4014
+ required: ['frequency']
3747
4015
  } as const;
3748
4016
 
3749
- export const $MonthlyForecastDto = {
4017
+ export const $RecurringRuleWithStatsResponseDto = {
3750
4018
  type: 'object',
3751
4019
  properties: {
3752
- month: {
4020
+ id: {
3753
4021
  type: 'string',
3754
- description: 'Month (YYYY-MM)',
3755
- example: '2024-04'
4022
+ description: 'Rule ID'
3756
4023
  },
3757
- expectedOutflow: {
3758
- type: 'number',
3759
- description: 'Total expected outflow for the month',
3760
- example: 8500
4024
+ userId: {
4025
+ type: 'string',
4026
+ description: 'User ID'
3761
4027
  },
3762
- itemCount: {
3763
- type: 'number',
3764
- description: 'Number of expected transactions',
3765
- example: 3
4028
+ name: {
4029
+ type: 'string',
4030
+ description: 'Rule name'
3766
4031
  },
3767
- byCurrency: {
3768
- type: 'object',
3769
- description: 'Breakdown by currency',
3770
- example: {
3771
- CNY: 8500,
3772
- USD: 100
3773
- }
4032
+ icon: {
4033
+ type: 'string',
4034
+ description: 'Icon emoji'
3774
4035
  },
3775
- items: {
3776
- description: 'Individual forecast items',
3777
- type: 'array',
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
- }
4036
+ frequency: {
4037
+ type: 'string',
4038
+ description: 'Recurring frequency'
3795
4039
  },
3796
- totalOutflow: {
4040
+ expectedAmount: {
3797
4041
  type: 'number',
3798
- description: 'Total expected outflow across all months',
3799
- example: 25500
4042
+ description: 'Expected amount'
3800
4043
  },
3801
- totalByCurrency: {
3802
- type: 'object',
3803
- description: 'Total by currency across all months',
3804
- example: {
3805
- CNY: 25500,
3806
- USD: 300
3807
- }
4044
+ expectedDay: {
4045
+ type: 'number',
4046
+ description: 'Expected day of month'
3808
4047
  },
3809
- rulesCount: {
4048
+ customIntervalDays: {
3810
4049
  type: 'number',
3811
- description: 'Number of active recurring rules included',
3812
- example: 5
4050
+ description: 'Custom interval in days'
3813
4051
  },
3814
- periodStart: {
4052
+ currency: {
3815
4053
  type: 'string',
3816
- description: 'Forecast period start date',
3817
- example: '2024-04-01'
4054
+ description: 'Currency code'
3818
4055
  },
3819
- periodEnd: {
3820
- type: 'string',
3821
- description: 'Forecast period end date',
3822
- example: '2024-06-30'
3823
- }
3824
- },
3825
- required: [
3826
- 'forecast',
3827
- 'totalOutflow',
3828
- 'totalByCurrency',
3829
- 'rulesCount',
3830
- 'periodStart',
3831
- 'periodEnd'
3832
- ]
3833
- } as const;
3834
-
3835
- export const $CurrencyBalanceDto = {
3836
- type: 'object',
3837
- properties: {
3838
- currency: {
4056
+ matchPayeePattern: {
3839
4057
  type: 'string',
3840
- description: 'ISO 4217 currency code',
3841
- example: 'CNY'
4058
+ description: 'Payee matching pattern'
3842
4059
  },
3843
- balance: {
4060
+ matchAmountTolerance: {
4061
+ type: 'number',
4062
+ description: 'Amount tolerance percentage'
4063
+ },
4064
+ defaultExpenseAccount: {
3844
4065
  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: {
4066
+ description: 'Default expense account'
4067
+ },
4068
+ defaultPaymentAccount: {
3856
4069
  type: 'string',
3857
- description: 'Date in YYYY-MM-DD format',
3858
- example: '2024-06-15'
4070
+ description: 'Default payment account'
3859
4071
  },
3860
- value: {
4072
+ defaultPayee: {
3861
4073
  type: 'string',
3862
- description: 'Value at this date (in base currency)',
3863
- example: '500000.00'
4074
+ description: 'Default payee'
3864
4075
  },
3865
- change: {
3866
- type: 'object',
3867
- description: 'Change from previous point',
3868
- example: '5000.00'
4076
+ isActive: {
4077
+ type: 'boolean',
4078
+ description: 'Whether rule is active'
3869
4079
  },
3870
- assets: {
4080
+ startDate: {
3871
4081
  type: 'string',
3872
- description: 'Total assets at this date (in base currency)',
3873
- example: '494338.00'
4082
+ description: 'Rule start date (YYYY-MM-DD)'
3874
4083
  },
3875
- liabilities: {
4084
+ endDate: {
3876
4085
  type: 'string',
3877
- description: 'Total liabilities at this date (in base currency)',
3878
- example: '310098.00'
4086
+ description: 'Rule end date (YYYY-MM-DD)'
3879
4087
  },
3880
- byCurrency: {
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: {
3895
- type: 'string',
3896
- description: 'Value at start of period',
3897
- example: '450000.00'
4088
+ autoCreate: {
4089
+ type: 'boolean',
4090
+ description: 'Auto-create transaction on expected date'
3898
4091
  },
3899
- endValue: {
4092
+ lastOccurrence: {
3900
4093
  type: 'string',
3901
- description: 'Value at end of period',
3902
- example: '500000.00'
4094
+ description: 'Last matched occurrence date (YYYY-MM-DD)'
3903
4095
  },
3904
- totalChange: {
3905
- type: 'string',
3906
- description: 'Total change over period',
3907
- example: '50000.00'
4096
+ totalCount: {
4097
+ type: 'number',
4098
+ description: 'Total matched transactions count'
3908
4099
  },
3909
- totalChangePercentage: {
4100
+ createdAt: {
4101
+ format: 'date-time',
3910
4102
  type: 'string',
3911
- description: 'Total change percentage',
3912
- example: '+11.11%'
3913
- }
3914
- },
3915
- required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
3916
- } as const;
3917
-
3918
- export const $MultiCurrencyPointDto = {
3919
- type: 'object',
3920
- properties: {
3921
- date: {
4103
+ description: 'Created at timestamp'
4104
+ },
4105
+ updatedAt: {
4106
+ format: 'date-time',
3922
4107
  type: 'string',
3923
- description: 'Date in YYYY-MM-DD format',
3924
- example: '2024-06-15'
4108
+ description: 'Updated at timestamp'
3925
4109
  },
3926
- byCurrency: {
3927
- description: 'Balances by currency',
3928
- type: 'array',
3929
- items: {
3930
- $ref: '#/components/schemas/CurrencyBalanceDto'
3931
- }
3932
- }
3933
- },
3934
- required: ['date', 'byCurrency']
3935
- } as const;
3936
-
3937
- export const $PortfolioTrendsResponseDto = {
3938
- type: 'object',
3939
- properties: {
3940
- series: {
3941
- description: 'Time series data points',
3942
- type: 'array',
3943
- items: {
3944
- $ref: '#/components/schemas/TimeSeriesPointDto'
3945
- }
4110
+ pendingCount: {
4111
+ type: 'number',
4112
+ description: 'Number of pending expected transactions'
3946
4113
  },
3947
- summary: {
3948
- description: 'Period summary',
3949
- allOf: [
3950
- {
3951
- $ref: '#/components/schemas/TrendSummaryDto'
3952
- }
3953
- ]
4114
+ overdueCount: {
4115
+ type: 'number',
4116
+ description: 'Number of overdue expected transactions'
3954
4117
  },
3955
- period: {
4118
+ nextExpectedDate: {
3956
4119
  type: 'string',
3957
- description: 'Period requested',
3958
- example: '6m'
4120
+ description: 'Next expected date (YYYY-MM-DD)'
3959
4121
  },
3960
- granularity: {
4122
+ totalAmount: {
4123
+ type: 'number',
4124
+ description: 'Total amount of all matched transactions'
4125
+ },
4126
+ averageAmount: {
4127
+ type: 'number',
4128
+ description: 'Average amount per transaction'
4129
+ },
4130
+ transactionCount: {
4131
+ type: 'number',
4132
+ description: 'Number of matched transactions'
4133
+ },
4134
+ firstDate: {
3961
4135
  type: 'string',
3962
- description: 'Data granularity',
3963
- example: 'month'
4136
+ description: 'First matched transaction date (YYYY-MM-DD)'
3964
4137
  },
3965
- currency: {
4138
+ lastDate: {
3966
4139
  type: 'string',
3967
- description: 'Base currency for converted values',
3968
- example: 'CNY'
4140
+ description: 'Last matched transaction date (YYYY-MM-DD)'
3969
4141
  },
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
- }
4142
+ variance: {
4143
+ type: 'number',
4144
+ description: 'Amount variance (standard deviation squared)'
3977
4145
  },
3978
- warnings: {
3979
- description: 'Exchange rate warnings',
3980
- type: 'array',
3981
- items: {
3982
- $ref: '#/components/schemas/ExchangeRateWarningDto'
3983
- }
4146
+ upcomingCount: {
4147
+ type: 'number',
4148
+ description: 'Number of upcoming expected transactions'
3984
4149
  }
3985
4150
  },
3986
- required: ['series', 'summary', 'period', 'granularity', 'currency']
4151
+ required: [
4152
+ 'id',
4153
+ 'userId',
4154
+ 'name',
4155
+ 'frequency',
4156
+ 'expectedAmount',
4157
+ 'currency',
4158
+ 'matchAmountTolerance',
4159
+ 'isActive',
4160
+ 'startDate',
4161
+ 'autoCreate',
4162
+ 'totalCount',
4163
+ 'createdAt',
4164
+ 'updatedAt',
4165
+ 'pendingCount',
4166
+ 'overdueCount',
4167
+ 'totalAmount',
4168
+ 'averageAmount',
4169
+ 'transactionCount',
4170
+ 'variance',
4171
+ 'upcomingCount'
4172
+ ]
3987
4173
  } as const;
3988
4174
 
3989
- export const $CashFlowPointDto = {
4175
+ export const $UpdateRecurringRuleDto = {
3990
4176
  type: 'object',
3991
4177
  properties: {
3992
- month: {
4178
+ name: {
3993
4179
  type: 'string',
3994
- description: 'Month key (YYYY-MM)',
3995
- example: '2024-03'
4180
+ description: 'Rule name (unique per user)',
4181
+ maxLength: 100
3996
4182
  },
3997
- income: {
4183
+ icon: {
3998
4184
  type: 'string',
3999
- description: 'Income in base currency (absolute, converted)',
4000
- example: '10000.00'
4185
+ description: 'Icon emoji',
4186
+ maxLength: 10
4001
4187
  },
4002
- expense: {
4188
+ frequency: {
4003
4189
  type: 'string',
4004
- description: 'Expense in base currency (absolute, converted)',
4005
- example: '5000.00'
4190
+ description: 'Recurring frequency',
4191
+ enum: [
4192
+ 'WEEKLY',
4193
+ 'BIWEEKLY',
4194
+ 'MONTHLY',
4195
+ 'BIMONTHLY',
4196
+ 'QUARTERLY',
4197
+ 'YEARLY',
4198
+ 'CUSTOM'
4199
+ ]
4006
4200
  },
4007
- netSavings: {
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: {
4020
- type: 'string',
4021
- description: 'Total income across the period',
4022
- example: '60000.00'
4201
+ expectedAmount: {
4202
+ type: 'number',
4203
+ description: 'Expected amount (positive number)',
4204
+ minimum: 0
4023
4205
  },
4024
- totalExpense: {
4206
+ expectedDay: {
4207
+ type: 'number',
4208
+ description: 'Expected day of month (1-31)',
4209
+ minimum: 1,
4210
+ maximum: 31
4211
+ },
4212
+ currency: {
4025
4213
  type: 'string',
4026
- description: 'Total expense across the period',
4027
- example: '30000.00'
4214
+ description: 'Currency code',
4215
+ maxLength: 10
4028
4216
  },
4029
- totalNetSavings: {
4217
+ matchPayeePattern: {
4030
4218
  type: 'string',
4031
- description: 'income − expense across the period',
4032
- example: '30000.00'
4219
+ description: 'Payee matching pattern (supports wildcards)',
4220
+ maxLength: 200
4033
4221
  },
4034
- averageMonthlyNetSavings: {
4222
+ matchAmountTolerance: {
4223
+ type: 'number',
4224
+ description: 'Amount tolerance percentage (0-1)',
4225
+ default: 0.075,
4226
+ minimum: 0,
4227
+ maximum: 1
4228
+ },
4229
+ defaultExpenseAccount: {
4035
4230
  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
- }
4231
+ description: 'Default expense account for auto-create',
4232
+ maxLength: 200
4059
4233
  },
4060
- summary: {
4061
- description: 'Period totals',
4062
- allOf: [
4063
- {
4064
- $ref: '#/components/schemas/CashFlowTrendSummaryDto'
4065
- }
4066
- ]
4234
+ defaultPaymentAccount: {
4235
+ type: 'string',
4236
+ description: 'Default payment account for auto-create',
4237
+ maxLength: 200
4067
4238
  },
4068
- period: {
4239
+ defaultPayee: {
4069
4240
  type: 'string',
4070
- description: 'Period requested',
4071
- example: '6m'
4241
+ description: 'Default payee for auto-create',
4242
+ maxLength: 200
4243
+ },
4244
+ autoCreate: {
4245
+ type: 'boolean',
4246
+ description: 'Auto-create transaction when expected date arrives',
4247
+ default: false
4072
4248
  },
4073
- granularity: {
4249
+ endDate: {
4074
4250
  type: 'string',
4075
- description: 'Data granularity (v1 returns month buckets)',
4076
- example: 'month'
4251
+ description: 'Rule end date (ISO format)'
4077
4252
  },
4078
- currency: {
4079
- type: 'string',
4080
- description: 'Base currency for converted values',
4081
- example: 'CNY'
4253
+ customIntervalDays: {
4254
+ type: 'number',
4255
+ description: 'Custom interval in days',
4256
+ minimum: 1
4082
4257
  },
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
- }
4258
+ isActive: {
4259
+ type: 'boolean',
4260
+ description: 'Rule active status'
4089
4261
  }
4090
- },
4091
- required: ['series', 'summary', 'period', 'granularity', 'currency']
4092
- } as const;
4093
-
4094
- export const $GenerateSnapshotBody = {
4095
- type: 'object',
4096
- properties: {}
4097
- } as const;
4098
-
4099
- export const $GenerateSnapshotResponse = {
4100
- type: 'object',
4101
- properties: {}
4102
- } as const;
4103
-
4104
- export const $BackfillSnapshotsBody = {
4105
- type: 'object',
4106
- properties: {}
4107
- } as const;
4108
-
4109
- export const $BackfillSnapshotsResponse = {
4110
- type: 'object',
4111
- properties: {}
4262
+ }
4112
4263
  } as const;
4113
4264
 
4114
- export const $DeleteOwnUserDto = {
4265
+ export const $ExpectedTransactionRuleDto = {
4115
4266
  type: 'object',
4116
4267
  properties: {
4117
- accessToken: {
4268
+ name: {
4118
4269
  type: 'string',
4119
- description: 'Access token for user verification',
4120
- example: 'abc123xyz'
4121
- }
4122
- },
4123
- required: ['accessToken']
4124
- } as const;
4125
-
4126
- export const $UserSettingsResponseDto = {
4127
- type: 'object',
4128
- properties: {
4129
- baseCurrency: {
4270
+ description: 'Rule name'
4271
+ },
4272
+ icon: {
4130
4273
  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
4274
+ description: 'Rule icon'
4275
+ },
4276
+ frequency: {
4277
+ type: 'string',
4278
+ description: 'Rule frequency'
4279
+ },
4280
+ currency: {
4281
+ type: 'string',
4282
+ description: 'Currency code'
4135
4283
  }
4136
4284
  },
4137
- required: ['baseCurrency']
4285
+ required: ['name', 'frequency', 'currency']
4138
4286
  } as const;
4139
4287
 
4140
- export const $UserResponseDto = {
4288
+ export const $ExpectedTransactionResponseDto = {
4141
4289
  type: 'object',
4142
4290
  properties: {
4143
4291
  id: {
4292
+ type: 'string',
4293
+ description: 'Expected transaction ID'
4294
+ },
4295
+ userId: {
4144
4296
  type: 'string',
4145
4297
  description: 'User ID'
4146
4298
  },
4147
- role: {
4299
+ ruleId: {
4148
4300
  type: 'string',
4149
- description: 'Assigned user role'
4301
+ description: 'Associated rule ID'
4150
4302
  },
4151
- permissions: {
4152
- description: 'Permission strings',
4153
- type: 'array',
4154
- items: {
4155
- type: 'string'
4156
- }
4303
+ expectedDate: {
4304
+ type: 'string',
4305
+ description: 'Expected date (YYYY-MM-DD)'
4157
4306
  },
4158
- settings: {
4159
- description: 'User settings',
4307
+ expectedAmount: {
4308
+ type: 'number',
4309
+ description: 'Expected amount'
4310
+ },
4311
+ status: {
4312
+ type: 'string',
4313
+ description: 'Status (PENDING, COMPLETED, SKIPPED)'
4314
+ },
4315
+ matchedTransactionId: {
4316
+ type: 'string',
4317
+ description: 'Matched transaction ID'
4318
+ },
4319
+ matchedAt: {
4320
+ type: 'string',
4321
+ description: 'Match timestamp (ISO 8601)'
4322
+ },
4323
+ matchConfidence: {
4324
+ type: 'number',
4325
+ description: 'Match confidence score (0-1)'
4326
+ },
4327
+ isOverdue: {
4328
+ type: 'boolean',
4329
+ description: 'Whether this expected transaction is overdue'
4330
+ },
4331
+ rule: {
4332
+ description: 'Rule information',
4160
4333
  allOf: [
4161
4334
  {
4162
- $ref: '#/components/schemas/UserSettingsResponseDto'
4335
+ $ref: '#/components/schemas/ExpectedTransactionRuleDto'
4163
4336
  }
4164
4337
  ]
4338
+ },
4339
+ createdAt: {
4340
+ format: 'date-time',
4341
+ type: 'string',
4342
+ description: 'Created at timestamp'
4343
+ },
4344
+ updatedAt: {
4345
+ format: 'date-time',
4346
+ type: 'string',
4347
+ description: 'Updated at timestamp'
4165
4348
  }
4166
4349
  },
4167
- required: ['id', 'role', 'permissions', 'settings']
4350
+ required: [
4351
+ 'id',
4352
+ 'userId',
4353
+ 'ruleId',
4354
+ 'expectedDate',
4355
+ 'expectedAmount',
4356
+ 'status',
4357
+ 'isOverdue',
4358
+ 'rule',
4359
+ 'createdAt',
4360
+ 'updatedAt'
4361
+ ]
4168
4362
  } as const;
4169
4363
 
4170
- export const $SignupDto = {
4364
+ export const $ExpectedTransactionListResponseDto = {
4171
4365
  type: 'object',
4172
4366
  properties: {
4173
- turnstileToken: {
4367
+ items: {
4368
+ type: 'array',
4369
+ items: {
4370
+ $ref: '#/components/schemas/ExpectedTransactionResponseDto'
4371
+ }
4372
+ },
4373
+ total: {
4374
+ type: 'number',
4375
+ description: 'Total count'
4376
+ }
4377
+ },
4378
+ required: ['items', 'total']
4379
+ } as const;
4380
+
4381
+ export const $ConfirmMatchDto = {
4382
+ type: 'object',
4383
+ properties: {
4384
+ transactionId: {
4174
4385
  type: 'string',
4175
- description:
4176
- 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4177
- example: '0.abc123def456...'
4386
+ description: 'Transaction ID to match with'
4178
4387
  }
4179
- }
4388
+ },
4389
+ required: ['transactionId']
4180
4390
  } as const;
4181
4391
 
4182
- export const $SignupResponseDto = {
4392
+ export const $EnterNowDto = {
4183
4393
  type: 'object',
4184
4394
  properties: {
4185
- authToken: {
4395
+ expenseAccount: {
4186
4396
  type: 'string',
4187
- description: 'JWT auth token',
4188
- example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
4397
+ description:
4398
+ 'Override expense account (uses rule default if not provided)',
4399
+ maxLength: 200
4189
4400
  },
4190
- accessToken: {
4401
+ paymentAccount: {
4191
4402
  type: 'string',
4192
- description: 'Auto-generated access token'
4403
+ description:
4404
+ 'Override payment account (uses rule default if not provided)',
4405
+ maxLength: 200
4193
4406
  },
4194
- role: {
4407
+ amount: {
4408
+ type: 'number',
4409
+ description: 'Override amount (uses expected amount if not provided)',
4410
+ minimum: 0
4411
+ },
4412
+ payee: {
4195
4413
  type: 'string',
4196
- description: 'Assigned user role',
4197
- enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
4414
+ description: 'Override payee (uses rule default if not provided)',
4415
+ maxLength: 200
4416
+ },
4417
+ narration: {
4418
+ type: 'string',
4419
+ description: 'Optional narration',
4420
+ maxLength: 500
4198
4421
  }
4199
- },
4200
- required: ['authToken', 'accessToken', 'role']
4422
+ }
4201
4423
  } as const;
4202
4424
 
4203
- export const $UpdateUserSettingDto = {
4425
+ export const $ForecastItemDto = {
4204
4426
  type: 'object',
4205
4427
  properties: {
4206
- secId: {
4207
- type: 'number',
4208
- description: 'Security ID'
4428
+ rule: {
4429
+ type: 'string',
4430
+ description: 'Rule name',
4431
+ example: 'Rent'
4209
4432
  },
4210
- annualInterestRate: {
4433
+ ruleId: {
4434
+ type: 'string',
4435
+ description: 'Rule ID',
4436
+ example: 'clx123...'
4437
+ },
4438
+ amount: {
4211
4439
  type: 'number',
4212
- description: 'Annual interest rate',
4213
- example: 0.05
4440
+ description: 'Expected amount',
4441
+ example: 3000
4214
4442
  },
4215
- currency: {
4443
+ date: {
4216
4444
  type: 'string',
4217
- description: 'Currency code',
4218
- example: 'USD'
4445
+ description: 'Expected date (YYYY-MM-DD)',
4446
+ example: '2024-04-01'
4219
4447
  },
4220
- baseCurrency: {
4448
+ icon: {
4221
4449
  type: 'string',
4222
- description: 'Base currency code',
4223
- example: 'USD'
4450
+ description: 'Rule icon emoji',
4451
+ example: '🏠',
4452
+ nullable: true
4224
4453
  },
4225
- benchmark: {
4454
+ currency: {
4226
4455
  type: 'string',
4227
- description: 'Benchmark symbol',
4228
- example: 'SPY'
4229
- },
4230
- colorScheme: {
4456
+ description: 'Currency code',
4457
+ example: 'CNY'
4458
+ }
4459
+ },
4460
+ required: ['rule', 'ruleId', 'amount', 'date', 'icon', 'currency']
4461
+ } as const;
4462
+
4463
+ export const $MonthlyForecastDto = {
4464
+ type: 'object',
4465
+ properties: {
4466
+ month: {
4231
4467
  type: 'string',
4232
- description: 'Color scheme',
4233
- enum: ['DARK', 'LIGHT']
4468
+ description: 'Month (YYYY-MM)',
4469
+ example: '2024-04'
4234
4470
  },
4235
- dateRange: {
4236
- type: 'string',
4237
- description: 'Date range filter',
4238
- example: '1y'
4471
+ expectedOutflow: {
4472
+ type: 'number',
4473
+ description: 'Total expected outflow for the month',
4474
+ example: 8500
4239
4475
  },
4240
- emergencyFund: {
4476
+ itemCount: {
4241
4477
  type: 'number',
4242
- description: 'Emergency fund amount',
4243
- example: 10000
4478
+ description: 'Number of expected transactions',
4479
+ example: 3
4244
4480
  },
4245
- 'filters.accounts': {
4246
- description: 'Account filter IDs',
4247
- type: 'array',
4248
- items: {
4249
- type: 'string'
4481
+ byCurrency: {
4482
+ type: 'object',
4483
+ description: 'Breakdown by currency',
4484
+ example: {
4485
+ CNY: 8500,
4486
+ USD: 100
4250
4487
  }
4251
4488
  },
4252
- 'filters.assetClasses': {
4253
- description: 'Asset class filters',
4489
+ items: {
4490
+ description: 'Individual forecast items',
4254
4491
  type: 'array',
4255
4492
  items: {
4256
- type: 'string'
4493
+ $ref: '#/components/schemas/ForecastItemDto'
4257
4494
  }
4258
- },
4259
- 'filters.dataSource': {
4260
- type: 'string',
4261
- description: 'Data source filter'
4262
- },
4263
- 'filters.symbol': {
4264
- type: 'string',
4265
- description: 'Symbol filter'
4266
- },
4267
- 'filters.tags': {
4268
- description: 'Tag filters',
4495
+ }
4496
+ },
4497
+ required: ['month', 'expectedOutflow', 'itemCount', 'byCurrency', 'items']
4498
+ } as const;
4499
+
4500
+ export const $ForecastResponseDto = {
4501
+ type: 'object',
4502
+ properties: {
4503
+ forecast: {
4504
+ description: 'Monthly forecast data',
4269
4505
  type: 'array',
4270
4506
  items: {
4271
- type: 'string'
4507
+ $ref: '#/components/schemas/MonthlyForecastDto'
4272
4508
  }
4273
4509
  },
4274
- isExperimentalFeatures: {
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: {
4510
+ totalOutflow: {
4293
4511
  type: 'number',
4294
- description: 'Projected total amount',
4295
- example: 1000000
4512
+ description: 'Total expected outflow across all months',
4513
+ example: 25500
4296
4514
  },
4297
- retirementDate: {
4298
- type: 'string',
4299
- description: 'Retirement date in ISO 8601 format',
4300
- example: '2050-01-01'
4515
+ totalByCurrency: {
4516
+ type: 'object',
4517
+ description: 'Total by currency across all months',
4518
+ example: {
4519
+ CNY: 25500,
4520
+ USD: 300
4521
+ }
4301
4522
  },
4302
- savingsRate: {
4523
+ rulesCount: {
4303
4524
  type: 'number',
4304
- description: 'Savings rate percentage',
4305
- example: 0.2
4525
+ description: 'Number of active recurring rules included',
4526
+ example: 5
4306
4527
  },
4307
- viewMode: {
4528
+ periodStart: {
4308
4529
  type: 'string',
4309
- description: 'View mode',
4310
- enum: ['DEFAULT', 'ZEN']
4311
- }
4312
- }
4313
- } as const;
4314
-
4315
- export const $UpdatePropertyDto = {
4316
- type: 'object',
4317
- properties: {
4318
- value: {
4530
+ description: 'Forecast period start date',
4531
+ example: '2024-04-01'
4532
+ },
4533
+ periodEnd: {
4319
4534
  type: 'string',
4320
- description: 'Property value'
4535
+ description: 'Forecast period end date',
4536
+ example: '2024-06-30'
4321
4537
  }
4322
4538
  },
4323
- required: ['value']
4539
+ required: [
4540
+ 'forecast',
4541
+ 'totalOutflow',
4542
+ 'totalByCurrency',
4543
+ 'rulesCount',
4544
+ 'periodStart',
4545
+ 'periodEnd'
4546
+ ]
4324
4547
  } as const;
4325
4548
 
4326
4549
  export const $CreateTransactionRuleDto = {
@@ -4882,7 +5105,8 @@ export const $UpdateTransactionRuleDto = {
4882
5105
  },
4883
5106
  matchLogic: {
4884
5107
  type: 'string',
4885
- enum: ['OR', 'AND']
5108
+ enum: ['OR', 'AND'],
5109
+ default: 'OR'
4886
5110
  },
4887
5111
  amountMin: {
4888
5112
  type: 'number',
@@ -4896,13 +5120,10 @@ export const $UpdateTransactionRuleDto = {
4896
5120
  },
4897
5121
  priority: {
4898
5122
  type: 'number',
5123
+ default: 50,
4899
5124
  minimum: 0,
4900
5125
  maximum: 1000
4901
5126
  },
4902
- enabled: {
4903
- type: 'boolean',
4904
- description: 'Enable or disable the rule'
4905
- },
4906
5127
  additionalTags: {
4907
5128
  items: {
4908
5129
  type: 'array'
@@ -4912,6 +5133,10 @@ export const $UpdateTransactionRuleDto = {
4912
5133
  },
4913
5134
  additionalMetadata: {
4914
5135
  type: 'object'
5136
+ },
5137
+ enabled: {
5138
+ type: 'boolean',
5139
+ description: 'Enable or disable the rule'
4915
5140
  }
4916
5141
  }
4917
5142
  } as const;
@@ -5198,6 +5423,14 @@ export const $OnboardingAccountDto = {
5198
5423
  description:
5199
5424
  'Platform ID to bind the account to (references Platform.id); omit for unbound',
5200
5425
  example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
5426
+ },
5427
+ displayName: {
5428
+ type: 'string',
5429
+ description:
5430
+ 'User-set display name override (omit/null = keep the derived name)',
5431
+ nullable: true,
5432
+ maxLength: 50,
5433
+ example: 'Salary card'
5201
5434
  }
5202
5435
  },
5203
5436
  required: ['path', 'currency']
@@ -6217,8 +6450,27 @@ export const $ProcessNlpDto = {
6217
6450
  selectedAccount: {
6218
6451
  type: 'string',
6219
6452
  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.',
6453
+ '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
6454
  example: 'Expenses:Food:Coffee'
6455
+ },
6456
+ viewpointAccount: {
6457
+ type: 'string',
6458
+ description:
6459
+ '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.',
6460
+ example: 'Assets:CN:Bank:ICBC'
6461
+ },
6462
+ viewpointCategory: {
6463
+ type: 'string',
6464
+ description:
6465
+ "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.",
6466
+ example: 'Food'
6467
+ },
6468
+ viewpointFlow: {
6469
+ type: 'string',
6470
+ description:
6471
+ "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.",
6472
+ enum: ['income', 'expense'],
6473
+ example: 'expense'
6222
6474
  }
6223
6475
  }
6224
6476
  } as const;
@@ -6532,6 +6784,24 @@ export const $NlpRuleConfirmationDataDto = {
6532
6784
  ]
6533
6785
  } as const;
6534
6786
 
6787
+ export const $NlpAccountCandidateDto = {
6788
+ type: 'object',
6789
+ properties: {
6790
+ path: {
6791
+ type: 'string',
6792
+ description: 'Canonical beancount account path (echo back on selection)',
6793
+ example: 'Expenses:Food:Dining'
6794
+ },
6795
+ name: {
6796
+ type: 'string',
6797
+ description:
6798
+ 'Localized display name (ADR-0114 read-time projection, user locale)',
6799
+ example: '餐饮'
6800
+ }
6801
+ },
6802
+ required: ['path', 'name']
6803
+ } as const;
6804
+
6535
6805
  export const $NlpAccountConfirmationDataDto = {
6536
6806
  type: 'object',
6537
6807
  properties: {
@@ -6547,10 +6817,11 @@ export const $NlpAccountConfirmationDataDto = {
6547
6817
  example: 'Expenses:Food:Drinks'
6548
6818
  },
6549
6819
  similarAccounts: {
6550
- description: 'Similar accounts for user selection',
6820
+ description:
6821
+ 'Similar accounts for user selection (path + localized name, #680)',
6551
6822
  type: 'array',
6552
6823
  items: {
6553
- type: 'string'
6824
+ $ref: '#/components/schemas/NlpAccountCandidateDto'
6554
6825
  }
6555
6826
  },
6556
6827
  errorMessage: {
@@ -7127,55 +7398,128 @@ export const $PlatformMatchResultDto = {
7127
7398
  category: {
7128
7399
  type: 'string',
7129
7400
  description:
7130
- 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7401
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7402
+ nullable: true,
7403
+ example: 'DigitalWallet'
7404
+ },
7405
+ matchType: {
7406
+ type: 'string',
7407
+ description: "How this row matched: 'exact' > 'prefix' > 'substring'",
7408
+ enum: ['exact', 'prefix', 'substring']
7409
+ }
7410
+ },
7411
+ required: [
7412
+ 'id',
7413
+ 'name',
7414
+ 'canonical',
7415
+ 'type',
7416
+ 'suggestedSegment',
7417
+ 'logoUrl',
7418
+ 'countryCode',
7419
+ 'category',
7420
+ 'matchType'
7421
+ ]
7422
+ } as const;
7423
+
7424
+ export const $PlatformMatchResponseDto = {
7425
+ type: 'object',
7426
+ properties: {
7427
+ platforms: {
7428
+ description: 'Ranked matches, best tier first (at most 10 rows)',
7429
+ type: 'array',
7430
+ items: {
7431
+ $ref: '#/components/schemas/PlatformMatchResultDto'
7432
+ }
7433
+ },
7434
+ matchType: {
7435
+ type: 'string',
7436
+ description:
7437
+ "Overall match quality — top row's tier, or 'none' when no hits",
7438
+ enum: ['none', 'exact', 'prefix', 'substring']
7439
+ },
7440
+ total: {
7441
+ type: 'number',
7442
+ description: 'Total matches before LIMIT (truncation transparency)'
7443
+ },
7444
+ hasMore: {
7445
+ type: 'boolean',
7446
+ description: 'true when total > platforms.length (more matches exist)'
7447
+ }
7448
+ },
7449
+ required: ['platforms', 'matchType', 'total', 'hasMore']
7450
+ } as const;
7451
+
7452
+ export const $PlatformStandardsPlatformDto = {
7453
+ type: 'object',
7454
+ properties: {
7455
+ id: {
7456
+ type: 'string',
7457
+ description: 'Global platform ID'
7458
+ },
7459
+ name: {
7460
+ type: 'string',
7461
+ description: 'Platform name (e.g., "ICBC")'
7462
+ },
7463
+ canonical: {
7464
+ type: 'string',
7465
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
7466
+ },
7467
+ suggestedSegment: {
7468
+ type: 'string',
7469
+ description:
7470
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
7471
+ },
7472
+ type: {
7473
+ type: 'string',
7474
+ description: 'Platform type',
7475
+ enum: [
7476
+ 'BANK',
7477
+ 'BROKERAGE',
7478
+ 'CRYPTO_EXCHANGE',
7479
+ 'PAYMENT',
7480
+ 'INVESTMENT',
7481
+ 'INSURANCE',
7482
+ 'OTHER'
7483
+ ]
7484
+ },
7485
+ category: {
7486
+ type: 'string',
7487
+ description:
7488
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank) resolved against the final region. null = no region-aware suggestion; fall back to type.',
7131
7489
  nullable: true,
7132
- example: 'DigitalWallet'
7133
- },
7134
- matchType: {
7135
- type: 'string',
7136
- description: "How this row matched: 'exact' > 'prefix' > 'substring'",
7137
- enum: ['exact', 'prefix', 'substring']
7490
+ example: 'Bank'
7138
7491
  }
7139
7492
  },
7140
- required: [
7141
- 'id',
7142
- 'name',
7143
- 'canonical',
7144
- 'type',
7145
- 'suggestedSegment',
7146
- 'logoUrl',
7147
- 'countryCode',
7148
- 'category',
7149
- 'matchType'
7150
- ]
7493
+ required: ['id', 'name', 'canonical', 'suggestedSegment', 'type', 'category']
7151
7494
  } as const;
7152
7495
 
7153
- export const $PlatformMatchResponseDto = {
7496
+ export const $PlatformStandardsResponseDto = {
7154
7497
  type: 'object',
7155
7498
  properties: {
7156
- platforms: {
7157
- description: 'Ranked matches, best tier first (at most 10 rows)',
7158
- type: 'array',
7159
- items: {
7160
- $ref: '#/components/schemas/PlatformMatchResultDto'
7161
- }
7499
+ platform: {
7500
+ description: 'The selected platform (institution lock source)',
7501
+ allOf: [
7502
+ {
7503
+ $ref: '#/components/schemas/PlatformStandardsPlatformDto'
7504
+ }
7505
+ ]
7162
7506
  },
7163
- matchType: {
7507
+ region: {
7164
7508
  type: 'string',
7165
7509
  description:
7166
- "Overall match quality — top row's tier, or 'none' when no hits",
7167
- enum: ['none', 'exact', 'prefix', 'substring']
7168
- },
7169
- total: {
7170
- type: 'number',
7171
- description: 'Total matches before LIMIT (truncation transparency)'
7510
+ "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.",
7511
+ example: 'CN'
7172
7512
  },
7173
- hasMore: {
7174
- type: 'boolean',
7175
- description: 'true when total > platforms.length (more matches exist)'
7513
+ templates: {
7514
+ description:
7515
+ 'Candidate account-standard templates of the resolved region (groupable by productCategory client-side)',
7516
+ type: 'array',
7517
+ items: {
7518
+ $ref: '#/components/schemas/AccountStandardResponseDto'
7519
+ }
7176
7520
  }
7177
7521
  },
7178
- required: ['platforms', 'matchType', 'total', 'hasMore']
7522
+ required: ['platform', 'region', 'templates']
7179
7523
  } as const;
7180
7524
 
7181
7525
  export const $CreatePlatformDto = {
@@ -7279,7 +7623,8 @@ export const $UpdatePlatformDto = {
7279
7623
  },
7280
7624
  isActive: {
7281
7625
  type: 'boolean',
7282
- description: 'Whether the platform is active'
7626
+ description: 'Whether the platform is active',
7627
+ default: true
7283
7628
  }
7284
7629
  }
7285
7630
  } as const;
@@ -7442,7 +7787,8 @@ export const $AccountItemDto = {
7442
7787
  },
7443
7788
  displayName: {
7444
7789
  type: 'string',
7445
- description: 'Display name (last part of account path)',
7790
+ description:
7791
+ '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
7792
  example: 'Savings'
7447
7793
  },
7448
7794
  balance: {
@@ -7478,7 +7824,8 @@ export const $PlatformGroupDto = {
7478
7824
  example: 'CMB Bank'
7479
7825
  },
7480
7826
  accounts: {
7481
- description: 'Accounts within this platform',
7827
+ description:
7828
+ 'Accounts within this platform (Assets and Liabilities rows, #696)',
7482
7829
  type: 'array',
7483
7830
  items: {
7484
7831
  $ref: '#/components/schemas/AccountItemDto'
@@ -7486,7 +7833,8 @@ export const $PlatformGroupDto = {
7486
7833
  },
7487
7834
  totalBalance: {
7488
7835
  type: 'string',
7489
- description: 'FX-converted total balance in base currency',
7836
+ description:
7837
+ 'FX-converted total balance in base currency (nets Assets + Liabilities rows; can be negative)',
7490
7838
  example: '100000.00'
7491
7839
  },
7492
7840
  balanceByCurrency: {
@@ -7505,7 +7853,7 @@ export const $PlatformGroupDto = {
7505
7853
  sharePct: {
7506
7854
  type: 'number',
7507
7855
  description:
7508
- 'Share of the grand converted total (0-100); 0 when grand total is 0',
7856
+ '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
7857
  example: 42.5
7510
7858
  }
7511
7859
  },
@@ -7553,7 +7901,8 @@ export const $AccountsSummaryDto = {
7553
7901
  properties: {
7554
7902
  totalAccounts: {
7555
7903
  type: 'number',
7556
- description: 'Total number of accounts'
7904
+ description:
7905
+ 'Total number of accounts (balance sheet: Assets + Liabilities, #696)'
7557
7906
  },
7558
7907
  totalPlatforms: {
7559
7908
  type: 'number',
@@ -7611,7 +7960,8 @@ export const $AccountItemWithAssetClassDto = {
7611
7960
  },
7612
7961
  displayName: {
7613
7962
  type: 'string',
7614
- description: 'Display name (last part of account path)',
7963
+ description:
7964
+ '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
7965
  example: 'Savings'
7616
7966
  },
7617
7967
  balance: {
@@ -8097,7 +8447,7 @@ export const $MonetaryDto = {
8097
8447
  example: 'USD'
8098
8448
  },
8099
8449
  baseCcyEquivalent: {
8100
- type: 'object',
8450
+ type: 'string',
8101
8451
  description: 'Converted to user base currency (Decimal string)',
8102
8452
  example: '21600',
8103
8453
  nullable: true
@@ -8173,13 +8523,13 @@ export const $HoldingPnlRowDto = {
8173
8523
  example: 'Assets:US:Broker:AAPL'
8174
8524
  },
8175
8525
  accountCcy: {
8176
- type: 'object',
8526
+ type: 'string',
8177
8527
  description: 'Account settlement currency (ISO 4217), from cost currency',
8178
8528
  nullable: true,
8179
8529
  example: 'USD'
8180
8530
  },
8181
8531
  brokerType: {
8182
- type: 'object',
8532
+ type: 'string',
8183
8533
  description: 'Broker type derived from Platform.type',
8184
8534
  nullable: true,
8185
8535
  example: 'broker'
@@ -8200,7 +8550,7 @@ export const $HoldingPnlRowDto = {
8200
8550
  example: 'EQUITY'
8201
8551
  },
8202
8552
  assetSubClass: {
8203
- type: 'object',
8553
+ type: 'string',
8204
8554
  nullable: true,
8205
8555
  example: 'STOCK'
8206
8556
  },
@@ -8247,14 +8597,14 @@ export const $HoldingPnlRowDto = {
8247
8597
  ]
8248
8598
  },
8249
8599
  unrealizedPnlBase: {
8250
- type: 'object',
8600
+ type: 'string',
8251
8601
  description:
8252
8602
  'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
8253
8603
  nullable: true,
8254
8604
  example: '6000'
8255
8605
  },
8256
8606
  unrealizedPnlPct: {
8257
- type: 'object',
8607
+ type: 'string',
8258
8608
  description: 'Unrealized P&L % (Decimal string)',
8259
8609
  nullable: true,
8260
8610
  example: '25'
@@ -8278,7 +8628,7 @@ export const $HoldingPnlRowDto = {
8278
8628
  ]
8279
8629
  },
8280
8630
  pctOfInvestedAssets: {
8281
- type: 'object',
8631
+ type: 'string',
8282
8632
  description:
8283
8633
  'Share of invested assets % (Decimal string); only for invested chartTokens',
8284
8634
  nullable: true,
@@ -8323,15 +8673,15 @@ export const $HoldingPnlWarningDto = {
8323
8673
  ]
8324
8674
  },
8325
8675
  symbol: {
8326
- type: 'object',
8676
+ type: 'string',
8327
8677
  nullable: true
8328
8678
  },
8329
8679
  accountId: {
8330
- type: 'object',
8680
+ type: 'string',
8331
8681
  nullable: true
8332
8682
  },
8333
8683
  currency: {
8334
- type: 'object',
8684
+ type: 'string',
8335
8685
  nullable: true
8336
8686
  }
8337
8687
  },
@@ -8395,6 +8745,216 @@ export const $AnonymousLoginResponseDto = {
8395
8745
  required: ['authToken']
8396
8746
  } as const;
8397
8747
 
8748
+ export const $ParserContributionMetaDto = {
8749
+ type: 'object',
8750
+ properties: {
8751
+ institution: {
8752
+ type: 'string',
8753
+ description: 'Institution slug (lowercase kebab-case)',
8754
+ pattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
8755
+ example: 'icbc'
8756
+ },
8757
+ region: {
8758
+ type: 'string',
8759
+ enum: [
8760
+ 'cn',
8761
+ 'us',
8762
+ 'de',
8763
+ 'fr',
8764
+ 'gb',
8765
+ 'hk',
8766
+ 'jp',
8767
+ 'sg',
8768
+ 'au',
8769
+ 'ca',
8770
+ 'other'
8771
+ ]
8772
+ },
8773
+ accountType: {
8774
+ type: 'string',
8775
+ enum: ['checking', 'savings', 'credit', 'debit', 'investment']
8776
+ },
8777
+ format: {
8778
+ type: 'string',
8779
+ enum: ['csv', 'xlsx', 'pdf', 'ofx', 'qif']
8780
+ },
8781
+ institutionDisplayName: {
8782
+ type: 'string',
8783
+ example: '中国工商银行'
8784
+ },
8785
+ encoding: {
8786
+ type: 'string',
8787
+ example: 'utf-8'
8788
+ },
8789
+ delimiter: {
8790
+ type: 'string',
8791
+ description: 'CSV delimiter character: ",", ";", "\\t" or "|"'
8792
+ },
8793
+ headerRows: {
8794
+ type: 'number',
8795
+ default: 1,
8796
+ description: 'Header row count; the client omits the field when it is 1'
8797
+ },
8798
+ notes: {
8799
+ type: 'string',
8800
+ maxLength: 2000
8801
+ }
8802
+ },
8803
+ required: ['institution', 'region', 'accountType', 'format']
8804
+ } as const;
8805
+
8806
+ export const $ParserContributionSamplesDto = {
8807
+ type: 'object',
8808
+ properties: {
8809
+ rows: {
8810
+ description:
8811
+ 'Client-sanitized sample rows (key = column name, value = cell)',
8812
+ type: 'array',
8813
+ items: {
8814
+ type: 'object'
8815
+ }
8816
+ },
8817
+ rawHeaders: {
8818
+ type: 'array',
8819
+ items: {
8820
+ type: 'string'
8821
+ }
8822
+ }
8823
+ },
8824
+ required: ['rows']
8825
+ } as const;
8826
+
8827
+ export const $FieldHintDto = {
8828
+ type: 'object',
8829
+ properties: {
8830
+ columnName: {
8831
+ type: 'string',
8832
+ example: '交易日期'
8833
+ },
8834
+ format: {
8835
+ type: 'string',
8836
+ description: 'Date format, e.g. yyyy-MM-dd HH:mm',
8837
+ example: 'yyyy-MM-dd'
8838
+ },
8839
+ signConvention: {
8840
+ type: 'string',
8841
+ enum: ['negative-expense', 'positive-expense', 'separate-columns']
8842
+ },
8843
+ creditColumn: {
8844
+ type: 'string'
8845
+ },
8846
+ debitColumn: {
8847
+ type: 'string'
8848
+ }
8849
+ },
8850
+ required: ['columnName']
8851
+ } as const;
8852
+
8853
+ export const $ParserContributionFieldHintsDto = {
8854
+ type: 'object',
8855
+ properties: {
8856
+ date: {
8857
+ $ref: '#/components/schemas/FieldHintDto'
8858
+ },
8859
+ amount: {
8860
+ $ref: '#/components/schemas/FieldHintDto'
8861
+ },
8862
+ description: {
8863
+ $ref: '#/components/schemas/FieldHintDto'
8864
+ },
8865
+ balance: {
8866
+ $ref: '#/components/schemas/FieldHintDto'
8867
+ },
8868
+ payee: {
8869
+ $ref: '#/components/schemas/FieldHintDto'
8870
+ },
8871
+ reference: {
8872
+ $ref: '#/components/schemas/FieldHintDto'
8873
+ },
8874
+ category: {
8875
+ $ref: '#/components/schemas/FieldHintDto'
8876
+ }
8877
+ },
8878
+ required: ['date', 'amount']
8879
+ } as const;
8880
+
8881
+ export const $ExpectedTransactionDto = {
8882
+ type: 'object',
8883
+ properties: {
8884
+ date: {
8885
+ type: 'string',
8886
+ example: '2026-08-01'
8887
+ },
8888
+ amount: {
8889
+ type: 'number',
8890
+ example: -45.5
8891
+ },
8892
+ description: {
8893
+ type: 'string',
8894
+ example: '星巴克-***店'
8895
+ },
8896
+ payee: {
8897
+ type: 'string'
8898
+ },
8899
+ category: {
8900
+ type: 'string'
8901
+ }
8902
+ },
8903
+ required: ['date', 'amount', 'description']
8904
+ } as const;
8905
+
8906
+ export const $ParserContributionExamplesDto = {
8907
+ type: 'object',
8908
+ properties: {
8909
+ expectedTransactions: {
8910
+ type: 'array',
8911
+ items: {
8912
+ $ref: '#/components/schemas/ExpectedTransactionDto'
8913
+ }
8914
+ }
8915
+ },
8916
+ required: ['expectedTransactions']
8917
+ } as const;
8918
+
8919
+ export const $ParserContributionRequestDto = {
8920
+ type: 'object',
8921
+ properties: {
8922
+ meta: {
8923
+ $ref: '#/components/schemas/ParserContributionMetaDto'
8924
+ },
8925
+ samples: {
8926
+ $ref: '#/components/schemas/ParserContributionSamplesDto'
8927
+ },
8928
+ fieldHints: {
8929
+ $ref: '#/components/schemas/ParserContributionFieldHintsDto'
8930
+ },
8931
+ examples: {
8932
+ description: 'Omitted entirely by the client when empty',
8933
+ allOf: [
8934
+ {
8935
+ $ref: '#/components/schemas/ParserContributionExamplesDto'
8936
+ }
8937
+ ]
8938
+ }
8939
+ },
8940
+ required: ['meta', 'samples', 'fieldHints']
8941
+ } as const;
8942
+
8943
+ export const $ParserContributionRelayResponseDto = {
8944
+ type: 'object',
8945
+ properties: {
8946
+ issueUrl: {
8947
+ type: 'string',
8948
+ example: 'https://github.com/fire-zu/firela-vlt/issues/42'
8949
+ },
8950
+ issueNumber: {
8951
+ type: 'number',
8952
+ example: 42
8953
+ }
8954
+ },
8955
+ required: ['issueUrl', 'issueNumber']
8956
+ } as const;
8957
+
8398
8958
  export const $SymbolSearchResultDto = {
8399
8959
  type: 'object',
8400
8960
  properties: {
@@ -8403,35 +8963,35 @@ export const $SymbolSearchResultDto = {
8403
8963
  example: 'AAPL'
8404
8964
  },
8405
8965
  name: {
8406
- type: 'object',
8966
+ type: 'string',
8407
8967
  example: 'Apple Inc.',
8408
8968
  nullable: true
8409
8969
  },
8410
8970
  exchange: {
8411
- type: 'object',
8971
+ type: 'string',
8412
8972
  example: 'US',
8413
8973
  nullable: true
8414
8974
  },
8415
8975
  assetType: {
8416
- type: 'object',
8976
+ type: 'string',
8417
8977
  description: 'OpenBB asset_type (e.g. stock, etf)',
8418
8978
  example: 'stock',
8419
8979
  nullable: true
8420
8980
  },
8421
8981
  assetClass: {
8422
- type: 'object',
8982
+ type: 'string',
8423
8983
  description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
8424
8984
  example: 'EQUITY',
8425
8985
  nullable: true
8426
8986
  },
8427
8987
  assetSubClass: {
8428
- type: 'object',
8988
+ type: 'string',
8429
8989
  description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
8430
8990
  example: 'STOCK',
8431
8991
  nullable: true
8432
8992
  },
8433
8993
  currency: {
8434
- type: 'object',
8994
+ type: 'string',
8435
8995
  description: 'Trading currency (extra_data or inferred from exchange)',
8436
8996
  example: 'USD',
8437
8997
  nullable: true
@@ -8448,90 +9008,90 @@ export const $SymbolQuoteDto = {
8448
9008
  example: 'AAPL'
8449
9009
  },
8450
9010
  name: {
8451
- type: 'object',
9011
+ type: 'string',
8452
9012
  example: 'Apple Inc.',
8453
9013
  nullable: true
8454
9014
  },
8455
9015
  exchange: {
8456
- type: 'object',
9016
+ type: 'string',
8457
9017
  example: 'US',
8458
9018
  nullable: true
8459
9019
  },
8460
9020
  assetType: {
8461
- type: 'object',
9021
+ type: 'string',
8462
9022
  description: 'OpenBB asset_type',
8463
9023
  example: 'stock',
8464
9024
  nullable: true
8465
9025
  },
8466
9026
  assetClass: {
8467
- type: 'object',
9027
+ type: 'string',
8468
9028
  description: 'IGN asset class',
8469
9029
  example: 'EQUITY',
8470
9030
  nullable: true
8471
9031
  },
8472
9032
  assetSubClass: {
8473
- type: 'object',
9033
+ type: 'string',
8474
9034
  description: 'IGN asset sub-class',
8475
9035
  example: 'STOCK',
8476
9036
  nullable: true
8477
9037
  },
8478
9038
  currency: {
8479
- type: 'object',
9039
+ type: 'string',
8480
9040
  description: 'Trading currency (extra_data or inferred from exchange)',
8481
9041
  example: 'USD',
8482
9042
  nullable: true
8483
9043
  },
8484
9044
  price: {
8485
- type: 'object',
9045
+ type: 'string',
8486
9046
  description: 'Latest price (Decimal string)',
8487
9047
  example: '189.84',
8488
9048
  nullable: true
8489
9049
  },
8490
9050
  priceDate: {
8491
- type: 'object',
9051
+ type: 'string',
8492
9052
  description: 'Date the price was observed (ISO yyyy-MM-dd)',
8493
9053
  example: '2026-08-05',
8494
9054
  nullable: true
8495
9055
  },
8496
9056
  changePercent: {
8497
- type: 'object',
9057
+ type: 'number',
8498
9058
  description:
8499
9059
  '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
9060
  example: 1.7,
8501
9061
  nullable: true
8502
9062
  },
8503
9063
  prevClose: {
8504
- type: 'object',
9064
+ type: 'string',
8505
9065
  description: 'Previous close (Decimal string)',
8506
9066
  nullable: true
8507
9067
  },
8508
9068
  open: {
8509
- type: 'object',
9069
+ type: 'string',
8510
9070
  description: 'Day open (Decimal string)',
8511
9071
  nullable: true
8512
9072
  },
8513
9073
  high: {
8514
- type: 'object',
9074
+ type: 'string',
8515
9075
  description: 'Day high (Decimal string)',
8516
9076
  nullable: true
8517
9077
  },
8518
9078
  low: {
8519
- type: 'object',
9079
+ type: 'string',
8520
9080
  description: 'Day low (Decimal string)',
8521
9081
  nullable: true
8522
9082
  },
8523
9083
  volume: {
8524
- type: 'object',
9084
+ type: 'string',
8525
9085
  description: 'Day volume (Decimal string)',
8526
9086
  nullable: true
8527
9087
  },
8528
9088
  yearHigh: {
8529
- type: 'object',
9089
+ type: 'string',
8530
9090
  description: '52-week high (Decimal string)',
8531
9091
  nullable: true
8532
9092
  },
8533
9093
  yearLow: {
8534
- type: 'object',
9094
+ type: 'string',
8535
9095
  description: '52-week low (Decimal string)',
8536
9096
  nullable: true
8537
9097
  }