@firela/api-types 0.0.0-canary.aa5c64ec → 0.0.0-canary.addbab34

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.
@@ -197,7 +197,7 @@ export const $AccountResponseDto = {
197
197
  }
198
198
  },
199
199
  platformId: {
200
- type: 'object',
200
+ type: 'string',
201
201
  description: 'Platform ID (null if unbound)',
202
202
  example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
203
203
  },
@@ -377,16 +377,43 @@ export const $AccountStandardResponseDto = {
377
377
  },
378
378
  name: {
379
379
  type: 'string',
380
- description: 'Short localized display name',
380
+ description:
381
+ '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
382
  example: 'Housing Fund'
382
383
  },
384
+ aliases: {
385
+ description:
386
+ '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.',
387
+ example: ['Alipay', 'WeChat Pay'],
388
+ type: 'array',
389
+ items: {
390
+ type: 'string'
391
+ }
392
+ },
393
+ searchTerms: {
394
+ description:
395
+ '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).',
396
+ example: ['yinhangka', 'jiejika'],
397
+ type: 'array',
398
+ items: {
399
+ type: 'string'
400
+ }
401
+ },
402
+ currency: {
403
+ type: 'string',
404
+ description:
405
+ '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).',
406
+ example: 'HKD'
407
+ },
383
408
  description: {
384
409
  type: 'string',
385
- description: 'Account description (stable semantics only)',
410
+ description:
411
+ '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
412
  example: 'ICBC checking account for daily transactions'
387
413
  },
388
414
  tags: {
389
- description: 'Account tags for categorization',
415
+ description:
416
+ 'Account tags for categorization — structured metadata delivered verbatim (not localized, not xlf-managed). ADR-0131 class A.',
390
417
  example: ['bank', 'checking', 'primary'],
391
418
  type: 'array',
392
419
  items: {
@@ -776,7 +803,7 @@ export const $PostingResponseDto = {
776
803
  units: {
777
804
  type: 'string',
778
805
  description:
779
- 'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
806
+ '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
807
  example: '100.50'
781
808
  },
782
809
  currency: {
@@ -1142,7 +1169,7 @@ export const $PostingDetailDto = {
1142
1169
  units: {
1143
1170
  type: 'string',
1144
1171
  description:
1145
- 'Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.',
1172
+ '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
1173
  example: '100.50'
1147
1174
  },
1148
1175
  currency: {
@@ -1326,6 +1353,147 @@ export const $TransactionDetailDto = {
1326
1353
  ]
1327
1354
  } as const;
1328
1355
 
1356
+ export const $TransactionListItemDto = {
1357
+ type: 'object',
1358
+ properties: {
1359
+ id: {
1360
+ type: 'string',
1361
+ description: 'Transaction ID',
1362
+ example: 'clh1234567890abcdef'
1363
+ },
1364
+ date: {
1365
+ type: 'string',
1366
+ description: 'Transaction date',
1367
+ example: '2024-11-28'
1368
+ },
1369
+ flag: {
1370
+ type: 'string',
1371
+ description: 'Transaction flag',
1372
+ enum: [
1373
+ 'CLEARED',
1374
+ 'PENDING',
1375
+ 'PADDING',
1376
+ 'SUMMARIZE',
1377
+ 'TRANSFER',
1378
+ 'CONVERSIONS'
1379
+ ],
1380
+ example: 'CLEARED'
1381
+ },
1382
+ customFlag: {
1383
+ type: 'string',
1384
+ description: 'Custom flag (if not using standard flags)',
1385
+ example: 'R'
1386
+ },
1387
+ payee: {
1388
+ type: 'string',
1389
+ description: 'Payee name',
1390
+ example: 'Whole Foods Market'
1391
+ },
1392
+ narration: {
1393
+ type: 'string',
1394
+ description: 'Transaction narration',
1395
+ example: 'Grocery shopping'
1396
+ },
1397
+ tags: {
1398
+ description: 'Transaction tags',
1399
+ example: ['groceries'],
1400
+ type: 'array',
1401
+ items: {
1402
+ type: 'string'
1403
+ }
1404
+ },
1405
+ links: {
1406
+ description: 'Transaction links',
1407
+ example: ['invoice-2024-001'],
1408
+ type: 'array',
1409
+ items: {
1410
+ type: 'string'
1411
+ }
1412
+ },
1413
+ meta: {
1414
+ type: 'object',
1415
+ description: 'Transaction metadata'
1416
+ },
1417
+ status: {
1418
+ type: 'string',
1419
+ description: 'Transaction status',
1420
+ enum: ['ACTIVE', 'VOIDED', 'SUPERSEDED'],
1421
+ example: 'ACTIVE'
1422
+ },
1423
+ sourceType: {
1424
+ type: 'string',
1425
+ description:
1426
+ 'Source type (free-form string from transaction metadata, e.g. import, api)'
1427
+ },
1428
+ sourcePlatform: {
1429
+ type: 'string',
1430
+ description: 'Source platform (e.g., alipay, wechat)',
1431
+ example: 'alipay'
1432
+ },
1433
+ postings: {
1434
+ description: 'Transaction postings',
1435
+ type: 'array',
1436
+ items: {
1437
+ $ref: '#/components/schemas/PostingDetailDto'
1438
+ }
1439
+ },
1440
+ createdAt: {
1441
+ type: 'string',
1442
+ description: 'Created at timestamp',
1443
+ example: '2024-11-28T10:30:00.000Z'
1444
+ },
1445
+ voidedAt: {
1446
+ type: 'string',
1447
+ description: 'Voided at timestamp (if voided)',
1448
+ example: '2024-11-29T15:00:00.000Z'
1449
+ },
1450
+ voidedBy: {
1451
+ type: 'string',
1452
+ description: 'User ID who voided this transaction',
1453
+ example: 'clh1234567890abcdef'
1454
+ },
1455
+ correctionReason: {
1456
+ type: 'string',
1457
+ description: 'Correction reason (if voided or superseded)',
1458
+ example: 'Duplicate entry'
1459
+ },
1460
+ supersededBy: {
1461
+ type: 'string',
1462
+ description:
1463
+ 'ID of the transaction that supersedes this one (set when status=SUPERSEDED)',
1464
+ example: 'clh1234567890abcdef'
1465
+ },
1466
+ originalTxn: {
1467
+ type: 'string',
1468
+ description:
1469
+ 'ID of the transaction this one corrected/replaced (back-link on the replacement)',
1470
+ example: 'clh1234567890abcdef'
1471
+ },
1472
+ viewpointAmount: {
1473
+ type: 'string',
1474
+ description:
1475
+ '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.',
1476
+ example: '10000.00'
1477
+ },
1478
+ viewpointCurrency: {
1479
+ type: 'string',
1480
+ description:
1481
+ 'Currency of viewpointAmount. A row spanning multiple currencies takes the largest-magnitude currency group (known simplification, ADR-0126).',
1482
+ example: 'CNY'
1483
+ }
1484
+ },
1485
+ required: [
1486
+ 'id',
1487
+ 'date',
1488
+ 'narration',
1489
+ 'tags',
1490
+ 'links',
1491
+ 'status',
1492
+ 'postings',
1493
+ 'createdAt'
1494
+ ]
1495
+ } as const;
1496
+
1329
1497
  export const $BalanceByCurrencyDto = {
1330
1498
  type: 'object',
1331
1499
  properties: {
@@ -1371,7 +1539,7 @@ export const $TransactionListSummaryDto = {
1371
1539
  totalAmount: {
1372
1540
  type: 'string',
1373
1541
  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.',
1542
+ '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
1543
  example: '-6000.00'
1376
1544
  },
1377
1545
  currency: {
@@ -1397,6 +1565,26 @@ export const $TransactionListSummaryDto = {
1397
1565
  required: ['totalAmount', 'currency', 'balanceByCurrency']
1398
1566
  } as const;
1399
1567
 
1568
+ export const $TransactionListViewpointDto = {
1569
+ type: 'object',
1570
+ properties: {
1571
+ type: {
1572
+ type: 'string',
1573
+ description:
1574
+ 'Viewpoint type (only category drill-down carries a viewpoint today)',
1575
+ enum: ['category'],
1576
+ example: 'category'
1577
+ },
1578
+ flow: {
1579
+ type: 'string',
1580
+ description: 'Flow root the category account set is restricted to',
1581
+ enum: ['income', 'expense'],
1582
+ example: 'expense'
1583
+ }
1584
+ },
1585
+ required: ['type', 'flow']
1586
+ } as const;
1587
+
1400
1588
  export const $TransactionListResponseDto = {
1401
1589
  type: 'object',
1402
1590
  properties: {
@@ -1404,7 +1592,7 @@ export const $TransactionListResponseDto = {
1404
1592
  description: 'List of transactions',
1405
1593
  type: 'array',
1406
1594
  items: {
1407
- $ref: '#/components/schemas/TransactionDetailDto'
1595
+ $ref: '#/components/schemas/TransactionListItemDto'
1408
1596
  }
1409
1597
  },
1410
1598
  total: {
@@ -1430,6 +1618,15 @@ export const $TransactionListResponseDto = {
1430
1618
  $ref: '#/components/schemas/TransactionListSummaryDto'
1431
1619
  }
1432
1620
  ]
1621
+ },
1622
+ viewpoint: {
1623
+ description:
1624
+ '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).',
1625
+ allOf: [
1626
+ {
1627
+ $ref: '#/components/schemas/TransactionListViewpointDto'
1628
+ }
1629
+ ]
1433
1630
  }
1434
1631
  },
1435
1632
  required: ['data', 'total', 'limit', 'offset']
@@ -2340,10 +2537,10 @@ export const $UpdatePayeeDto = {
2340
2537
  meta: {
2341
2538
  type: 'object',
2342
2539
  description:
2343
- 'Metadata for extended information (location, notes, contact info, etc.). Will merge with existing metadata.',
2540
+ 'Metadata for extended information (location, notes, contact info, etc.)',
2344
2541
  example: {
2345
2542
  location: 'Zhongguancun',
2346
- note: 'Updated note',
2543
+ note: 'Near subway station',
2347
2544
  favorite: true
2348
2545
  }
2349
2546
  },
@@ -2904,568 +3101,660 @@ export const $UpdateCommodityDto = {
2904
3101
  }
2905
3102
  } as const;
2906
3103
 
2907
- export const $CreateBeanPriceDto = {
3104
+ export const $CurrencyBalanceDto = {
2908
3105
  type: 'object',
2909
3106
  properties: {
2910
3107
  currency: {
2911
3108
  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)',
3109
+ description: 'ISO 4217 currency code',
2918
3110
  example: 'CNY'
2919
3111
  },
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: {
3112
+ balance: {
2928
3113
  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
- }
3114
+ description: 'Balance amount',
3115
+ example: '500000.00'
2941
3116
  }
2942
3117
  },
2943
- required: ['currency', 'quoteCurrency', 'amount', 'date']
3118
+ required: ['currency', 'balance']
2944
3119
  } as const;
2945
3120
 
2946
- export const $PriceResponseDto = {
3121
+ export const $TimeSeriesPointDto = {
2947
3122
  type: 'object',
2948
3123
  properties: {
2949
- id: {
3124
+ date: {
2950
3125
  type: 'string',
2951
- description: 'Unique identifier',
2952
- example: 'uuid-123-456'
3126
+ description: 'Date in YYYY-MM-DD format',
3127
+ example: '2024-06-15'
2953
3128
  },
2954
- userId: {
3129
+ value: {
2955
3130
  type: 'string',
2956
- description: 'User ID (owner of the price)',
2957
- example: 'user-123'
3131
+ description: 'Value at this date (in base currency)',
3132
+ example: '500000.00'
2958
3133
  },
2959
- currency: {
3134
+ change: {
2960
3135
  type: 'string',
2961
- description: 'Currency being priced (e.g., USD, AAPL, BTC)',
2962
- example: 'BTC'
3136
+ description: 'Change from previous point',
3137
+ example: '5000.00'
2963
3138
  },
2964
- quoteCurrency: {
3139
+ assets: {
2965
3140
  type: 'string',
2966
- description: 'Quote currency (pricing currency, e.g., USD, CNY)',
2967
- example: 'USD'
2968
- },
2969
- amount: {
2970
- type: 'number',
2971
- description:
2972
- 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
2973
- example: 50000
3141
+ description: 'Total assets at this date (in base currency)',
3142
+ example: '494338.00'
2974
3143
  },
2975
- date: {
3144
+ liabilities: {
2976
3145
  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'
3146
+ description: 'Total liabilities at this date (in base currency)',
3147
+ example: '310098.00'
2981
3148
  },
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
3149
+ byCurrency: {
3150
+ description: 'Multi-currency breakdown for this point',
3151
+ type: 'array',
3152
+ items: {
3153
+ $ref: '#/components/schemas/CurrencyBalanceDto'
2990
3154
  }
3155
+ }
3156
+ },
3157
+ required: ['date', 'value']
3158
+ } as const;
3159
+
3160
+ export const $TrendSummaryDto = {
3161
+ type: 'object',
3162
+ properties: {
3163
+ startValue: {
3164
+ type: 'string',
3165
+ description: 'Value at start of period',
3166
+ example: '450000.00'
2991
3167
  },
2992
- createdAt: {
2993
- format: 'date-time',
3168
+ endValue: {
2994
3169
  type: 'string',
2995
- description: 'Creation timestamp',
2996
- example: '2024-11-03T10:00:00Z'
3170
+ description: 'Value at end of period',
3171
+ example: '500000.00'
2997
3172
  },
2998
- updatedAt: {
2999
- format: 'date-time',
3173
+ totalChange: {
3000
3174
  type: 'string',
3001
- description: 'Last update timestamp',
3002
- example: '2024-11-03T10:00:00Z'
3175
+ description: 'Total change over period',
3176
+ example: '50000.00'
3177
+ },
3178
+ totalChangePercentage: {
3179
+ type: 'string',
3180
+ description: 'Total change percentage',
3181
+ example: '+11.11%'
3003
3182
  }
3004
3183
  },
3005
- required: [
3006
- 'id',
3007
- 'userId',
3008
- 'currency',
3009
- 'quoteCurrency',
3010
- 'amount',
3011
- 'date',
3012
- 'meta',
3013
- 'createdAt',
3014
- 'updatedAt'
3015
- ]
3184
+ required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
3016
3185
  } as const;
3017
3186
 
3018
- export const $PriceListResponseDto = {
3187
+ export const $MultiCurrencyPointDto = {
3019
3188
  type: 'object',
3020
3189
  properties: {
3021
- items: {
3022
- description: 'List of prices',
3190
+ date: {
3191
+ type: 'string',
3192
+ description: 'Date in YYYY-MM-DD format',
3193
+ example: '2024-06-15'
3194
+ },
3195
+ byCurrency: {
3196
+ description: 'Balances by currency',
3023
3197
  type: 'array',
3024
3198
  items: {
3025
- $ref: '#/components/schemas/PriceResponseDto'
3199
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3026
3200
  }
3027
- },
3028
- total: {
3029
- type: 'number',
3030
- description: 'Total number of prices',
3031
- example: 42
3032
3201
  }
3033
3202
  },
3034
- required: ['items', 'total']
3203
+ required: ['date', 'byCurrency']
3035
3204
  } as const;
3036
3205
 
3037
- export const $UpdateBeanPriceDto = {
3206
+ export const $PortfolioTrendsResponseDto = {
3038
3207
  type: 'object',
3039
3208
  properties: {
3040
- currency: {
3041
- type: 'string',
3042
- description: 'Currency being priced'
3209
+ series: {
3210
+ description: 'Time series data points',
3211
+ type: 'array',
3212
+ items: {
3213
+ $ref: '#/components/schemas/TimeSeriesPointDto'
3214
+ }
3043
3215
  },
3044
- quoteCurrency: {
3216
+ summary: {
3217
+ description: 'Period summary',
3218
+ allOf: [
3219
+ {
3220
+ $ref: '#/components/schemas/TrendSummaryDto'
3221
+ }
3222
+ ]
3223
+ },
3224
+ period: {
3045
3225
  type: 'string',
3046
- description: 'Quote currency (pricing currency)'
3226
+ description: 'Period requested',
3227
+ example: '6m'
3047
3228
  },
3048
- amount: {
3049
- type: 'number',
3050
- description: 'Price amount (MUST be >= 0 per Beancount spec)',
3051
- minimum: 0
3229
+ granularity: {
3230
+ type: 'string',
3231
+ description: 'Data granularity',
3232
+ example: 'month'
3052
3233
  },
3053
- date: {
3234
+ currency: {
3054
3235
  type: 'string',
3055
- description: 'Price date (ISO 8601 format)'
3236
+ description: 'Base currency for converted values',
3237
+ example: 'CNY'
3056
3238
  },
3057
- metadata: {
3058
- type: 'object',
3059
- description: 'Metadata'
3239
+ byCurrency: {
3240
+ description:
3241
+ 'Multi-currency time series (each point has currency breakdown)',
3242
+ type: 'array',
3243
+ items: {
3244
+ $ref: '#/components/schemas/MultiCurrencyPointDto'
3245
+ }
3246
+ },
3247
+ warnings: {
3248
+ description: 'Exchange rate warnings',
3249
+ type: 'array',
3250
+ items: {
3251
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3252
+ }
3060
3253
  }
3061
- }
3254
+ },
3255
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3062
3256
  } as const;
3063
3257
 
3064
- export const $CreateRecurringRuleDto = {
3258
+ export const $CashFlowPointDto = {
3065
3259
  type: 'object',
3066
3260
  properties: {
3067
- name: {
3068
- type: 'string',
3069
- description: 'Rule name (unique per user)',
3070
- maxLength: 100
3071
- },
3072
- icon: {
3073
- type: 'string',
3074
- description: 'Icon emoji',
3075
- maxLength: 10
3076
- },
3077
- frequency: {
3261
+ month: {
3078
3262
  type: 'string',
3079
- description: 'Recurring frequency',
3080
- enum: [
3081
- 'WEEKLY',
3082
- 'BIWEEKLY',
3083
- 'MONTHLY',
3084
- 'BIMONTHLY',
3085
- 'QUARTERLY',
3086
- 'YEARLY',
3087
- 'CUSTOM'
3088
- ]
3089
- },
3090
- expectedAmount: {
3091
- type: 'number',
3092
- description: 'Expected amount (positive number)',
3093
- minimum: 0
3094
- },
3095
- expectedDay: {
3096
- type: 'number',
3097
- description: 'Expected day of month (1-31)',
3098
- minimum: 1,
3099
- maximum: 31
3100
- },
3101
- customIntervalDays: {
3102
- type: 'number',
3103
- description: 'Custom interval in days (required for CUSTOM frequency)',
3104
- minimum: 1
3263
+ description: 'Month key (YYYY-MM)',
3264
+ example: '2024-03'
3105
3265
  },
3106
- currency: {
3266
+ income: {
3107
3267
  type: 'string',
3108
- description: 'Currency code',
3109
- default: 'CNY',
3110
- maxLength: 10
3268
+ description: 'Income in base currency (absolute, converted)',
3269
+ example: '10000.00'
3111
3270
  },
3112
- matchPayeePattern: {
3271
+ expense: {
3113
3272
  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
3273
+ description: 'Expense in base currency (absolute, converted)',
3274
+ example: '5000.00'
3123
3275
  },
3124
- defaultExpenseAccount: {
3276
+ netSavings: {
3125
3277
  type: 'string',
3126
- description: 'Default expense account for auto-create',
3127
- maxLength: 200
3128
- },
3129
- defaultPaymentAccount: {
3278
+ description: 'netSavings = income − expense (savings positive)',
3279
+ example: '5000.00'
3280
+ }
3281
+ },
3282
+ required: ['month', 'income', 'expense', 'netSavings']
3283
+ } as const;
3284
+
3285
+ export const $CashFlowTrendSummaryDto = {
3286
+ type: 'object',
3287
+ properties: {
3288
+ totalIncome: {
3130
3289
  type: 'string',
3131
- description: 'Default payment account for auto-create',
3132
- maxLength: 200
3290
+ description: 'Total income across the period',
3291
+ example: '60000.00'
3133
3292
  },
3134
- defaultPayee: {
3293
+ totalExpense: {
3135
3294
  type: 'string',
3136
- description: 'Default payee for auto-create',
3137
- maxLength: 200
3138
- },
3139
- autoCreate: {
3140
- type: 'boolean',
3141
- description: 'Auto-create transaction when expected date arrives',
3142
- default: false
3295
+ description: 'Total expense across the period',
3296
+ example: '30000.00'
3143
3297
  },
3144
- startDate: {
3298
+ totalNetSavings: {
3145
3299
  type: 'string',
3146
- description: 'Rule start date (ISO format)'
3300
+ description: 'income − expense across the period',
3301
+ example: '30000.00'
3147
3302
  },
3148
- endDate: {
3303
+ averageMonthlyNetSavings: {
3149
3304
  type: 'string',
3150
- description: 'Rule end date (ISO format)'
3305
+ description:
3306
+ 'totalNetSavings divided by the window length (N months, incl. zero-filled)',
3307
+ example: '5000.00'
3151
3308
  }
3152
3309
  },
3153
3310
  required: [
3154
- 'name',
3155
- 'frequency',
3156
- 'expectedAmount',
3157
- 'currency',
3158
- 'matchAmountTolerance',
3159
- 'autoCreate'
3311
+ 'totalIncome',
3312
+ 'totalExpense',
3313
+ 'totalNetSavings',
3314
+ 'averageMonthlyNetSavings'
3160
3315
  ]
3161
3316
  } as const;
3162
3317
 
3163
- export const $RecurringRuleResponseDto = {
3318
+ export const $CashFlowTrendsResponseDto = {
3164
3319
  type: 'object',
3165
3320
  properties: {
3166
- id: {
3167
- type: 'string',
3168
- description: 'Rule ID'
3321
+ series: {
3322
+ description:
3323
+ 'Monthly cash-flow series (fixed N-month window, zero-filled)',
3324
+ type: 'array',
3325
+ items: {
3326
+ $ref: '#/components/schemas/CashFlowPointDto'
3327
+ }
3169
3328
  },
3170
- userId: {
3171
- type: 'string',
3172
- description: 'User ID'
3329
+ summary: {
3330
+ description: 'Period totals',
3331
+ allOf: [
3332
+ {
3333
+ $ref: '#/components/schemas/CashFlowTrendSummaryDto'
3334
+ }
3335
+ ]
3173
3336
  },
3174
- name: {
3337
+ period: {
3175
3338
  type: 'string',
3176
- description: 'Rule name'
3177
- },
3178
- icon: {
3179
- type: 'object',
3180
- description: 'Icon emoji'
3339
+ description: 'Period requested',
3340
+ example: '6m'
3181
3341
  },
3182
- frequency: {
3342
+ granularity: {
3183
3343
  type: 'string',
3184
- description: 'Recurring frequency'
3185
- },
3186
- expectedAmount: {
3187
- type: 'number',
3188
- description: 'Expected amount'
3189
- },
3190
- expectedDay: {
3191
- type: 'object',
3192
- description: 'Expected day of month'
3344
+ description: 'Data granularity (v1 returns month buckets)',
3345
+ example: 'month'
3193
3346
  },
3194
- customIntervalDays: {
3195
- type: 'object',
3196
- description: 'Custom interval in days'
3347
+ currency: {
3348
+ type: 'string',
3349
+ description: 'Base currency for converted values',
3350
+ example: 'CNY'
3197
3351
  },
3352
+ warnings: {
3353
+ description: 'Exchange rate warnings (e.g. missing rate for a currency)',
3354
+ type: 'array',
3355
+ items: {
3356
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3357
+ }
3358
+ }
3359
+ },
3360
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3361
+ } as const;
3362
+
3363
+ export const $GenerateSnapshotBody = {
3364
+ type: 'object',
3365
+ properties: {}
3366
+ } as const;
3367
+
3368
+ export const $GenerateSnapshotResponse = {
3369
+ type: 'object',
3370
+ properties: {}
3371
+ } as const;
3372
+
3373
+ export const $BackfillSnapshotsBody = {
3374
+ type: 'object',
3375
+ properties: {}
3376
+ } as const;
3377
+
3378
+ export const $BackfillSnapshotsResponse = {
3379
+ type: 'object',
3380
+ properties: {}
3381
+ } as const;
3382
+
3383
+ export const $CreateBeanPriceDto = {
3384
+ type: 'object',
3385
+ properties: {
3198
3386
  currency: {
3199
3387
  type: 'string',
3200
- description: 'Currency code'
3388
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
3389
+ example: 'USD'
3201
3390
  },
3202
- matchPayeePattern: {
3203
- type: 'object',
3204
- description: 'Payee matching pattern'
3391
+ quoteCurrency: {
3392
+ type: 'string',
3393
+ description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
3394
+ example: 'CNY'
3205
3395
  },
3206
- matchAmountTolerance: {
3396
+ amount: {
3207
3397
  type: 'number',
3208
- description: 'Amount tolerance percentage'
3398
+ description:
3399
+ 'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
3400
+ example: 175.5,
3401
+ minimum: 0
3209
3402
  },
3210
- defaultExpenseAccount: {
3211
- type: 'object',
3212
- description: 'Default expense account'
3403
+ date: {
3404
+ type: 'string',
3405
+ description: 'Price date (ISO 8601 format)',
3406
+ example: '2024-11-05'
3213
3407
  },
3214
- defaultPaymentAccount: {
3408
+ metadata: {
3215
3409
  type: 'object',
3216
- description: 'Default payment account'
3410
+ description:
3411
+ 'Metadata (validated by Zod schema, max field lengths enforced)',
3412
+ example: {
3413
+ source: 'MANUAL',
3414
+ note: 'Bank valuation report',
3415
+ confidence: 0.95
3416
+ }
3417
+ }
3418
+ },
3419
+ required: ['currency', 'quoteCurrency', 'amount', 'date']
3420
+ } as const;
3421
+
3422
+ export const $PriceResponseDto = {
3423
+ type: 'object',
3424
+ properties: {
3425
+ id: {
3426
+ type: 'string',
3427
+ description: 'Unique identifier',
3428
+ example: 'uuid-123-456'
3217
3429
  },
3218
- defaultPayee: {
3219
- type: 'object',
3220
- description: 'Default payee'
3430
+ userId: {
3431
+ type: 'string',
3432
+ description: 'User ID (owner of the price)',
3433
+ example: 'user-123'
3221
3434
  },
3222
- isActive: {
3223
- type: 'boolean',
3224
- description: 'Whether rule is active'
3435
+ currency: {
3436
+ type: 'string',
3437
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
3438
+ example: 'BTC'
3225
3439
  },
3226
- startDate: {
3440
+ quoteCurrency: {
3227
3441
  type: 'string',
3228
- description: 'Rule start date (YYYY-MM-DD)'
3442
+ description: 'Quote currency (pricing currency, e.g., USD, CNY)',
3443
+ example: 'USD'
3229
3444
  },
3230
- endDate: {
3231
- type: 'object',
3232
- description: 'Rule end date (YYYY-MM-DD)'
3445
+ amount: {
3446
+ type: 'number',
3447
+ description:
3448
+ 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
3449
+ example: 50000
3233
3450
  },
3234
- autoCreate: {
3235
- type: 'boolean',
3236
- description: 'Auto-create transaction on expected date'
3451
+ date: {
3452
+ type: 'string',
3453
+ description:
3454
+ 'Price date (ISO 8601 format). Represents the date this price was valid.',
3455
+ example: '2024-01-01',
3456
+ format: 'date'
3237
3457
  },
3238
- lastOccurrence: {
3458
+ meta: {
3239
3459
  type: 'object',
3240
- description: 'Last matched occurrence date (YYYY-MM-DD)'
3241
- },
3242
- totalCount: {
3243
- type: 'number',
3244
- description: 'Total matched transactions count'
3460
+ description:
3461
+ 'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
3462
+ example: {
3463
+ source: 'MANUAL',
3464
+ note: 'User-defined price',
3465
+ confidence: 1
3466
+ }
3245
3467
  },
3246
3468
  createdAt: {
3247
3469
  format: 'date-time',
3248
3470
  type: 'string',
3249
- description: 'Created at timestamp'
3471
+ description: 'Creation timestamp',
3472
+ example: '2024-11-03T10:00:00Z'
3250
3473
  },
3251
3474
  updatedAt: {
3252
3475
  format: 'date-time',
3253
3476
  type: 'string',
3254
- description: 'Updated at timestamp'
3477
+ description: 'Last update timestamp',
3478
+ example: '2024-11-03T10:00:00Z'
3255
3479
  }
3256
3480
  },
3257
3481
  required: [
3258
3482
  'id',
3259
3483
  'userId',
3260
- 'name',
3261
- 'frequency',
3262
- 'expectedAmount',
3263
3484
  'currency',
3264
- 'matchAmountTolerance',
3265
- 'isActive',
3266
- 'startDate',
3267
- 'autoCreate',
3268
- 'totalCount',
3485
+ 'quoteCurrency',
3486
+ 'amount',
3487
+ 'date',
3488
+ 'meta',
3269
3489
  'createdAt',
3270
3490
  'updatedAt'
3271
3491
  ]
3272
3492
  } as const;
3273
3493
 
3274
- export const $CreateRuleFromTransactionDto = {
3494
+ export const $PriceListResponseDto = {
3275
3495
  type: 'object',
3276
3496
  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
3497
+ items: {
3498
+ description: 'List of prices',
3499
+ type: 'array',
3500
+ items: {
3501
+ $ref: '#/components/schemas/PriceResponseDto'
3502
+ }
3295
3503
  },
3296
- icon: {
3297
- type: 'string',
3298
- description: 'Optional icon emoji',
3299
- maxLength: 10
3504
+ total: {
3505
+ type: 'number',
3506
+ description: 'Total number of prices',
3507
+ example: 42
3300
3508
  }
3301
3509
  },
3302
- required: ['frequency']
3510
+ required: ['items', 'total']
3303
3511
  } as const;
3304
3512
 
3305
- export const $RecurringRuleWithStatsResponseDto = {
3513
+ export const $UpdateBeanPriceDto = {
3306
3514
  type: 'object',
3307
3515
  properties: {
3308
- id: {
3309
- type: 'string',
3310
- description: 'Rule ID'
3311
- },
3312
- userId: {
3516
+ currency: {
3313
3517
  type: 'string',
3314
- description: 'User ID'
3518
+ description: 'Currency being priced'
3315
3519
  },
3316
- name: {
3520
+ quoteCurrency: {
3317
3521
  type: 'string',
3318
- description: 'Rule name'
3522
+ description: 'Quote currency (pricing currency)'
3319
3523
  },
3320
- icon: {
3321
- type: 'object',
3322
- description: 'Icon emoji'
3524
+ amount: {
3525
+ type: 'number',
3526
+ description: 'Price amount (MUST be >= 0 per Beancount spec)',
3527
+ minimum: 0
3323
3528
  },
3324
- frequency: {
3529
+ date: {
3325
3530
  type: 'string',
3326
- description: 'Recurring frequency'
3327
- },
3328
- expectedAmount: {
3329
- type: 'number',
3330
- description: 'Expected amount'
3531
+ description: 'Price date (ISO 8601 format)'
3331
3532
  },
3332
- expectedDay: {
3533
+ metadata: {
3333
3534
  type: 'object',
3334
- description: 'Expected day of month'
3335
- },
3336
- customIntervalDays: {
3337
- type: 'object',
3338
- description: 'Custom interval in days'
3535
+ description: 'Metadata'
3536
+ }
3537
+ }
3538
+ } as const;
3539
+
3540
+ export const $DeleteOwnUserDto = {
3541
+ type: 'object',
3542
+ properties: {
3543
+ accessToken: {
3544
+ type: 'string',
3545
+ description: 'Access token for user verification',
3546
+ example: 'abc123xyz'
3547
+ }
3548
+ },
3549
+ required: ['accessToken']
3550
+ } as const;
3551
+
3552
+ export const $UserSettingsResponseDto = {
3553
+ type: 'object',
3554
+ properties: {
3555
+ baseCurrency: {
3556
+ type: 'string',
3557
+ description:
3558
+ '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).',
3559
+ example: 'USD',
3560
+ nullable: true
3561
+ }
3562
+ },
3563
+ required: ['baseCurrency']
3564
+ } as const;
3565
+
3566
+ export const $UserResponseDto = {
3567
+ type: 'object',
3568
+ properties: {
3569
+ id: {
3570
+ type: 'string',
3571
+ description: 'User ID'
3339
3572
  },
3340
- currency: {
3573
+ role: {
3341
3574
  type: 'string',
3342
- description: 'Currency code'
3575
+ description: 'Assigned user role'
3343
3576
  },
3344
- matchPayeePattern: {
3345
- type: 'object',
3346
- description: 'Payee matching pattern'
3577
+ permissions: {
3578
+ description: 'Permission strings',
3579
+ type: 'array',
3580
+ items: {
3581
+ type: 'string'
3582
+ }
3347
3583
  },
3348
- matchAmountTolerance: {
3349
- type: 'number',
3350
- description: 'Amount tolerance percentage'
3584
+ settings: {
3585
+ description: 'User settings',
3586
+ allOf: [
3587
+ {
3588
+ $ref: '#/components/schemas/UserSettingsResponseDto'
3589
+ }
3590
+ ]
3591
+ }
3592
+ },
3593
+ required: ['id', 'role', 'permissions', 'settings']
3594
+ } as const;
3595
+
3596
+ export const $SignupDto = {
3597
+ type: 'object',
3598
+ properties: {
3599
+ turnstileToken: {
3600
+ type: 'string',
3601
+ description:
3602
+ 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
3603
+ example: '0.abc123def456...'
3604
+ }
3605
+ }
3606
+ } as const;
3607
+
3608
+ export const $SignupResponseDto = {
3609
+ type: 'object',
3610
+ properties: {
3611
+ authToken: {
3612
+ type: 'string',
3613
+ description: 'JWT auth token',
3614
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
3351
3615
  },
3352
- defaultExpenseAccount: {
3353
- type: 'object',
3354
- description: 'Default expense account'
3616
+ accessToken: {
3617
+ type: 'string',
3618
+ description: 'Auto-generated access token'
3355
3619
  },
3356
- defaultPaymentAccount: {
3357
- type: 'object',
3358
- description: 'Default payment account'
3620
+ role: {
3621
+ type: 'string',
3622
+ description: 'Assigned user role',
3623
+ enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
3624
+ }
3625
+ },
3626
+ required: ['authToken', 'accessToken', 'role']
3627
+ } as const;
3628
+
3629
+ export const $UpdateUserSettingDto = {
3630
+ type: 'object',
3631
+ properties: {
3632
+ secId: {
3633
+ type: 'number',
3634
+ description: 'Security ID'
3359
3635
  },
3360
- defaultPayee: {
3361
- type: 'object',
3362
- description: 'Default payee'
3636
+ annualInterestRate: {
3637
+ type: 'number',
3638
+ description: 'Annual interest rate',
3639
+ example: 0.05
3363
3640
  },
3364
- isActive: {
3365
- type: 'boolean',
3366
- description: 'Whether rule is active'
3641
+ currency: {
3642
+ type: 'string',
3643
+ description: 'Currency code',
3644
+ example: 'USD'
3367
3645
  },
3368
- startDate: {
3646
+ baseCurrency: {
3369
3647
  type: 'string',
3370
- description: 'Rule start date (YYYY-MM-DD)'
3648
+ description: 'Base currency code',
3649
+ example: 'USD'
3371
3650
  },
3372
- endDate: {
3373
- type: 'object',
3374
- description: 'Rule end date (YYYY-MM-DD)'
3651
+ benchmark: {
3652
+ type: 'string',
3653
+ description: 'Benchmark symbol',
3654
+ example: 'SPY'
3375
3655
  },
3376
- autoCreate: {
3377
- type: 'boolean',
3378
- description: 'Auto-create transaction on expected date'
3656
+ colorScheme: {
3657
+ type: 'string',
3658
+ description: 'Color scheme',
3659
+ enum: ['DARK', 'LIGHT']
3379
3660
  },
3380
- lastOccurrence: {
3381
- type: 'object',
3382
- description: 'Last matched occurrence date (YYYY-MM-DD)'
3661
+ dateRange: {
3662
+ type: 'string',
3663
+ description: 'Date range filter',
3664
+ example: '1y'
3383
3665
  },
3384
- totalCount: {
3666
+ emergencyFund: {
3385
3667
  type: 'number',
3386
- description: 'Total matched transactions count'
3668
+ description: 'Emergency fund amount',
3669
+ example: 10000
3387
3670
  },
3388
- createdAt: {
3389
- format: 'date-time',
3671
+ 'filters.accounts': {
3672
+ description: 'Account filter IDs',
3673
+ type: 'array',
3674
+ items: {
3675
+ type: 'string'
3676
+ }
3677
+ },
3678
+ 'filters.assetClasses': {
3679
+ description: 'Asset class filters',
3680
+ type: 'array',
3681
+ items: {
3682
+ type: 'string'
3683
+ }
3684
+ },
3685
+ 'filters.dataSource': {
3390
3686
  type: 'string',
3391
- description: 'Created at timestamp'
3687
+ description: 'Data source filter'
3392
3688
  },
3393
- updatedAt: {
3394
- format: 'date-time',
3689
+ 'filters.symbol': {
3395
3690
  type: 'string',
3396
- description: 'Updated at timestamp'
3691
+ description: 'Symbol filter'
3397
3692
  },
3398
- pendingCount: {
3399
- type: 'number',
3400
- description: 'Number of pending expected transactions'
3693
+ 'filters.tags': {
3694
+ description: 'Tag filters',
3695
+ type: 'array',
3696
+ items: {
3697
+ type: 'string'
3698
+ }
3401
3699
  },
3402
- overdueCount: {
3403
- type: 'number',
3404
- description: 'Number of overdue expected transactions'
3700
+ isExperimentalFeatures: {
3701
+ type: 'boolean',
3702
+ description: 'Enable experimental features'
3405
3703
  },
3406
- nextExpectedDate: {
3407
- type: 'object',
3408
- description: 'Next expected date (YYYY-MM-DD)'
3704
+ isRestrictedView: {
3705
+ type: 'boolean',
3706
+ description: 'Enable restricted view mode'
3409
3707
  },
3410
- totalAmount: {
3411
- type: 'number',
3412
- description: 'Total amount of all matched transactions'
3708
+ language: {
3709
+ type: 'string',
3710
+ description: 'Language code',
3711
+ example: 'en'
3413
3712
  },
3414
- averageAmount: {
3415
- type: 'number',
3416
- description: 'Average amount per transaction'
3713
+ locale: {
3714
+ type: 'string',
3715
+ description: 'Locale code',
3716
+ example: 'en-US'
3417
3717
  },
3418
- transactionCount: {
3718
+ projectedTotalAmount: {
3419
3719
  type: 'number',
3420
- description: 'Number of matched transactions'
3421
- },
3422
- firstDate: {
3423
- type: 'object',
3424
- description: 'First matched transaction date (YYYY-MM-DD)'
3720
+ description: 'Projected total amount',
3721
+ example: 1000000
3425
3722
  },
3426
- lastDate: {
3427
- type: 'object',
3428
- description: 'Last matched transaction date (YYYY-MM-DD)'
3723
+ retirementDate: {
3724
+ type: 'string',
3725
+ description: 'Retirement date in ISO 8601 format',
3726
+ example: '2050-01-01'
3429
3727
  },
3430
- variance: {
3728
+ savingsRate: {
3431
3729
  type: 'number',
3432
- description: 'Amount variance (standard deviation squared)'
3730
+ description: 'Savings rate percentage',
3731
+ example: 0.2
3433
3732
  },
3434
- upcomingCount: {
3435
- type: 'number',
3436
- description: 'Number of upcoming expected transactions'
3733
+ viewMode: {
3734
+ type: 'string',
3735
+ description: 'View mode',
3736
+ enum: ['DEFAULT', 'ZEN']
3737
+ }
3738
+ }
3739
+ } as const;
3740
+
3741
+ export const $UpdatePropertyDto = {
3742
+ type: 'object',
3743
+ properties: {
3744
+ value: {
3745
+ type: 'string',
3746
+ description: 'Property value'
3437
3747
  }
3438
3748
  },
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
- ]
3749
+ required: ['value']
3461
3750
  } as const;
3462
3751
 
3463
- export const $UpdateRecurringRuleDto = {
3752
+ export const $CreateRecurringRuleDto = {
3464
3753
  type: 'object',
3465
3754
  properties: {
3466
3755
  name: {
3467
3756
  type: 'string',
3468
- description: 'Rule name',
3757
+ description: 'Rule name (unique per user)',
3469
3758
  maxLength: 100
3470
3759
  },
3471
3760
  icon: {
@@ -3488,7 +3777,7 @@ export const $UpdateRecurringRuleDto = {
3488
3777
  },
3489
3778
  expectedAmount: {
3490
3779
  type: 'number',
3491
- description: 'Expected amount',
3780
+ description: 'Expected amount (positive number)',
3492
3781
  minimum: 0
3493
3782
  },
3494
3783
  expectedDay: {
@@ -3499,7 +3788,7 @@ export const $UpdateRecurringRuleDto = {
3499
3788
  },
3500
3789
  customIntervalDays: {
3501
3790
  type: 'number',
3502
- description: 'Custom interval in days',
3791
+ description: 'Custom interval in days (required for CUSTOM frequency)',
3503
3792
  minimum: 1
3504
3793
  },
3505
3794
  currency: {
@@ -3509,118 +3798,136 @@ export const $UpdateRecurringRuleDto = {
3509
3798
  },
3510
3799
  matchPayeePattern: {
3511
3800
  type: 'string',
3512
- description: 'Payee matching pattern',
3801
+ description: 'Payee matching pattern (supports wildcards)',
3513
3802
  maxLength: 200
3514
3803
  },
3515
3804
  matchAmountTolerance: {
3516
3805
  type: 'number',
3517
3806
  description: 'Amount tolerance percentage (0-1)',
3807
+ default: 0.075,
3518
3808
  minimum: 0,
3519
3809
  maximum: 1
3520
3810
  },
3521
3811
  defaultExpenseAccount: {
3522
3812
  type: 'string',
3523
- description: 'Default expense account',
3813
+ description: 'Default expense account for auto-create',
3524
3814
  maxLength: 200
3525
3815
  },
3526
3816
  defaultPaymentAccount: {
3527
3817
  type: 'string',
3528
- description: 'Default payment account',
3818
+ description: 'Default payment account for auto-create',
3529
3819
  maxLength: 200
3530
3820
  },
3531
3821
  defaultPayee: {
3532
3822
  type: 'string',
3533
- description: 'Default payee',
3823
+ description: 'Default payee for auto-create',
3534
3824
  maxLength: 200
3535
3825
  },
3536
3826
  autoCreate: {
3537
3827
  type: 'boolean',
3538
- description: 'Auto-create transaction'
3828
+ description: 'Auto-create transaction when expected date arrives',
3829
+ default: false
3539
3830
  },
3540
- isActive: {
3541
- type: 'boolean',
3542
- description: 'Rule active status'
3831
+ startDate: {
3832
+ type: 'string',
3833
+ description: 'Rule start date (ISO format)'
3543
3834
  },
3544
3835
  endDate: {
3545
3836
  type: 'string',
3546
3837
  description: 'Rule end date (ISO format)'
3547
3838
  }
3548
- }
3839
+ },
3840
+ required: [
3841
+ 'name',
3842
+ 'frequency',
3843
+ 'expectedAmount',
3844
+ 'matchAmountTolerance',
3845
+ 'autoCreate'
3846
+ ]
3549
3847
  } as const;
3550
3848
 
3551
- export const $ExpectedTransactionRuleDto = {
3849
+ export const $RecurringRuleResponseDto = {
3552
3850
  type: 'object',
3553
3851
  properties: {
3852
+ id: {
3853
+ type: 'string',
3854
+ description: 'Rule ID'
3855
+ },
3856
+ userId: {
3857
+ type: 'string',
3858
+ description: 'User ID'
3859
+ },
3554
3860
  name: {
3555
3861
  type: 'string',
3556
3862
  description: 'Rule name'
3557
3863
  },
3558
3864
  icon: {
3559
- type: 'object',
3560
- description: 'Rule icon'
3865
+ type: 'string',
3866
+ description: 'Icon emoji'
3561
3867
  },
3562
3868
  frequency: {
3563
3869
  type: 'string',
3564
- description: 'Rule frequency'
3870
+ description: 'Recurring frequency'
3871
+ },
3872
+ expectedAmount: {
3873
+ type: 'number',
3874
+ description: 'Expected amount'
3875
+ },
3876
+ expectedDay: {
3877
+ type: 'number',
3878
+ description: 'Expected day of month'
3879
+ },
3880
+ customIntervalDays: {
3881
+ type: 'number',
3882
+ description: 'Custom interval in days'
3565
3883
  },
3566
3884
  currency: {
3567
3885
  type: 'string',
3568
3886
  description: 'Currency code'
3569
- }
3570
- },
3571
- required: ['name', 'frequency', 'currency']
3572
- } as const;
3573
-
3574
- export const $ExpectedTransactionResponseDto = {
3575
- type: 'object',
3576
- properties: {
3577
- id: {
3578
- type: 'string',
3579
- description: 'Expected transaction ID'
3580
3887
  },
3581
- userId: {
3888
+ matchPayeePattern: {
3582
3889
  type: 'string',
3583
- description: 'User ID'
3890
+ description: 'Payee matching pattern'
3584
3891
  },
3585
- ruleId: {
3586
- type: 'string',
3587
- description: 'Associated rule ID'
3892
+ matchAmountTolerance: {
3893
+ type: 'number',
3894
+ description: 'Amount tolerance percentage'
3588
3895
  },
3589
- expectedDate: {
3896
+ defaultExpenseAccount: {
3590
3897
  type: 'string',
3591
- description: 'Expected date (YYYY-MM-DD)'
3898
+ description: 'Default expense account'
3592
3899
  },
3593
- expectedAmount: {
3594
- type: 'number',
3595
- description: 'Expected amount'
3900
+ defaultPaymentAccount: {
3901
+ type: 'string',
3902
+ description: 'Default payment account'
3596
3903
  },
3597
- status: {
3904
+ defaultPayee: {
3598
3905
  type: 'string',
3599
- description: 'Status (PENDING, COMPLETED, SKIPPED)'
3906
+ description: 'Default payee'
3600
3907
  },
3601
- matchedTransactionId: {
3602
- type: 'object',
3603
- description: 'Matched transaction ID'
3908
+ isActive: {
3909
+ type: 'boolean',
3910
+ description: 'Whether rule is active'
3604
3911
  },
3605
- matchedAt: {
3606
- type: 'object',
3607
- description: 'Match timestamp (ISO 8601)'
3912
+ startDate: {
3913
+ type: 'string',
3914
+ description: 'Rule start date (YYYY-MM-DD)'
3608
3915
  },
3609
- matchConfidence: {
3610
- type: 'object',
3611
- description: 'Match confidence score (0-1)'
3916
+ endDate: {
3917
+ type: 'string',
3918
+ description: 'Rule end date (YYYY-MM-DD)'
3612
3919
  },
3613
- isOverdue: {
3920
+ autoCreate: {
3614
3921
  type: 'boolean',
3615
- description: 'Whether this expected transaction is overdue'
3922
+ description: 'Auto-create transaction on expected date'
3616
3923
  },
3617
- rule: {
3618
- description: 'Rule information',
3619
- allOf: [
3620
- {
3621
- $ref: '#/components/schemas/ExpectedTransactionRuleDto'
3622
- }
3623
- ]
3924
+ lastOccurrence: {
3925
+ type: 'string',
3926
+ description: 'Last matched occurrence date (YYYY-MM-DD)'
3927
+ },
3928
+ totalCount: {
3929
+ type: 'number',
3930
+ description: 'Total matched transactions count'
3624
3931
  },
3625
3932
  createdAt: {
3626
3933
  format: 'date-time',
@@ -3636,647 +3943,581 @@ export const $ExpectedTransactionResponseDto = {
3636
3943
  required: [
3637
3944
  'id',
3638
3945
  'userId',
3639
- 'ruleId',
3640
- 'expectedDate',
3946
+ 'name',
3947
+ 'frequency',
3641
3948
  'expectedAmount',
3642
- 'status',
3643
- 'isOverdue',
3644
- 'rule',
3949
+ 'currency',
3950
+ 'matchAmountTolerance',
3951
+ 'isActive',
3952
+ 'startDate',
3953
+ 'autoCreate',
3954
+ 'totalCount',
3645
3955
  'createdAt',
3646
3956
  'updatedAt'
3647
3957
  ]
3648
3958
  } as const;
3649
3959
 
3650
- export const $ExpectedTransactionListResponseDto = {
3960
+ export const $CreateRuleFromTransactionDto = {
3651
3961
  type: 'object',
3652
3962
  properties: {
3653
- items: {
3654
- type: 'array',
3655
- items: {
3656
- $ref: '#/components/schemas/ExpectedTransactionResponseDto'
3657
- }
3963
+ frequency: {
3964
+ type: 'string',
3965
+ description: 'Recurring frequency',
3966
+ enum: [
3967
+ 'WEEKLY',
3968
+ 'BIWEEKLY',
3969
+ 'MONTHLY',
3970
+ 'BIMONTHLY',
3971
+ 'QUARTERLY',
3972
+ 'YEARLY',
3973
+ 'CUSTOM'
3974
+ ],
3975
+ example: 'MONTHLY'
3658
3976
  },
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: {
3977
+ name: {
3671
3978
  type: 'string',
3672
- description: 'Transaction ID to match with'
3979
+ description: 'Optional name override (default: transaction payee)',
3980
+ maxLength: 100
3981
+ },
3982
+ icon: {
3983
+ type: 'string',
3984
+ description: 'Optional icon emoji',
3985
+ maxLength: 10
3673
3986
  }
3674
3987
  },
3675
- required: ['transactionId']
3988
+ required: ['frequency']
3676
3989
  } as const;
3677
3990
 
3678
- export const $EnterNowDto = {
3991
+ export const $RecurringRuleWithStatsResponseDto = {
3679
3992
  type: 'object',
3680
3993
  properties: {
3681
- expenseAccount: {
3994
+ id: {
3995
+ type: 'string',
3996
+ description: 'Rule ID'
3997
+ },
3998
+ userId: {
3999
+ type: 'string',
4000
+ description: 'User ID'
4001
+ },
4002
+ name: {
4003
+ type: 'string',
4004
+ description: 'Rule name'
4005
+ },
4006
+ icon: {
4007
+ type: 'string',
4008
+ description: 'Icon emoji'
4009
+ },
4010
+ frequency: {
4011
+ type: 'string',
4012
+ description: 'Recurring frequency'
4013
+ },
4014
+ expectedAmount: {
4015
+ type: 'number',
4016
+ description: 'Expected amount'
4017
+ },
4018
+ expectedDay: {
4019
+ type: 'number',
4020
+ description: 'Expected day of month'
4021
+ },
4022
+ customIntervalDays: {
4023
+ type: 'number',
4024
+ description: 'Custom interval in days'
4025
+ },
4026
+ currency: {
3682
4027
  type: 'string',
3683
- description:
3684
- 'Override expense account (uses rule default if not provided)',
3685
- maxLength: 200
4028
+ description: 'Currency code'
3686
4029
  },
3687
- paymentAccount: {
4030
+ matchPayeePattern: {
3688
4031
  type: 'string',
3689
- description:
3690
- 'Override payment account (uses rule default if not provided)',
3691
- maxLength: 200
4032
+ description: 'Payee matching pattern'
3692
4033
  },
3693
- amount: {
4034
+ matchAmountTolerance: {
3694
4035
  type: 'number',
3695
- description: 'Override amount (uses expected amount if not provided)',
3696
- minimum: 0
4036
+ description: 'Amount tolerance percentage'
3697
4037
  },
3698
- payee: {
4038
+ defaultExpenseAccount: {
3699
4039
  type: 'string',
3700
- description: 'Override payee (uses rule default if not provided)',
3701
- maxLength: 200
4040
+ description: 'Default expense account'
3702
4041
  },
3703
- narration: {
3704
- type: 'string',
3705
- description: 'Optional narration',
3706
- maxLength: 500
3707
- }
3708
- }
3709
- } as const;
3710
-
3711
- export const $ForecastItemDto = {
3712
- type: 'object',
3713
- properties: {
3714
- rule: {
4042
+ defaultPaymentAccount: {
3715
4043
  type: 'string',
3716
- description: 'Rule name',
3717
- example: 'Rent'
4044
+ description: 'Default payment account'
3718
4045
  },
3719
- ruleId: {
4046
+ defaultPayee: {
3720
4047
  type: 'string',
3721
- description: 'Rule ID',
3722
- example: 'clx123...'
4048
+ description: 'Default payee'
3723
4049
  },
3724
- amount: {
3725
- type: 'number',
3726
- description: 'Expected amount',
3727
- example: 3000
4050
+ isActive: {
4051
+ type: 'boolean',
4052
+ description: 'Whether rule is active'
3728
4053
  },
3729
- date: {
4054
+ startDate: {
3730
4055
  type: 'string',
3731
- description: 'Expected date (YYYY-MM-DD)',
3732
- example: '2024-04-01'
4056
+ description: 'Rule start date (YYYY-MM-DD)'
3733
4057
  },
3734
- icon: {
4058
+ endDate: {
3735
4059
  type: 'string',
3736
- description: 'Rule icon emoji',
3737
- example: '🏠',
3738
- nullable: true
4060
+ description: 'Rule end date (YYYY-MM-DD)'
3739
4061
  },
3740
- currency: {
3741
- type: 'string',
3742
- description: 'Currency code',
3743
- example: 'CNY'
3744
- }
3745
- },
3746
- required: ['rule', 'ruleId', 'amount', 'date', 'icon', 'currency']
3747
- } as const;
3748
-
3749
- export const $MonthlyForecastDto = {
3750
- type: 'object',
3751
- properties: {
3752
- month: {
4062
+ autoCreate: {
4063
+ type: 'boolean',
4064
+ description: 'Auto-create transaction on expected date'
4065
+ },
4066
+ lastOccurrence: {
3753
4067
  type: 'string',
3754
- description: 'Month (YYYY-MM)',
3755
- example: '2024-04'
4068
+ description: 'Last matched occurrence date (YYYY-MM-DD)'
3756
4069
  },
3757
- expectedOutflow: {
4070
+ totalCount: {
3758
4071
  type: 'number',
3759
- description: 'Total expected outflow for the month',
3760
- example: 8500
4072
+ description: 'Total matched transactions count'
3761
4073
  },
3762
- itemCount: {
4074
+ createdAt: {
4075
+ format: 'date-time',
4076
+ type: 'string',
4077
+ description: 'Created at timestamp'
4078
+ },
4079
+ updatedAt: {
4080
+ format: 'date-time',
4081
+ type: 'string',
4082
+ description: 'Updated at timestamp'
4083
+ },
4084
+ pendingCount: {
3763
4085
  type: 'number',
3764
- description: 'Number of expected transactions',
3765
- example: 3
4086
+ description: 'Number of pending expected transactions'
3766
4087
  },
3767
- byCurrency: {
3768
- type: 'object',
3769
- description: 'Breakdown by currency',
3770
- example: {
3771
- CNY: 8500,
3772
- USD: 100
3773
- }
4088
+ overdueCount: {
4089
+ type: 'number',
4090
+ description: 'Number of overdue expected transactions'
3774
4091
  },
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
- }
4092
+ nextExpectedDate: {
4093
+ type: 'string',
4094
+ description: 'Next expected date (YYYY-MM-DD)'
3795
4095
  },
3796
- totalOutflow: {
4096
+ totalAmount: {
3797
4097
  type: 'number',
3798
- description: 'Total expected outflow across all months',
3799
- example: 25500
4098
+ description: 'Total amount of all matched transactions'
3800
4099
  },
3801
- totalByCurrency: {
3802
- type: 'object',
3803
- description: 'Total by currency across all months',
3804
- example: {
3805
- CNY: 25500,
3806
- USD: 300
3807
- }
4100
+ averageAmount: {
4101
+ type: 'number',
4102
+ description: 'Average amount per transaction'
3808
4103
  },
3809
- rulesCount: {
4104
+ transactionCount: {
3810
4105
  type: 'number',
3811
- description: 'Number of active recurring rules included',
3812
- example: 5
4106
+ description: 'Number of matched transactions'
3813
4107
  },
3814
- periodStart: {
4108
+ firstDate: {
3815
4109
  type: 'string',
3816
- description: 'Forecast period start date',
3817
- example: '2024-04-01'
4110
+ description: 'First matched transaction date (YYYY-MM-DD)'
3818
4111
  },
3819
- periodEnd: {
4112
+ lastDate: {
3820
4113
  type: 'string',
3821
- description: 'Forecast period end date',
3822
- example: '2024-06-30'
4114
+ description: 'Last matched transaction date (YYYY-MM-DD)'
4115
+ },
4116
+ variance: {
4117
+ type: 'number',
4118
+ description: 'Amount variance (standard deviation squared)'
4119
+ },
4120
+ upcomingCount: {
4121
+ type: 'number',
4122
+ description: 'Number of upcoming expected transactions'
3823
4123
  }
3824
4124
  },
3825
4125
  required: [
3826
- 'forecast',
3827
- 'totalOutflow',
3828
- 'totalByCurrency',
3829
- 'rulesCount',
3830
- 'periodStart',
3831
- 'periodEnd'
4126
+ 'id',
4127
+ 'userId',
4128
+ 'name',
4129
+ 'frequency',
4130
+ 'expectedAmount',
4131
+ 'currency',
4132
+ 'matchAmountTolerance',
4133
+ 'isActive',
4134
+ 'startDate',
4135
+ 'autoCreate',
4136
+ 'totalCount',
4137
+ 'createdAt',
4138
+ 'updatedAt',
4139
+ 'pendingCount',
4140
+ 'overdueCount',
4141
+ 'totalAmount',
4142
+ 'averageAmount',
4143
+ 'transactionCount',
4144
+ 'variance',
4145
+ 'upcomingCount'
3832
4146
  ]
3833
4147
  } as const;
3834
4148
 
3835
- export const $CurrencyBalanceDto = {
4149
+ export const $UpdateRecurringRuleDto = {
3836
4150
  type: 'object',
3837
4151
  properties: {
3838
- currency: {
4152
+ name: {
3839
4153
  type: 'string',
3840
- description: 'ISO 4217 currency code',
3841
- example: 'CNY'
4154
+ description: 'Rule name (unique per user)',
4155
+ maxLength: 100
3842
4156
  },
3843
- balance: {
4157
+ icon: {
3844
4158
  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: {
4159
+ description: 'Icon emoji',
4160
+ maxLength: 10
4161
+ },
4162
+ frequency: {
3856
4163
  type: 'string',
3857
- description: 'Date in YYYY-MM-DD format',
3858
- example: '2024-06-15'
4164
+ description: 'Recurring frequency',
4165
+ enum: [
4166
+ 'WEEKLY',
4167
+ 'BIWEEKLY',
4168
+ 'MONTHLY',
4169
+ 'BIMONTHLY',
4170
+ 'QUARTERLY',
4171
+ 'YEARLY',
4172
+ 'CUSTOM'
4173
+ ]
4174
+ },
4175
+ expectedAmount: {
4176
+ type: 'number',
4177
+ description: 'Expected amount (positive number)',
4178
+ minimum: 0
4179
+ },
4180
+ expectedDay: {
4181
+ type: 'number',
4182
+ description: 'Expected day of month (1-31)',
4183
+ minimum: 1,
4184
+ maximum: 31
4185
+ },
4186
+ currency: {
4187
+ type: 'string',
4188
+ description: 'Currency code',
4189
+ maxLength: 10
3859
4190
  },
3860
- value: {
4191
+ matchPayeePattern: {
3861
4192
  type: 'string',
3862
- description: 'Value at this date (in base currency)',
3863
- example: '500000.00'
4193
+ description: 'Payee matching pattern (supports wildcards)',
4194
+ maxLength: 200
3864
4195
  },
3865
- change: {
3866
- type: 'object',
3867
- description: 'Change from previous point',
3868
- example: '5000.00'
4196
+ matchAmountTolerance: {
4197
+ type: 'number',
4198
+ description: 'Amount tolerance percentage (0-1)',
4199
+ default: 0.075,
4200
+ minimum: 0,
4201
+ maximum: 1
3869
4202
  },
3870
- assets: {
4203
+ defaultExpenseAccount: {
3871
4204
  type: 'string',
3872
- description: 'Total assets at this date (in base currency)',
3873
- example: '494338.00'
4205
+ description: 'Default expense account for auto-create',
4206
+ maxLength: 200
3874
4207
  },
3875
- liabilities: {
4208
+ defaultPaymentAccount: {
3876
4209
  type: 'string',
3877
- description: 'Total liabilities at this date (in base currency)',
3878
- example: '310098.00'
4210
+ description: 'Default payment account for auto-create',
4211
+ maxLength: 200
3879
4212
  },
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: {
4213
+ defaultPayee: {
3895
4214
  type: 'string',
3896
- description: 'Value at start of period',
3897
- example: '450000.00'
4215
+ description: 'Default payee for auto-create',
4216
+ maxLength: 200
3898
4217
  },
3899
- endValue: {
3900
- type: 'string',
3901
- description: 'Value at end of period',
3902
- example: '500000.00'
4218
+ autoCreate: {
4219
+ type: 'boolean',
4220
+ description: 'Auto-create transaction when expected date arrives',
4221
+ default: false
3903
4222
  },
3904
- totalChange: {
4223
+ endDate: {
3905
4224
  type: 'string',
3906
- description: 'Total change over period',
3907
- example: '50000.00'
4225
+ description: 'Rule end date (ISO format)'
3908
4226
  },
3909
- totalChangePercentage: {
3910
- 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: {
3922
- type: 'string',
3923
- description: 'Date in YYYY-MM-DD format',
3924
- example: '2024-06-15'
4227
+ customIntervalDays: {
4228
+ type: 'number',
4229
+ description: 'Custom interval in days',
4230
+ minimum: 1
3925
4231
  },
3926
- byCurrency: {
3927
- description: 'Balances by currency',
3928
- type: 'array',
3929
- items: {
3930
- $ref: '#/components/schemas/CurrencyBalanceDto'
3931
- }
4232
+ isActive: {
4233
+ type: 'boolean',
4234
+ description: 'Rule active status'
3932
4235
  }
3933
- },
3934
- required: ['date', 'byCurrency']
4236
+ }
3935
4237
  } as const;
3936
4238
 
3937
- export const $PortfolioTrendsResponseDto = {
4239
+ export const $ExpectedTransactionRuleDto = {
3938
4240
  type: 'object',
3939
4241
  properties: {
3940
- series: {
3941
- description: 'Time series data points',
3942
- type: 'array',
3943
- items: {
3944
- $ref: '#/components/schemas/TimeSeriesPointDto'
3945
- }
3946
- },
3947
- summary: {
3948
- description: 'Period summary',
3949
- allOf: [
3950
- {
3951
- $ref: '#/components/schemas/TrendSummaryDto'
3952
- }
3953
- ]
4242
+ name: {
4243
+ type: 'string',
4244
+ description: 'Rule name'
3954
4245
  },
3955
- period: {
4246
+ icon: {
3956
4247
  type: 'string',
3957
- description: 'Period requested',
3958
- example: '6m'
4248
+ description: 'Rule icon'
3959
4249
  },
3960
- granularity: {
4250
+ frequency: {
3961
4251
  type: 'string',
3962
- description: 'Data granularity',
3963
- example: 'month'
4252
+ description: 'Rule frequency'
3964
4253
  },
3965
4254
  currency: {
3966
4255
  type: 'string',
3967
- description: 'Base currency for converted values',
3968
- example: 'CNY'
3969
- },
3970
- byCurrency: {
3971
- description:
3972
- 'Multi-currency time series (each point has currency breakdown)',
3973
- type: 'array',
3974
- items: {
3975
- $ref: '#/components/schemas/MultiCurrencyPointDto'
3976
- }
3977
- },
3978
- warnings: {
3979
- description: 'Exchange rate warnings',
3980
- type: 'array',
3981
- items: {
3982
- $ref: '#/components/schemas/ExchangeRateWarningDto'
3983
- }
4256
+ description: 'Currency code'
3984
4257
  }
3985
4258
  },
3986
- required: ['series', 'summary', 'period', 'granularity', 'currency']
4259
+ required: ['name', 'frequency', 'currency']
3987
4260
  } as const;
3988
4261
 
3989
- export const $CashFlowPointDto = {
4262
+ export const $ExpectedTransactionResponseDto = {
3990
4263
  type: 'object',
3991
4264
  properties: {
3992
- month: {
4265
+ id: {
3993
4266
  type: 'string',
3994
- description: 'Month key (YYYY-MM)',
3995
- example: '2024-03'
4267
+ description: 'Expected transaction ID'
3996
4268
  },
3997
- income: {
4269
+ userId: {
3998
4270
  type: 'string',
3999
- description: 'Income in base currency (absolute, converted)',
4000
- example: '10000.00'
4271
+ description: 'User ID'
4001
4272
  },
4002
- expense: {
4273
+ ruleId: {
4003
4274
  type: 'string',
4004
- description: 'Expense in base currency (absolute, converted)',
4005
- example: '5000.00'
4275
+ description: 'Associated rule ID'
4006
4276
  },
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: {
4277
+ expectedDate: {
4020
4278
  type: 'string',
4021
- description: 'Total income across the period',
4022
- example: '60000.00'
4279
+ description: 'Expected date (YYYY-MM-DD)'
4023
4280
  },
4024
- totalExpense: {
4281
+ expectedAmount: {
4282
+ type: 'number',
4283
+ description: 'Expected amount'
4284
+ },
4285
+ status: {
4025
4286
  type: 'string',
4026
- description: 'Total expense across the period',
4027
- example: '30000.00'
4287
+ description: 'Status (PENDING, COMPLETED, SKIPPED)'
4028
4288
  },
4029
- totalNetSavings: {
4289
+ matchedTransactionId: {
4030
4290
  type: 'string',
4031
- description: 'income − expense across the period',
4032
- example: '30000.00'
4291
+ description: 'Matched transaction ID'
4033
4292
  },
4034
- averageMonthlyNetSavings: {
4293
+ matchedAt: {
4035
4294
  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
- }
4295
+ description: 'Match timestamp (ISO 8601)'
4059
4296
  },
4060
- summary: {
4061
- description: 'Period totals',
4297
+ matchConfidence: {
4298
+ type: 'number',
4299
+ description: 'Match confidence score (0-1)'
4300
+ },
4301
+ isOverdue: {
4302
+ type: 'boolean',
4303
+ description: 'Whether this expected transaction is overdue'
4304
+ },
4305
+ rule: {
4306
+ description: 'Rule information',
4062
4307
  allOf: [
4063
4308
  {
4064
- $ref: '#/components/schemas/CashFlowTrendSummaryDto'
4309
+ $ref: '#/components/schemas/ExpectedTransactionRuleDto'
4065
4310
  }
4066
4311
  ]
4067
4312
  },
4068
- period: {
4069
- type: 'string',
4070
- description: 'Period requested',
4071
- example: '6m'
4072
- },
4073
- granularity: {
4313
+ createdAt: {
4314
+ format: 'date-time',
4074
4315
  type: 'string',
4075
- description: 'Data granularity (v1 returns month buckets)',
4076
- example: 'month'
4316
+ description: 'Created at timestamp'
4077
4317
  },
4078
- currency: {
4318
+ updatedAt: {
4319
+ format: 'date-time',
4079
4320
  type: 'string',
4080
- description: 'Base currency for converted values',
4081
- example: 'CNY'
4082
- },
4083
- warnings: {
4084
- description: 'Exchange rate warnings (e.g. missing rate for a currency)',
4321
+ description: 'Updated at timestamp'
4322
+ }
4323
+ },
4324
+ required: [
4325
+ 'id',
4326
+ 'userId',
4327
+ 'ruleId',
4328
+ 'expectedDate',
4329
+ 'expectedAmount',
4330
+ 'status',
4331
+ 'isOverdue',
4332
+ 'rule',
4333
+ 'createdAt',
4334
+ 'updatedAt'
4335
+ ]
4336
+ } as const;
4337
+
4338
+ export const $ExpectedTransactionListResponseDto = {
4339
+ type: 'object',
4340
+ properties: {
4341
+ items: {
4085
4342
  type: 'array',
4086
4343
  items: {
4087
- $ref: '#/components/schemas/ExchangeRateWarningDto'
4344
+ $ref: '#/components/schemas/ExpectedTransactionResponseDto'
4088
4345
  }
4346
+ },
4347
+ total: {
4348
+ type: 'number',
4349
+ description: 'Total count'
4089
4350
  }
4090
4351
  },
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: {}
4352
+ required: ['items', 'total']
4112
4353
  } as const;
4113
4354
 
4114
- export const $DeleteOwnUserDto = {
4355
+ export const $ConfirmMatchDto = {
4115
4356
  type: 'object',
4116
4357
  properties: {
4117
- accessToken: {
4358
+ transactionId: {
4118
4359
  type: 'string',
4119
- description: 'Access token for user verification',
4120
- example: 'abc123xyz'
4360
+ description: 'Transaction ID to match with'
4121
4361
  }
4122
4362
  },
4123
- required: ['accessToken']
4363
+ required: ['transactionId']
4124
4364
  } as const;
4125
4365
 
4126
- export const $SignupDto = {
4366
+ export const $EnterNowDto = {
4127
4367
  type: 'object',
4128
4368
  properties: {
4129
- turnstileToken: {
4369
+ expenseAccount: {
4130
4370
  type: 'string',
4131
4371
  description:
4132
- 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4133
- example: '0.abc123def456...'
4134
- }
4135
- }
4136
- } as const;
4137
-
4138
- export const $SignupResponseDto = {
4139
- type: 'object',
4140
- properties: {
4141
- authToken: {
4372
+ 'Override expense account (uses rule default if not provided)',
4373
+ maxLength: 200
4374
+ },
4375
+ paymentAccount: {
4142
4376
  type: 'string',
4143
- description: 'JWT auth token',
4144
- example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
4377
+ description:
4378
+ 'Override payment account (uses rule default if not provided)',
4379
+ maxLength: 200
4145
4380
  },
4146
- accessToken: {
4381
+ amount: {
4382
+ type: 'number',
4383
+ description: 'Override amount (uses expected amount if not provided)',
4384
+ minimum: 0
4385
+ },
4386
+ payee: {
4147
4387
  type: 'string',
4148
- description: 'Auto-generated access token'
4388
+ description: 'Override payee (uses rule default if not provided)',
4389
+ maxLength: 200
4149
4390
  },
4150
- role: {
4391
+ narration: {
4151
4392
  type: 'string',
4152
- description: 'Assigned user role',
4153
- enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
4393
+ description: 'Optional narration',
4394
+ maxLength: 500
4154
4395
  }
4155
- },
4156
- required: ['authToken', 'accessToken', 'role']
4396
+ }
4157
4397
  } as const;
4158
4398
 
4159
- export const $UpdateUserSettingDto = {
4399
+ export const $ForecastItemDto = {
4160
4400
  type: 'object',
4161
4401
  properties: {
4162
- secId: {
4163
- type: 'number',
4164
- description: 'Security ID'
4402
+ rule: {
4403
+ type: 'string',
4404
+ description: 'Rule name',
4405
+ example: 'Rent'
4165
4406
  },
4166
- annualInterestRate: {
4407
+ ruleId: {
4408
+ type: 'string',
4409
+ description: 'Rule ID',
4410
+ example: 'clx123...'
4411
+ },
4412
+ amount: {
4167
4413
  type: 'number',
4168
- description: 'Annual interest rate',
4169
- example: 0.05
4414
+ description: 'Expected amount',
4415
+ example: 3000
4170
4416
  },
4171
- currency: {
4417
+ date: {
4172
4418
  type: 'string',
4173
- description: 'Currency code',
4174
- example: 'USD'
4419
+ description: 'Expected date (YYYY-MM-DD)',
4420
+ example: '2024-04-01'
4175
4421
  },
4176
- baseCurrency: {
4422
+ icon: {
4177
4423
  type: 'string',
4178
- description: 'Base currency code',
4179
- example: 'USD'
4424
+ description: 'Rule icon emoji',
4425
+ example: '🏠',
4426
+ nullable: true
4180
4427
  },
4181
- benchmark: {
4428
+ currency: {
4182
4429
  type: 'string',
4183
- description: 'Benchmark symbol',
4184
- example: 'SPY'
4185
- },
4186
- colorScheme: {
4430
+ description: 'Currency code',
4431
+ example: 'CNY'
4432
+ }
4433
+ },
4434
+ required: ['rule', 'ruleId', 'amount', 'date', 'icon', 'currency']
4435
+ } as const;
4436
+
4437
+ export const $MonthlyForecastDto = {
4438
+ type: 'object',
4439
+ properties: {
4440
+ month: {
4187
4441
  type: 'string',
4188
- description: 'Color scheme',
4189
- enum: ['DARK', 'LIGHT']
4442
+ description: 'Month (YYYY-MM)',
4443
+ example: '2024-04'
4190
4444
  },
4191
- dateRange: {
4192
- type: 'string',
4193
- description: 'Date range filter',
4194
- example: '1y'
4445
+ expectedOutflow: {
4446
+ type: 'number',
4447
+ description: 'Total expected outflow for the month',
4448
+ example: 8500
4195
4449
  },
4196
- emergencyFund: {
4450
+ itemCount: {
4197
4451
  type: 'number',
4198
- description: 'Emergency fund amount',
4199
- example: 10000
4452
+ description: 'Number of expected transactions',
4453
+ example: 3
4200
4454
  },
4201
- 'filters.accounts': {
4202
- description: 'Account filter IDs',
4203
- type: 'array',
4204
- items: {
4205
- type: 'string'
4455
+ byCurrency: {
4456
+ type: 'object',
4457
+ description: 'Breakdown by currency',
4458
+ example: {
4459
+ CNY: 8500,
4460
+ USD: 100
4206
4461
  }
4207
4462
  },
4208
- 'filters.assetClasses': {
4209
- description: 'Asset class filters',
4463
+ items: {
4464
+ description: 'Individual forecast items',
4210
4465
  type: 'array',
4211
4466
  items: {
4212
- type: 'string'
4467
+ $ref: '#/components/schemas/ForecastItemDto'
4213
4468
  }
4214
- },
4215
- 'filters.dataSource': {
4216
- type: 'string',
4217
- description: 'Data source filter'
4218
- },
4219
- 'filters.symbol': {
4220
- type: 'string',
4221
- description: 'Symbol filter'
4222
- },
4223
- 'filters.tags': {
4224
- description: 'Tag filters',
4469
+ }
4470
+ },
4471
+ required: ['month', 'expectedOutflow', 'itemCount', 'byCurrency', 'items']
4472
+ } as const;
4473
+
4474
+ export const $ForecastResponseDto = {
4475
+ type: 'object',
4476
+ properties: {
4477
+ forecast: {
4478
+ description: 'Monthly forecast data',
4225
4479
  type: 'array',
4226
4480
  items: {
4227
- type: 'string'
4481
+ $ref: '#/components/schemas/MonthlyForecastDto'
4228
4482
  }
4229
4483
  },
4230
- isExperimentalFeatures: {
4231
- type: 'boolean',
4232
- description: 'Enable experimental features'
4233
- },
4234
- isRestrictedView: {
4235
- type: 'boolean',
4236
- description: 'Enable restricted view mode'
4237
- },
4238
- language: {
4239
- type: 'string',
4240
- description: 'Language code',
4241
- example: 'en'
4242
- },
4243
- locale: {
4244
- type: 'string',
4245
- description: 'Locale code',
4246
- example: 'en-US'
4247
- },
4248
- projectedTotalAmount: {
4484
+ totalOutflow: {
4249
4485
  type: 'number',
4250
- description: 'Projected total amount',
4251
- example: 1000000
4486
+ description: 'Total expected outflow across all months',
4487
+ example: 25500
4252
4488
  },
4253
- retirementDate: {
4254
- type: 'string',
4255
- description: 'Retirement date in ISO 8601 format',
4256
- example: '2050-01-01'
4489
+ totalByCurrency: {
4490
+ type: 'object',
4491
+ description: 'Total by currency across all months',
4492
+ example: {
4493
+ CNY: 25500,
4494
+ USD: 300
4495
+ }
4257
4496
  },
4258
- savingsRate: {
4497
+ rulesCount: {
4259
4498
  type: 'number',
4260
- description: 'Savings rate percentage',
4261
- example: 0.2
4499
+ description: 'Number of active recurring rules included',
4500
+ example: 5
4262
4501
  },
4263
- viewMode: {
4264
- type: 'string',
4265
- description: 'View mode',
4266
- enum: ['DEFAULT', 'ZEN']
4267
- }
4268
- }
4269
- } as const;
4270
-
4271
- export const $UpdatePropertyDto = {
4272
- type: 'object',
4273
- properties: {
4274
- value: {
4502
+ periodStart: {
4275
4503
  type: 'string',
4276
- description: 'Property value'
4504
+ description: 'Forecast period start date',
4505
+ example: '2024-04-01'
4506
+ },
4507
+ periodEnd: {
4508
+ type: 'string',
4509
+ description: 'Forecast period end date',
4510
+ example: '2024-06-30'
4277
4511
  }
4278
4512
  },
4279
- required: ['value']
4513
+ required: [
4514
+ 'forecast',
4515
+ 'totalOutflow',
4516
+ 'totalByCurrency',
4517
+ 'rulesCount',
4518
+ 'periodStart',
4519
+ 'periodEnd'
4520
+ ]
4280
4521
  } as const;
4281
4522
 
4282
4523
  export const $CreateTransactionRuleDto = {
@@ -4838,7 +5079,8 @@ export const $UpdateTransactionRuleDto = {
4838
5079
  },
4839
5080
  matchLogic: {
4840
5081
  type: 'string',
4841
- enum: ['OR', 'AND']
5082
+ enum: ['OR', 'AND'],
5083
+ default: 'OR'
4842
5084
  },
4843
5085
  amountMin: {
4844
5086
  type: 'number',
@@ -4852,13 +5094,10 @@ export const $UpdateTransactionRuleDto = {
4852
5094
  },
4853
5095
  priority: {
4854
5096
  type: 'number',
5097
+ default: 50,
4855
5098
  minimum: 0,
4856
5099
  maximum: 1000
4857
5100
  },
4858
- enabled: {
4859
- type: 'boolean',
4860
- description: 'Enable or disable the rule'
4861
- },
4862
5101
  additionalTags: {
4863
5102
  items: {
4864
5103
  type: 'array'
@@ -4868,6 +5107,10 @@ export const $UpdateTransactionRuleDto = {
4868
5107
  },
4869
5108
  additionalMetadata: {
4870
5109
  type: 'object'
5110
+ },
5111
+ enabled: {
5112
+ type: 'boolean',
5113
+ description: 'Enable or disable the rule'
4871
5114
  }
4872
5115
  }
4873
5116
  } as const;
@@ -4928,6 +5171,69 @@ export const $TestRuleResponseDto = {
4928
5171
  required: ['ruleId', 'matches', 'confidence', 'matchDetails']
4929
5172
  } as const;
4930
5173
 
5174
+ export const $CategoryCatalogEntryDto = {
5175
+ type: 'object',
5176
+ properties: {
5177
+ slug: {
5178
+ type: 'string',
5179
+ description: 'Category slug (single source-of-truth)',
5180
+ example: 'food'
5181
+ },
5182
+ scenario: {
5183
+ type: 'string',
5184
+ description: 'Display scenario group (maps to frontend picker _scenario)',
5185
+ enum: [
5186
+ 'expense',
5187
+ 'income',
5188
+ 'investment',
5189
+ 'banking',
5190
+ 'transfer',
5191
+ 'payment'
5192
+ ],
5193
+ example: 'expense'
5194
+ },
5195
+ icon: {
5196
+ type: 'string',
5197
+ description: 'Lucide icon name',
5198
+ example: 'utensils'
5199
+ },
5200
+ regions: {
5201
+ description: "Applicable regions ('*' = all, 'cn' = CN-only)",
5202
+ example: ['*'],
5203
+ type: 'array',
5204
+ items: {
5205
+ type: 'string'
5206
+ }
5207
+ }
5208
+ },
5209
+ required: ['slug', 'scenario', 'icon', 'regions']
5210
+ } as const;
5211
+
5212
+ export const $CategoryCatalogListResponseDto = {
5213
+ type: 'object',
5214
+ properties: {
5215
+ items: {
5216
+ description: 'Category entries (region-scoped, query-filtered)',
5217
+ type: 'array',
5218
+ items: {
5219
+ $ref: '#/components/schemas/CategoryCatalogEntryDto'
5220
+ }
5221
+ },
5222
+ total: {
5223
+ type: 'number',
5224
+ description:
5225
+ 'Total category entries for the region (before query filtering)',
5226
+ example: 30
5227
+ },
5228
+ region: {
5229
+ type: 'string',
5230
+ description: 'Region code',
5231
+ example: 'cn'
5232
+ }
5233
+ },
5234
+ required: ['items', 'total', 'region']
5235
+ } as const;
5236
+
4931
5237
  export const $CreateBeanEventDto = {
4932
5238
  type: 'object',
4933
5239
  properties: {
@@ -5670,7 +5976,8 @@ export const $UpdateMapperDefaultsDto = {
5670
5976
  type: 'string',
5671
5977
  description: 'Source account for transactions (Beancount format)',
5672
5978
  example: 'Assets:CN:Alipay:Balance',
5673
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
5979
+ pattern:
5980
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5674
5981
  },
5675
5982
  currency: {
5676
5983
  type: 'string',
@@ -5684,13 +5991,15 @@ export const $UpdateMapperDefaultsDto = {
5684
5991
  type: 'string',
5685
5992
  description: 'Default expense account (optional)',
5686
5993
  example: 'Expenses:Unknown',
5687
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
5994
+ pattern:
5995
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5688
5996
  },
5689
5997
  incomeAccount: {
5690
5998
  type: 'string',
5691
5999
  description: 'Default income account (optional)',
5692
6000
  example: 'Income:Unknown',
5693
- pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
6001
+ pattern:
6002
+ '^(Assets|Liabilities|Income|Expenses|Equity)(:[A-Za-z0-9][A-Za-z0-9-]*)+$'
5694
6003
  },
5695
6004
  methodAccountMapping: {
5696
6005
  type: 'object',
@@ -5979,15 +6288,105 @@ export const $UncoveredFormatMissDto = {
5979
6288
  properties: {}
5980
6289
  } as const;
5981
6290
 
6291
+ export const $ClientParsedDataDto = {
6292
+ type: 'object',
6293
+ properties: {
6294
+ amount: {
6295
+ type: 'number',
6296
+ description: 'Transaction amount',
6297
+ example: 35
6298
+ },
6299
+ currency: {
6300
+ type: 'string',
6301
+ description: 'Currency code',
6302
+ example: 'CNY'
6303
+ },
6304
+ date: {
6305
+ type: 'string',
6306
+ description: 'Transaction date (ISO 8601)',
6307
+ example: '2026-08-15'
6308
+ },
6309
+ payee: {
6310
+ type: 'string',
6311
+ description: 'Payee/merchant name',
6312
+ example: 'Starbucks'
6313
+ },
6314
+ narration: {
6315
+ type: 'string',
6316
+ description: 'Transaction narration'
6317
+ },
6318
+ category: {
6319
+ type: 'string',
6320
+ description: 'Category slug',
6321
+ example: 'food_restaurant'
6322
+ },
6323
+ incomeType: {
6324
+ type: 'string',
6325
+ description: 'Income type',
6326
+ example: 'Salary'
6327
+ },
6328
+ incomeSource: {
6329
+ type: 'string',
6330
+ description: 'Income source',
6331
+ example: 'Anthropic Inc.'
6332
+ },
6333
+ symbol: {
6334
+ type: 'string',
6335
+ description: 'Security symbol code (e.g., 600519, AAPL)',
6336
+ example: 'AAPL'
6337
+ },
6338
+ quantity: {
6339
+ type: 'number',
6340
+ description: 'Quantity of shares/units',
6341
+ example: 100
6342
+ },
6343
+ price: {
6344
+ type: 'number',
6345
+ description: 'Unit price per share/unit',
6346
+ example: 1900
6347
+ },
6348
+ investmentAction: {
6349
+ type: 'string',
6350
+ description: 'Investment action',
6351
+ enum: ['buy', 'sell'],
6352
+ example: 'buy'
6353
+ },
6354
+ paymentSource: {
6355
+ type: 'string',
6356
+ description: 'Payment source: asset (default) or liability (credit card)',
6357
+ enum: ['asset', 'liability'],
6358
+ example: 'asset'
6359
+ },
6360
+ liabilityHint: {
6361
+ type: 'string',
6362
+ description: 'Liability account hint (CreditCard/Huabei/Baitiao)',
6363
+ example: 'CreditCard'
6364
+ },
6365
+ warning: {
6366
+ type: 'string',
6367
+ description:
6368
+ 'Display-only warning from the prior response; accepted but ignored.',
6369
+ example: 'Cross-currency settlement applies.'
6370
+ }
6371
+ }
6372
+ } as const;
6373
+
5982
6374
  export const $ProcessNlpDto = {
5983
6375
  type: 'object',
5984
6376
  properties: {
5985
6377
  message: {
5986
6378
  type: 'string',
5987
- description: 'Natural language text describing a transaction (Chinese)',
5988
- example: 'yesterday Starbucks spent 35 yuan',
6379
+ description:
6380
+ 'Natural language text describing a transaction. Optional when `confirm` is true (structured confirm); otherwise required.',
6381
+ example: 'Starbucks 35',
5989
6382
  maxLength: 500
5990
6383
  },
6384
+ confirm: {
6385
+ type: 'boolean',
6386
+ description:
6387
+ 'Structured confirm signal — bypasses NL confirm-word matching when true. Send parsedData field edits alongside. The NL word-list path is the fallback.',
6388
+ example: true
6389
+ },
5991
6390
  sessionId: {
5992
6391
  type: 'string',
5993
6392
  description:
@@ -5995,14 +6394,18 @@ export const $ProcessNlpDto = {
5995
6394
  example: 'session_abc123'
5996
6395
  },
5997
6396
  parsedData: {
5998
- type: 'object',
5999
6397
  description:
6000
6398
  'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
6001
6399
  example: {
6002
6400
  amount: 35,
6003
6401
  currency: 'CNY',
6004
6402
  payee: 'Starbucks'
6005
- }
6403
+ },
6404
+ allOf: [
6405
+ {
6406
+ $ref: '#/components/schemas/ClientParsedDataDto'
6407
+ }
6408
+ ]
6006
6409
  },
6007
6410
  selectedRuleId: {
6008
6411
  type: 'string',
@@ -6013,11 +6416,29 @@ export const $ProcessNlpDto = {
6013
6416
  selectedAccount: {
6014
6417
  type: 'string',
6015
6418
  description:
6016
- '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.',
6419
+ '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.',
6017
6420
  example: 'Expenses:Food:Coffee'
6421
+ },
6422
+ viewpointAccount: {
6423
+ type: 'string',
6424
+ description:
6425
+ '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.',
6426
+ example: 'Assets:CN:Bank:ICBC'
6427
+ },
6428
+ viewpointCategory: {
6429
+ type: 'string',
6430
+ description:
6431
+ "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.",
6432
+ example: 'Food'
6433
+ },
6434
+ viewpointFlow: {
6435
+ type: 'string',
6436
+ description:
6437
+ "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.",
6438
+ enum: ['income', 'expense'],
6439
+ example: 'expense'
6018
6440
  }
6019
- },
6020
- required: ['message']
6441
+ }
6021
6442
  } as const;
6022
6443
 
6023
6444
  export const $NlpTransactionInfoDto = {
@@ -6329,6 +6750,24 @@ export const $NlpRuleConfirmationDataDto = {
6329
6750
  ]
6330
6751
  } as const;
6331
6752
 
6753
+ export const $NlpAccountCandidateDto = {
6754
+ type: 'object',
6755
+ properties: {
6756
+ path: {
6757
+ type: 'string',
6758
+ description: 'Canonical beancount account path (echo back on selection)',
6759
+ example: 'Expenses:Food:Dining'
6760
+ },
6761
+ name: {
6762
+ type: 'string',
6763
+ description:
6764
+ 'Localized display name (ADR-0114 read-time projection, user locale)',
6765
+ example: '餐饮'
6766
+ }
6767
+ },
6768
+ required: ['path', 'name']
6769
+ } as const;
6770
+
6332
6771
  export const $NlpAccountConfirmationDataDto = {
6333
6772
  type: 'object',
6334
6773
  properties: {
@@ -6344,10 +6783,11 @@ export const $NlpAccountConfirmationDataDto = {
6344
6783
  example: 'Expenses:Food:Drinks'
6345
6784
  },
6346
6785
  similarAccounts: {
6347
- description: 'Similar accounts for user selection',
6786
+ description:
6787
+ 'Similar accounts for user selection (path + localized name, #680)',
6348
6788
  type: 'array',
6349
6789
  items: {
6350
- type: 'string'
6790
+ $ref: '#/components/schemas/NlpAccountCandidateDto'
6351
6791
  }
6352
6792
  },
6353
6793
  errorMessage: {
@@ -6635,7 +7075,7 @@ export const $NlpResponseDto = {
6635
7075
  type: 'string',
6636
7076
  description:
6637
7077
  'Asset sub-type (only present when intent is "asset"). Determines which asset-related form to render.',
6638
- enum: ['transfer', 'banking', 'investment'],
7078
+ enum: ['transfer', 'banking', 'investment', 'lend', 'lend_collect'],
6639
7079
  example: 'investment'
6640
7080
  },
6641
7081
  liabilitySubType: {
@@ -6838,7 +7278,7 @@ export const $PlatformListItemDto = {
6838
7278
  suggestedSegment: {
6839
7279
  type: 'string',
6840
7280
  description:
6841
- 'Suggested path segment — PascalCase of canonical, hyphens removed (e.g. "ApplePay")'
7281
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
6842
7282
  },
6843
7283
  logoUrl: {
6844
7284
  type: 'string',
@@ -6908,7 +7348,7 @@ export const $PlatformMatchResultDto = {
6908
7348
  suggestedSegment: {
6909
7349
  type: 'string',
6910
7350
  description:
6911
- 'Suggested path segment — PascalCase of canonical, hyphens removed (e.g. "ApplePay")'
7351
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
6912
7352
  },
6913
7353
  logoUrl: {
6914
7354
  type: 'string',
@@ -6924,55 +7364,128 @@ export const $PlatformMatchResultDto = {
6924
7364
  category: {
6925
7365
  type: 'string',
6926
7366
  description:
6927
- 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7367
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank). null = no region-aware suggestion; fall back to type.',
7368
+ nullable: true,
7369
+ example: 'DigitalWallet'
7370
+ },
7371
+ matchType: {
7372
+ type: 'string',
7373
+ description: "How this row matched: 'exact' > 'prefix' > 'substring'",
7374
+ enum: ['exact', 'prefix', 'substring']
7375
+ }
7376
+ },
7377
+ required: [
7378
+ 'id',
7379
+ 'name',
7380
+ 'canonical',
7381
+ 'type',
7382
+ 'suggestedSegment',
7383
+ 'logoUrl',
7384
+ 'countryCode',
7385
+ 'category',
7386
+ 'matchType'
7387
+ ]
7388
+ } as const;
7389
+
7390
+ export const $PlatformMatchResponseDto = {
7391
+ type: 'object',
7392
+ properties: {
7393
+ platforms: {
7394
+ description: 'Ranked matches, best tier first (at most 10 rows)',
7395
+ type: 'array',
7396
+ items: {
7397
+ $ref: '#/components/schemas/PlatformMatchResultDto'
7398
+ }
7399
+ },
7400
+ matchType: {
7401
+ type: 'string',
7402
+ description:
7403
+ "Overall match quality — top row's tier, or 'none' when no hits",
7404
+ enum: ['none', 'exact', 'prefix', 'substring']
7405
+ },
7406
+ total: {
7407
+ type: 'number',
7408
+ description: 'Total matches before LIMIT (truncation transparency)'
7409
+ },
7410
+ hasMore: {
7411
+ type: 'boolean',
7412
+ description: 'true when total > platforms.length (more matches exist)'
7413
+ }
7414
+ },
7415
+ required: ['platforms', 'matchType', 'total', 'hasMore']
7416
+ } as const;
7417
+
7418
+ export const $PlatformStandardsPlatformDto = {
7419
+ type: 'object',
7420
+ properties: {
7421
+ id: {
7422
+ type: 'string',
7423
+ description: 'Global platform ID'
7424
+ },
7425
+ name: {
7426
+ type: 'string',
7427
+ description: 'Platform name (e.g., "ICBC")'
7428
+ },
7429
+ canonical: {
7430
+ type: 'string',
7431
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
7432
+ },
7433
+ suggestedSegment: {
7434
+ type: 'string',
7435
+ description:
7436
+ 'Suggested path segment — canonical PascalCased per hyphen-part, hyphens preserved (e.g. "Apple-Pay")'
7437
+ },
7438
+ type: {
7439
+ type: 'string',
7440
+ description: 'Platform type',
7441
+ enum: [
7442
+ 'BANK',
7443
+ 'BROKERAGE',
7444
+ 'CRYPTO_EXCHANGE',
7445
+ 'PAYMENT',
7446
+ 'INVESTMENT',
7447
+ 'INSURANCE',
7448
+ 'OTHER'
7449
+ ]
7450
+ },
7451
+ category: {
7452
+ type: 'string',
7453
+ description:
7454
+ 'Region-aware category (institution vocab, e.g. DigitalWallet/Bank) resolved against the final region. null = no region-aware suggestion; fall back to type.',
6928
7455
  nullable: true,
6929
- example: 'DigitalWallet'
6930
- },
6931
- matchType: {
6932
- type: 'string',
6933
- description: "How this row matched: 'exact' > 'prefix' > 'substring'",
6934
- enum: ['exact', 'prefix', 'substring']
7456
+ example: 'Bank'
6935
7457
  }
6936
7458
  },
6937
- required: [
6938
- 'id',
6939
- 'name',
6940
- 'canonical',
6941
- 'type',
6942
- 'suggestedSegment',
6943
- 'logoUrl',
6944
- 'countryCode',
6945
- 'category',
6946
- 'matchType'
6947
- ]
7459
+ required: ['id', 'name', 'canonical', 'suggestedSegment', 'type', 'category']
6948
7460
  } as const;
6949
7461
 
6950
- export const $PlatformMatchResponseDto = {
7462
+ export const $PlatformStandardsResponseDto = {
6951
7463
  type: 'object',
6952
7464
  properties: {
6953
- platforms: {
6954
- description: 'Ranked matches, best tier first (at most 10 rows)',
6955
- type: 'array',
6956
- items: {
6957
- $ref: '#/components/schemas/PlatformMatchResultDto'
6958
- }
7465
+ platform: {
7466
+ description: 'The selected platform (institution lock source)',
7467
+ allOf: [
7468
+ {
7469
+ $ref: '#/components/schemas/PlatformStandardsPlatformDto'
7470
+ }
7471
+ ]
6959
7472
  },
6960
- matchType: {
7473
+ region: {
6961
7474
  type: 'string',
6962
7475
  description:
6963
- "Overall match quality — top row's tier, or 'none' when no hits",
6964
- enum: ['none', 'exact', 'prefix', 'substring']
6965
- },
6966
- total: {
6967
- type: 'number',
6968
- description: 'Total matches before LIMIT (truncation transparency)'
7476
+ "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.",
7477
+ example: 'CN'
6969
7478
  },
6970
- hasMore: {
6971
- type: 'boolean',
6972
- description: 'true when total > platforms.length (more matches exist)'
7479
+ templates: {
7480
+ description:
7481
+ 'Candidate account-standard templates of the resolved region (groupable by productCategory client-side)',
7482
+ type: 'array',
7483
+ items: {
7484
+ $ref: '#/components/schemas/AccountStandardResponseDto'
7485
+ }
6973
7486
  }
6974
7487
  },
6975
- required: ['platforms', 'matchType', 'total', 'hasMore']
7488
+ required: ['platform', 'region', 'templates']
6976
7489
  } as const;
6977
7490
 
6978
7491
  export const $CreatePlatformDto = {
@@ -7076,7 +7589,8 @@ export const $UpdatePlatformDto = {
7076
7589
  },
7077
7590
  isActive: {
7078
7591
  type: 'boolean',
7079
- description: 'Whether the platform is active'
7592
+ description: 'Whether the platform is active',
7593
+ default: true
7080
7594
  }
7081
7595
  }
7082
7596
  } as const;
@@ -7275,7 +7789,8 @@ export const $PlatformGroupDto = {
7275
7789
  example: 'CMB Bank'
7276
7790
  },
7277
7791
  accounts: {
7278
- description: 'Accounts within this platform',
7792
+ description:
7793
+ 'Accounts within this platform (Assets and Liabilities rows, #696)',
7279
7794
  type: 'array',
7280
7795
  items: {
7281
7796
  $ref: '#/components/schemas/AccountItemDto'
@@ -7283,7 +7798,8 @@ export const $PlatformGroupDto = {
7283
7798
  },
7284
7799
  totalBalance: {
7285
7800
  type: 'string',
7286
- description: 'FX-converted total balance in base currency',
7801
+ description:
7802
+ 'FX-converted total balance in base currency (nets Assets + Liabilities rows; can be negative)',
7287
7803
  example: '100000.00'
7288
7804
  },
7289
7805
  balanceByCurrency: {
@@ -7302,7 +7818,7 @@ export const $PlatformGroupDto = {
7302
7818
  sharePct: {
7303
7819
  type: 'number',
7304
7820
  description:
7305
- 'Share of the grand converted total (0-100); 0 when grand total is 0',
7821
+ 'Share of the converted asset-side grand total (0-100); liability balances are excluded from the basis; 0 when grand total is 0 (#696)',
7306
7822
  example: 42.5
7307
7823
  }
7308
7824
  },
@@ -7350,7 +7866,8 @@ export const $AccountsSummaryDto = {
7350
7866
  properties: {
7351
7867
  totalAccounts: {
7352
7868
  type: 'number',
7353
- description: 'Total number of accounts'
7869
+ description:
7870
+ 'Total number of accounts (balance sheet: Assets + Liabilities, #696)'
7354
7871
  },
7355
7872
  totalPlatforms: {
7356
7873
  type: 'number',
@@ -7894,7 +8411,7 @@ export const $MonetaryDto = {
7894
8411
  example: 'USD'
7895
8412
  },
7896
8413
  baseCcyEquivalent: {
7897
- type: 'object',
8414
+ type: 'string',
7898
8415
  description: 'Converted to user base currency (Decimal string)',
7899
8416
  example: '21600',
7900
8417
  nullable: true
@@ -7970,13 +8487,13 @@ export const $HoldingPnlRowDto = {
7970
8487
  example: 'Assets:US:Broker:AAPL'
7971
8488
  },
7972
8489
  accountCcy: {
7973
- type: 'object',
8490
+ type: 'string',
7974
8491
  description: 'Account settlement currency (ISO 4217), from cost currency',
7975
8492
  nullable: true,
7976
8493
  example: 'USD'
7977
8494
  },
7978
8495
  brokerType: {
7979
- type: 'object',
8496
+ type: 'string',
7980
8497
  description: 'Broker type derived from Platform.type',
7981
8498
  nullable: true,
7982
8499
  example: 'broker'
@@ -7997,7 +8514,7 @@ export const $HoldingPnlRowDto = {
7997
8514
  example: 'EQUITY'
7998
8515
  },
7999
8516
  assetSubClass: {
8000
- type: 'object',
8517
+ type: 'string',
8001
8518
  nullable: true,
8002
8519
  example: 'STOCK'
8003
8520
  },
@@ -8044,14 +8561,14 @@ export const $HoldingPnlRowDto = {
8044
8561
  ]
8045
8562
  },
8046
8563
  unrealizedPnlBase: {
8047
- type: 'object',
8564
+ type: 'string',
8048
8565
  description:
8049
8566
  'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
8050
8567
  nullable: true,
8051
8568
  example: '6000'
8052
8569
  },
8053
8570
  unrealizedPnlPct: {
8054
- type: 'object',
8571
+ type: 'string',
8055
8572
  description: 'Unrealized P&L % (Decimal string)',
8056
8573
  nullable: true,
8057
8574
  example: '25'
@@ -8075,7 +8592,7 @@ export const $HoldingPnlRowDto = {
8075
8592
  ]
8076
8593
  },
8077
8594
  pctOfInvestedAssets: {
8078
- type: 'object',
8595
+ type: 'string',
8079
8596
  description:
8080
8597
  'Share of invested assets % (Decimal string); only for invested chartTokens',
8081
8598
  nullable: true,
@@ -8120,15 +8637,15 @@ export const $HoldingPnlWarningDto = {
8120
8637
  ]
8121
8638
  },
8122
8639
  symbol: {
8123
- type: 'object',
8640
+ type: 'string',
8124
8641
  nullable: true
8125
8642
  },
8126
8643
  accountId: {
8127
- type: 'object',
8644
+ type: 'string',
8128
8645
  nullable: true
8129
8646
  },
8130
8647
  currency: {
8131
- type: 'object',
8648
+ type: 'string',
8132
8649
  nullable: true
8133
8650
  }
8134
8651
  },
@@ -8192,6 +8709,216 @@ export const $AnonymousLoginResponseDto = {
8192
8709
  required: ['authToken']
8193
8710
  } as const;
8194
8711
 
8712
+ export const $ParserContributionMetaDto = {
8713
+ type: 'object',
8714
+ properties: {
8715
+ institution: {
8716
+ type: 'string',
8717
+ description: 'Institution slug (lowercase kebab-case)',
8718
+ pattern: '^[a-z0-9]+(-[a-z0-9]+)*$',
8719
+ example: 'icbc'
8720
+ },
8721
+ region: {
8722
+ type: 'string',
8723
+ enum: [
8724
+ 'cn',
8725
+ 'us',
8726
+ 'de',
8727
+ 'fr',
8728
+ 'gb',
8729
+ 'hk',
8730
+ 'jp',
8731
+ 'sg',
8732
+ 'au',
8733
+ 'ca',
8734
+ 'other'
8735
+ ]
8736
+ },
8737
+ accountType: {
8738
+ type: 'string',
8739
+ enum: ['checking', 'savings', 'credit', 'debit', 'investment']
8740
+ },
8741
+ format: {
8742
+ type: 'string',
8743
+ enum: ['csv', 'xlsx', 'pdf', 'ofx', 'qif']
8744
+ },
8745
+ institutionDisplayName: {
8746
+ type: 'string',
8747
+ example: '中国工商银行'
8748
+ },
8749
+ encoding: {
8750
+ type: 'string',
8751
+ example: 'utf-8'
8752
+ },
8753
+ delimiter: {
8754
+ type: 'string',
8755
+ description: 'CSV delimiter character: ",", ";", "\\t" or "|"'
8756
+ },
8757
+ headerRows: {
8758
+ type: 'number',
8759
+ default: 1,
8760
+ description: 'Header row count; the client omits the field when it is 1'
8761
+ },
8762
+ notes: {
8763
+ type: 'string',
8764
+ maxLength: 2000
8765
+ }
8766
+ },
8767
+ required: ['institution', 'region', 'accountType', 'format']
8768
+ } as const;
8769
+
8770
+ export const $ParserContributionSamplesDto = {
8771
+ type: 'object',
8772
+ properties: {
8773
+ rows: {
8774
+ description:
8775
+ 'Client-sanitized sample rows (key = column name, value = cell)',
8776
+ type: 'array',
8777
+ items: {
8778
+ type: 'object'
8779
+ }
8780
+ },
8781
+ rawHeaders: {
8782
+ type: 'array',
8783
+ items: {
8784
+ type: 'string'
8785
+ }
8786
+ }
8787
+ },
8788
+ required: ['rows']
8789
+ } as const;
8790
+
8791
+ export const $FieldHintDto = {
8792
+ type: 'object',
8793
+ properties: {
8794
+ columnName: {
8795
+ type: 'string',
8796
+ example: '交易日期'
8797
+ },
8798
+ format: {
8799
+ type: 'string',
8800
+ description: 'Date format, e.g. yyyy-MM-dd HH:mm',
8801
+ example: 'yyyy-MM-dd'
8802
+ },
8803
+ signConvention: {
8804
+ type: 'string',
8805
+ enum: ['negative-expense', 'positive-expense', 'separate-columns']
8806
+ },
8807
+ creditColumn: {
8808
+ type: 'string'
8809
+ },
8810
+ debitColumn: {
8811
+ type: 'string'
8812
+ }
8813
+ },
8814
+ required: ['columnName']
8815
+ } as const;
8816
+
8817
+ export const $ParserContributionFieldHintsDto = {
8818
+ type: 'object',
8819
+ properties: {
8820
+ date: {
8821
+ $ref: '#/components/schemas/FieldHintDto'
8822
+ },
8823
+ amount: {
8824
+ $ref: '#/components/schemas/FieldHintDto'
8825
+ },
8826
+ description: {
8827
+ $ref: '#/components/schemas/FieldHintDto'
8828
+ },
8829
+ balance: {
8830
+ $ref: '#/components/schemas/FieldHintDto'
8831
+ },
8832
+ payee: {
8833
+ $ref: '#/components/schemas/FieldHintDto'
8834
+ },
8835
+ reference: {
8836
+ $ref: '#/components/schemas/FieldHintDto'
8837
+ },
8838
+ category: {
8839
+ $ref: '#/components/schemas/FieldHintDto'
8840
+ }
8841
+ },
8842
+ required: ['date', 'amount']
8843
+ } as const;
8844
+
8845
+ export const $ExpectedTransactionDto = {
8846
+ type: 'object',
8847
+ properties: {
8848
+ date: {
8849
+ type: 'string',
8850
+ example: '2026-08-01'
8851
+ },
8852
+ amount: {
8853
+ type: 'number',
8854
+ example: -45.5
8855
+ },
8856
+ description: {
8857
+ type: 'string',
8858
+ example: '星巴克-***店'
8859
+ },
8860
+ payee: {
8861
+ type: 'string'
8862
+ },
8863
+ category: {
8864
+ type: 'string'
8865
+ }
8866
+ },
8867
+ required: ['date', 'amount', 'description']
8868
+ } as const;
8869
+
8870
+ export const $ParserContributionExamplesDto = {
8871
+ type: 'object',
8872
+ properties: {
8873
+ expectedTransactions: {
8874
+ type: 'array',
8875
+ items: {
8876
+ $ref: '#/components/schemas/ExpectedTransactionDto'
8877
+ }
8878
+ }
8879
+ },
8880
+ required: ['expectedTransactions']
8881
+ } as const;
8882
+
8883
+ export const $ParserContributionRequestDto = {
8884
+ type: 'object',
8885
+ properties: {
8886
+ meta: {
8887
+ $ref: '#/components/schemas/ParserContributionMetaDto'
8888
+ },
8889
+ samples: {
8890
+ $ref: '#/components/schemas/ParserContributionSamplesDto'
8891
+ },
8892
+ fieldHints: {
8893
+ $ref: '#/components/schemas/ParserContributionFieldHintsDto'
8894
+ },
8895
+ examples: {
8896
+ description: 'Omitted entirely by the client when empty',
8897
+ allOf: [
8898
+ {
8899
+ $ref: '#/components/schemas/ParserContributionExamplesDto'
8900
+ }
8901
+ ]
8902
+ }
8903
+ },
8904
+ required: ['meta', 'samples', 'fieldHints']
8905
+ } as const;
8906
+
8907
+ export const $ParserContributionRelayResponseDto = {
8908
+ type: 'object',
8909
+ properties: {
8910
+ issueUrl: {
8911
+ type: 'string',
8912
+ example: 'https://github.com/fire-zu/firela-vlt/issues/42'
8913
+ },
8914
+ issueNumber: {
8915
+ type: 'number',
8916
+ example: 42
8917
+ }
8918
+ },
8919
+ required: ['issueUrl', 'issueNumber']
8920
+ } as const;
8921
+
8195
8922
  export const $SymbolSearchResultDto = {
8196
8923
  type: 'object',
8197
8924
  properties: {
@@ -8200,35 +8927,35 @@ export const $SymbolSearchResultDto = {
8200
8927
  example: 'AAPL'
8201
8928
  },
8202
8929
  name: {
8203
- type: 'object',
8930
+ type: 'string',
8204
8931
  example: 'Apple Inc.',
8205
8932
  nullable: true
8206
8933
  },
8207
8934
  exchange: {
8208
- type: 'object',
8935
+ type: 'string',
8209
8936
  example: 'US',
8210
8937
  nullable: true
8211
8938
  },
8212
8939
  assetType: {
8213
- type: 'object',
8940
+ type: 'string',
8214
8941
  description: 'OpenBB asset_type (e.g. stock, etf)',
8215
8942
  example: 'stock',
8216
8943
  nullable: true
8217
8944
  },
8218
8945
  assetClass: {
8219
- type: 'object',
8946
+ type: 'string',
8220
8947
  description: 'IGN asset class (region.types.ts ASSET_CLASSES)',
8221
8948
  example: 'EQUITY',
8222
8949
  nullable: true
8223
8950
  },
8224
8951
  assetSubClass: {
8225
- type: 'object',
8952
+ type: 'string',
8226
8953
  description: 'IGN asset sub-class (region.types.ts ASSET_SUB_CLASSES)',
8227
8954
  example: 'STOCK',
8228
8955
  nullable: true
8229
8956
  },
8230
8957
  currency: {
8231
- type: 'object',
8958
+ type: 'string',
8232
8959
  description: 'Trading currency (extra_data or inferred from exchange)',
8233
8960
  example: 'USD',
8234
8961
  nullable: true
@@ -8245,90 +8972,90 @@ export const $SymbolQuoteDto = {
8245
8972
  example: 'AAPL'
8246
8973
  },
8247
8974
  name: {
8248
- type: 'object',
8975
+ type: 'string',
8249
8976
  example: 'Apple Inc.',
8250
8977
  nullable: true
8251
8978
  },
8252
8979
  exchange: {
8253
- type: 'object',
8980
+ type: 'string',
8254
8981
  example: 'US',
8255
8982
  nullable: true
8256
8983
  },
8257
8984
  assetType: {
8258
- type: 'object',
8985
+ type: 'string',
8259
8986
  description: 'OpenBB asset_type',
8260
8987
  example: 'stock',
8261
8988
  nullable: true
8262
8989
  },
8263
8990
  assetClass: {
8264
- type: 'object',
8991
+ type: 'string',
8265
8992
  description: 'IGN asset class',
8266
8993
  example: 'EQUITY',
8267
8994
  nullable: true
8268
8995
  },
8269
8996
  assetSubClass: {
8270
- type: 'object',
8997
+ type: 'string',
8271
8998
  description: 'IGN asset sub-class',
8272
8999
  example: 'STOCK',
8273
9000
  nullable: true
8274
9001
  },
8275
9002
  currency: {
8276
- type: 'object',
9003
+ type: 'string',
8277
9004
  description: 'Trading currency (extra_data or inferred from exchange)',
8278
9005
  example: 'USD',
8279
9006
  nullable: true
8280
9007
  },
8281
9008
  price: {
8282
- type: 'object',
9009
+ type: 'string',
8283
9010
  description: 'Latest price (Decimal string)',
8284
9011
  example: '189.84',
8285
9012
  nullable: true
8286
9013
  },
8287
9014
  priceDate: {
8288
- type: 'object',
9015
+ type: 'string',
8289
9016
  description: 'Date the price was observed (ISO yyyy-MM-dd)',
8290
9017
  example: '2026-08-05',
8291
9018
  nullable: true
8292
9019
  },
8293
9020
  changePercent: {
8294
- type: 'object',
9021
+ type: 'number',
8295
9022
  description:
8296
9023
  '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.',
8297
9024
  example: 1.7,
8298
9025
  nullable: true
8299
9026
  },
8300
9027
  prevClose: {
8301
- type: 'object',
9028
+ type: 'string',
8302
9029
  description: 'Previous close (Decimal string)',
8303
9030
  nullable: true
8304
9031
  },
8305
9032
  open: {
8306
- type: 'object',
9033
+ type: 'string',
8307
9034
  description: 'Day open (Decimal string)',
8308
9035
  nullable: true
8309
9036
  },
8310
9037
  high: {
8311
- type: 'object',
9038
+ type: 'string',
8312
9039
  description: 'Day high (Decimal string)',
8313
9040
  nullable: true
8314
9041
  },
8315
9042
  low: {
8316
- type: 'object',
9043
+ type: 'string',
8317
9044
  description: 'Day low (Decimal string)',
8318
9045
  nullable: true
8319
9046
  },
8320
9047
  volume: {
8321
- type: 'object',
9048
+ type: 'string',
8322
9049
  description: 'Day volume (Decimal string)',
8323
9050
  nullable: true
8324
9051
  },
8325
9052
  yearHigh: {
8326
- type: 'object',
9053
+ type: 'string',
8327
9054
  description: '52-week high (Decimal string)',
8328
9055
  nullable: true
8329
9056
  },
8330
9057
  yearLow: {
8331
- type: 'object',
9058
+ type: 'string',
8332
9059
  description: '52-week low (Decimal string)',
8333
9060
  nullable: true
8334
9061
  }