@firela/api-types 0.0.0-canary.411600e0 → 0.0.0-canary.4e3af49c

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.
@@ -6,18 +6,12 @@ export const $CreateAccountDto = {
6
6
  path: {
7
7
  type: 'string',
8
8
  description: 'Account path (hierarchical, colon-separated)',
9
- example: 'Assets:CN:Bank:ICBC:Checking'
10
- },
11
- displayName: {
12
- type: 'string',
13
- description:
14
- 'Display name to distinguish accounts at the same path (default: "")',
15
- example: '工资卡'
9
+ example: 'Assets:CN:ICBC:Checking'
16
10
  },
17
11
  openDate: {
18
12
  format: 'date-time',
19
13
  type: 'string',
20
- description: 'Account open date',
14
+ description: 'Account open date (server defaults to today)',
21
15
  example: '2024-01-01'
22
16
  },
23
17
  currencies: {
@@ -45,26 +39,22 @@ export const $CreateAccountDto = {
45
39
  templatePath: {
46
40
  type: 'string',
47
41
  description: 'Reference to account-standards template path',
48
- example: 'Assets:CN:Bank:ICBC:Checking'
42
+ example: 'Assets:CN:Checking'
49
43
  },
50
44
  isCustom: {
51
45
  type: 'boolean',
52
46
  description: 'Whether this is a custom (user-created) account',
53
47
  default: false
54
48
  },
55
- i18nKey: {
56
- type: 'string',
57
- description: 'i18n key for display name (overrides template)',
58
- example: 'account.custom.mybank'
59
- },
60
49
  icon: {
61
50
  type: 'string',
62
51
  description: 'Icon identifier (overrides template)',
63
52
  example: 'bank-custom'
64
53
  },
65
- openMeta: {
54
+ openDirectiveMeta: {
66
55
  type: 'object',
67
- description: 'Additional metadata',
56
+ description:
57
+ 'Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)',
68
58
  example: {
69
59
  branch: 'Downtown',
70
60
  accountNumber: '1234'
@@ -76,7 +66,7 @@ export const $CreateAccountDto = {
76
66
  example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
77
67
  }
78
68
  },
79
- required: ['path', 'openDate']
69
+ required: ['path']
80
70
  } as const;
81
71
 
82
72
  export const $AccountResponseDto = {
@@ -90,13 +80,7 @@ export const $AccountResponseDto = {
90
80
  path: {
91
81
  type: 'string',
92
82
  description: 'Account path (hierarchical, colon-separated)',
93
- example: 'Assets:CN:Bank:ICBC:Checking'
94
- },
95
- displayName: {
96
- type: 'string',
97
- description:
98
- 'Display name distinguishing multiple accounts at the same path',
99
- example: '工资卡'
83
+ example: 'Assets:CN:ICBC:Checking'
100
84
  },
101
85
  type: {
102
86
  type: 'string',
@@ -104,6 +88,47 @@ export const $AccountResponseDto = {
104
88
  enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
105
89
  example: 'Assets'
106
90
  },
91
+ assetSubClass: {
92
+ type: 'string',
93
+ description:
94
+ 'Account-level asset sub-class (product type, e.g. STOCK/DEPOSIT/CREDIT_CARD/PERSONAL_LOAN). Computed from the account path via the asset-classifier (ADR-0077). Null for non-asset accounts (Income/Expenses/Equity) or unmatched paths.',
95
+ enum: [
96
+ 'DEPOSIT',
97
+ 'CASH',
98
+ 'MONEY_MARKET_FUND',
99
+ 'STOCK',
100
+ 'ETF',
101
+ 'MUTUAL_FUND',
102
+ 'EQUITY_COMPENSATION',
103
+ 'GOVERNMENT_BOND',
104
+ 'CORPORATE_BOND',
105
+ 'BOND_FUND',
106
+ 'PRIMARY_RESIDENCE',
107
+ 'INVESTMENT_PROPERTY',
108
+ 'REIT',
109
+ 'GOLD',
110
+ 'SILVER',
111
+ 'PRECIOUS_METAL',
112
+ 'PRECIOUS_METAL_FUND',
113
+ 'COMMODITY',
114
+ 'COMMODITY_FUND',
115
+ 'CRYPTOCURRENCY',
116
+ 'RETIREMENT_ACCOUNT',
117
+ 'HEALTH_ACCOUNT',
118
+ 'EDUCATION_ACCOUNT',
119
+ 'INSURANCE',
120
+ 'PRIVATE_EQUITY',
121
+ 'HEDGE_FUND',
122
+ 'COLLECTIBLES',
123
+ 'MORTGAGE',
124
+ 'STUDENT_LOAN',
125
+ 'CREDIT_CARD',
126
+ 'PERSONAL_LOAN',
127
+ 'OTHER'
128
+ ],
129
+ nullable: true,
130
+ example: 'STOCK'
131
+ },
107
132
  status: {
108
133
  type: 'string',
109
134
  description: 'Account status',
@@ -145,26 +170,26 @@ export const $AccountResponseDto = {
145
170
  templatePath: {
146
171
  type: 'string',
147
172
  description: 'Template path reference',
148
- example: 'Assets:CN:Bank:ICBC:Checking'
173
+ example: 'Assets:CN:Checking'
149
174
  },
150
175
  isCustom: {
151
176
  type: 'boolean',
152
177
  description: 'Whether this is a custom (user-created) account',
153
178
  example: false
154
179
  },
155
- i18nKey: {
180
+ displayName: {
156
181
  type: 'string',
157
- description: 'i18n key for display name',
158
- example: 'account.assets.cn.bank.icbc.checking'
182
+ description: 'Localized display name (ADR-0114, read-time projection)',
183
+ example: 'Checking'
159
184
  },
160
185
  icon: {
161
186
  type: 'string',
162
187
  description: 'Icon identifier',
163
188
  example: 'bank-icbc'
164
189
  },
165
- openMeta: {
190
+ openDirectiveMeta: {
166
191
  type: 'object',
167
- description: 'Account metadata',
192
+ description: 'Open directive metadata (ADR-0115 Decision 9)',
168
193
  example: {
169
194
  branch: 'Downtown'
170
195
  }
@@ -192,7 +217,6 @@ export const $AccountResponseDto = {
192
217
  required: [
193
218
  'id',
194
219
  'path',
195
- 'displayName',
196
220
  'type',
197
221
  'status',
198
222
  'openDate',
@@ -225,11 +249,6 @@ export const $AccountListResponseDto = {
225
249
  export const $UpdateAccountDto = {
226
250
  type: 'object',
227
251
  properties: {
228
- displayName: {
229
- type: 'string',
230
- description: 'Display name to distinguish accounts at the same path',
231
- example: '招行工资卡'
232
- },
233
252
  currencies: {
234
253
  description: 'Allowed currencies (null = no restriction)',
235
254
  example: ['CNY', 'USD'],
@@ -251,19 +270,15 @@ export const $UpdateAccountDto = {
251
270
  'NONE'
252
271
  ]
253
272
  },
254
- i18nKey: {
255
- type: 'string',
256
- description: 'i18n key for display name',
257
- example: 'account.custom.mybank'
258
- },
259
273
  icon: {
260
274
  type: 'string',
261
275
  description: 'Icon identifier',
262
276
  example: 'bank-custom'
263
277
  },
264
- openMeta: {
278
+ openDirectiveMeta: {
265
279
  type: 'object',
266
- description: 'Additional metadata (merged with existing)',
280
+ description:
281
+ 'Open directive metadata (merged with existing; NOT an opening-balance amount)',
267
282
  example: {
268
283
  branch: 'Uptown'
269
284
  }
@@ -310,13 +325,47 @@ export const $ReopenAccountDto = {
310
325
  }
311
326
  } as const;
312
327
 
328
+ export const $CreateOpeningBalanceDto = {
329
+ type: 'object',
330
+ properties: {
331
+ amount: {
332
+ type: 'number',
333
+ description: 'Opening balance amount (non-negative)',
334
+ example: 1000
335
+ },
336
+ currency: {
337
+ type: 'string',
338
+ description: 'Currency code',
339
+ example: 'CNY'
340
+ },
341
+ date: {
342
+ format: 'date-time',
343
+ type: 'string',
344
+ description: 'Opening-balance date (defaults to now)',
345
+ example: '2024-01-01'
346
+ }
347
+ },
348
+ required: ['amount', 'currency']
349
+ } as const;
350
+
351
+ export const $OpeningBalanceResultDto = {
352
+ type: 'object',
353
+ properties: {
354
+ transactionId: {
355
+ type: 'string',
356
+ description: 'Created opening-balance transaction id.'
357
+ }
358
+ },
359
+ required: ['transactionId']
360
+ } as const;
361
+
313
362
  export const $AccountStandardResponseDto = {
314
363
  type: 'object',
315
364
  properties: {
316
365
  path: {
317
366
  type: 'string',
318
367
  description: 'Account path (hierarchical, colon-separated)',
319
- example: 'Assets:CN:Bank:ICBC:Checking'
368
+ example: 'Assets:CN:Checking'
320
369
  },
321
370
  type: {
322
371
  type: 'string',
@@ -324,11 +373,6 @@ export const $AccountStandardResponseDto = {
324
373
  enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
325
374
  example: 'Assets'
326
375
  },
327
- i18nKey: {
328
- type: 'string',
329
- description: 'i18n key for localized display name',
330
- example: 'account.assets.cn.bank.icbc.checking'
331
- },
332
376
  name: {
333
377
  type: 'string',
334
378
  description: 'Short localized display name',
@@ -353,7 +397,7 @@ export const $AccountStandardResponseDto = {
353
397
  example: 'bank-icbc'
354
398
  }
355
399
  },
356
- required: ['path', 'type', 'i18nKey', 'description', 'tags', 'icon']
400
+ required: ['path', 'type', 'description', 'tags', 'icon']
357
401
  } as const;
358
402
 
359
403
  export const $AccountStandardListResponseDto = {
@@ -383,18 +427,13 @@ export const $AccountStandardListResponseDto = {
383
427
  export const $TemplateMetadataDto = {
384
428
  type: 'object',
385
429
  properties: {
386
- extendable: {
387
- type: 'boolean',
388
- description: 'Whether this path can be extended',
389
- example: true
390
- },
391
430
  rootType: {
392
431
  type: 'string',
393
432
  description: 'Root account type',
394
433
  example: 'Assets'
395
434
  }
396
435
  },
397
- required: ['extendable', 'rootType']
436
+ required: ['rootType']
398
437
  } as const;
399
438
 
400
439
  export const $TemplateMetadataResponseDto = {
@@ -533,7 +572,7 @@ export const $CreatePostingDto = {
533
572
  type: 'string',
534
573
  description:
535
574
  'Account name in Beancount format (must start with uppercase, colon-separated)',
536
- example: 'Assets:Bank:Checking'
575
+ example: 'Assets:Checking'
537
576
  },
538
577
  units: {
539
578
  type: 'string',
@@ -692,7 +731,7 @@ export const $PostingResponseDto = {
692
731
  account: {
693
732
  type: 'string',
694
733
  description: 'Account name',
695
- example: 'Assets:Bank:Checking'
734
+ example: 'Assets:Checking'
696
735
  },
697
736
  units: {
698
737
  type: 'string',
@@ -1058,7 +1097,7 @@ export const $PostingDetailDto = {
1058
1097
  account: {
1059
1098
  type: 'string',
1060
1099
  description: 'Fully-qualified Beancount account path',
1061
- example: 'Assets:Bank:Checking'
1100
+ example: 'Assets:Checking'
1062
1101
  },
1063
1102
  units: {
1064
1103
  type: 'string',
@@ -1247,6 +1286,77 @@ export const $TransactionDetailDto = {
1247
1286
  ]
1248
1287
  } as const;
1249
1288
 
1289
+ export const $BalanceByCurrencyDto = {
1290
+ type: 'object',
1291
+ properties: {
1292
+ currency: {
1293
+ type: 'string',
1294
+ description: 'ISO 4217 currency code',
1295
+ example: 'CNY'
1296
+ },
1297
+ balance: {
1298
+ type: 'string',
1299
+ description: 'Balance amount',
1300
+ example: '50000.00'
1301
+ }
1302
+ },
1303
+ required: ['currency', 'balance']
1304
+ } as const;
1305
+
1306
+ export const $ExchangeRateWarningDto = {
1307
+ type: 'object',
1308
+ properties: {
1309
+ type: {
1310
+ type: 'string',
1311
+ description: 'Warning type',
1312
+ example: 'MISSING_EXCHANGE_RATE'
1313
+ },
1314
+ currency: {
1315
+ type: 'string',
1316
+ description: 'Currency without exchange rate',
1317
+ example: 'EUR'
1318
+ },
1319
+ totalAmount: {
1320
+ type: 'string',
1321
+ description: 'Total amount affected',
1322
+ example: '1000.00'
1323
+ }
1324
+ },
1325
+ required: ['type', 'currency', 'totalAmount']
1326
+ } as const;
1327
+
1328
+ export const $TransactionListSummaryDto = {
1329
+ type: 'object',
1330
+ properties: {
1331
+ totalAmount: {
1332
+ type: 'string',
1333
+ description:
1334
+ '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.',
1335
+ example: '-6000.00'
1336
+ },
1337
+ currency: {
1338
+ type: 'string',
1339
+ description: 'Base currency (ISO 4217)',
1340
+ example: 'CNY'
1341
+ },
1342
+ balanceByCurrency: {
1343
+ description: 'Raw (unconverted) balance per currency',
1344
+ type: 'array',
1345
+ items: {
1346
+ $ref: '#/components/schemas/BalanceByCurrencyDto'
1347
+ }
1348
+ },
1349
+ warnings: {
1350
+ description: 'Currencies missing an FX rate (omitted when empty)',
1351
+ type: 'array',
1352
+ items: {
1353
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
1354
+ }
1355
+ }
1356
+ },
1357
+ required: ['totalAmount', 'currency', 'balanceByCurrency']
1358
+ } as const;
1359
+
1250
1360
  export const $TransactionListResponseDto = {
1251
1361
  type: 'object',
1252
1362
  properties: {
@@ -1271,6 +1381,15 @@ export const $TransactionListResponseDto = {
1271
1381
  type: 'number',
1272
1382
  description: 'Number of items skipped',
1273
1383
  example: 0
1384
+ },
1385
+ summary: {
1386
+ description:
1387
+ 'Amount summary for the full filtered set (#514). Present only when the request has a single account OR category viewpoint; omitted for search-only / plain-list / dual-perspective requests.',
1388
+ allOf: [
1389
+ {
1390
+ $ref: '#/components/schemas/TransactionListSummaryDto'
1391
+ }
1392
+ ]
1274
1393
  }
1275
1394
  },
1276
1395
  required: ['data', 'total', 'limit', 'offset']
@@ -1370,7 +1489,7 @@ export const $BalanceResponseDto = {
1370
1489
  account: {
1371
1490
  type: 'string',
1372
1491
  description: 'Account name',
1373
- example: 'Assets:Bank:Checking'
1492
+ example: 'Assets:Checking'
1374
1493
  },
1375
1494
  balance: {
1376
1495
  type: 'string',
@@ -1397,7 +1516,7 @@ export const $MultiCurrencyBalanceResponseDto = {
1397
1516
  account: {
1398
1517
  type: 'string',
1399
1518
  description: 'Account name',
1400
- example: 'Assets:Bank:Checking'
1519
+ example: 'Assets:Checking'
1401
1520
  },
1402
1521
  balances: {
1403
1522
  type: 'object',
@@ -1453,7 +1572,7 @@ export const $TransactionSummaryDto = {
1453
1572
  accountName: {
1454
1573
  type: 'string',
1455
1574
  description: 'Source account name (first posting)',
1456
- example: 'Assets:Bank:Checking'
1575
+ example: 'Assets:Checking'
1457
1576
  },
1458
1577
  sourceType: {
1459
1578
  type: 'string',
@@ -2745,117 +2864,274 @@ export const $UpdateCommodityDto = {
2745
2864
  }
2746
2865
  } as const;
2747
2866
 
2748
- export const $CreateRecurringRuleDto = {
2867
+ export const $CreateBeanPriceDto = {
2749
2868
  type: 'object',
2750
2869
  properties: {
2751
- name: {
2752
- type: 'string',
2753
- description: 'Rule name (unique per user)',
2754
- maxLength: 100
2755
- },
2756
- icon: {
2757
- type: 'string',
2758
- description: 'Icon emoji',
2759
- maxLength: 10
2760
- },
2761
- frequency: {
2762
- type: 'string',
2763
- description: 'Recurring frequency',
2764
- enum: [
2765
- 'WEEKLY',
2766
- 'BIWEEKLY',
2767
- 'MONTHLY',
2768
- 'BIMONTHLY',
2769
- 'QUARTERLY',
2770
- 'YEARLY',
2771
- 'CUSTOM'
2772
- ]
2773
- },
2774
- expectedAmount: {
2775
- type: 'number',
2776
- description: 'Expected amount (positive number)',
2777
- minimum: 0
2778
- },
2779
- expectedDay: {
2780
- type: 'number',
2781
- description: 'Expected day of month (1-31)',
2782
- minimum: 1,
2783
- maximum: 31
2784
- },
2785
- customIntervalDays: {
2786
- type: 'number',
2787
- description: 'Custom interval in days (required for CUSTOM frequency)',
2788
- minimum: 1
2789
- },
2790
2870
  currency: {
2791
2871
  type: 'string',
2792
- description: 'Currency code',
2793
- default: 'CNY',
2794
- maxLength: 10
2872
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
2873
+ example: 'USD'
2795
2874
  },
2796
- matchPayeePattern: {
2875
+ quoteCurrency: {
2797
2876
  type: 'string',
2798
- description: 'Payee matching pattern (supports wildcards)',
2799
- maxLength: 200
2877
+ description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
2878
+ example: 'CNY'
2800
2879
  },
2801
- matchAmountTolerance: {
2880
+ amount: {
2802
2881
  type: 'number',
2803
- description: 'Amount tolerance percentage (0-1)',
2804
- default: 0.075,
2805
- minimum: 0,
2806
- maximum: 1
2807
- },
2808
- defaultExpenseAccount: {
2809
- type: 'string',
2810
- description: 'Default expense account for auto-create',
2811
- maxLength: 200
2812
- },
2813
- defaultPaymentAccount: {
2814
- type: 'string',
2815
- description: 'Default payment account for auto-create',
2816
- maxLength: 200
2817
- },
2818
- defaultPayee: {
2819
- type: 'string',
2820
- description: 'Default payee for auto-create',
2821
- maxLength: 200
2822
- },
2823
- autoCreate: {
2824
- type: 'boolean',
2825
- description: 'Auto-create transaction when expected date arrives',
2826
- default: false
2882
+ description:
2883
+ 'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
2884
+ example: 175.5,
2885
+ minimum: 0
2827
2886
  },
2828
- startDate: {
2887
+ date: {
2829
2888
  type: 'string',
2830
- description: 'Rule start date (ISO format)'
2889
+ description: 'Price date (ISO 8601 format)',
2890
+ example: '2024-11-05'
2831
2891
  },
2832
- endDate: {
2833
- type: 'string',
2834
- description: 'Rule end date (ISO format)'
2892
+ metadata: {
2893
+ type: 'object',
2894
+ description:
2895
+ 'Metadata (validated by Zod schema, max field lengths enforced)',
2896
+ example: {
2897
+ source: 'MANUAL',
2898
+ note: 'Bank valuation report',
2899
+ confidence: 0.95
2900
+ }
2835
2901
  }
2836
2902
  },
2837
- required: [
2838
- 'name',
2839
- 'frequency',
2840
- 'expectedAmount',
2841
- 'currency',
2842
- 'matchAmountTolerance',
2843
- 'autoCreate'
2844
- ]
2903
+ required: ['currency', 'quoteCurrency', 'amount', 'date']
2845
2904
  } as const;
2846
2905
 
2847
- export const $RecurringRuleResponseDto = {
2906
+ export const $PriceResponseDto = {
2848
2907
  type: 'object',
2849
2908
  properties: {
2850
2909
  id: {
2851
2910
  type: 'string',
2852
- description: 'Rule ID'
2911
+ description: 'Unique identifier',
2912
+ example: 'uuid-123-456'
2853
2913
  },
2854
2914
  userId: {
2855
2915
  type: 'string',
2856
- description: 'User ID'
2916
+ description: 'User ID (owner of the price)',
2917
+ example: 'user-123'
2857
2918
  },
2858
- name: {
2919
+ currency: {
2920
+ type: 'string',
2921
+ description: 'Currency being priced (e.g., USD, AAPL, BTC)',
2922
+ example: 'BTC'
2923
+ },
2924
+ quoteCurrency: {
2925
+ type: 'string',
2926
+ description: 'Quote currency (pricing currency, e.g., USD, CNY)',
2927
+ example: 'USD'
2928
+ },
2929
+ amount: {
2930
+ type: 'number',
2931
+ description:
2932
+ 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
2933
+ example: 50000
2934
+ },
2935
+ date: {
2936
+ type: 'string',
2937
+ description:
2938
+ 'Price date (ISO 8601 format). Represents the date this price was valid.',
2939
+ example: '2024-01-01',
2940
+ format: 'date'
2941
+ },
2942
+ meta: {
2943
+ type: 'object',
2944
+ description:
2945
+ 'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
2946
+ example: {
2947
+ source: 'MANUAL',
2948
+ note: 'User-defined price',
2949
+ confidence: 1
2950
+ }
2951
+ },
2952
+ createdAt: {
2953
+ format: 'date-time',
2954
+ type: 'string',
2955
+ description: 'Creation timestamp',
2956
+ example: '2024-11-03T10:00:00Z'
2957
+ },
2958
+ updatedAt: {
2959
+ format: 'date-time',
2960
+ type: 'string',
2961
+ description: 'Last update timestamp',
2962
+ example: '2024-11-03T10:00:00Z'
2963
+ }
2964
+ },
2965
+ required: [
2966
+ 'id',
2967
+ 'userId',
2968
+ 'currency',
2969
+ 'quoteCurrency',
2970
+ 'amount',
2971
+ 'date',
2972
+ 'meta',
2973
+ 'createdAt',
2974
+ 'updatedAt'
2975
+ ]
2976
+ } as const;
2977
+
2978
+ export const $PriceListResponseDto = {
2979
+ type: 'object',
2980
+ properties: {
2981
+ items: {
2982
+ description: 'List of prices',
2983
+ type: 'array',
2984
+ items: {
2985
+ $ref: '#/components/schemas/PriceResponseDto'
2986
+ }
2987
+ },
2988
+ total: {
2989
+ type: 'number',
2990
+ description: 'Total number of prices',
2991
+ example: 42
2992
+ }
2993
+ },
2994
+ required: ['items', 'total']
2995
+ } as const;
2996
+
2997
+ export const $UpdateBeanPriceDto = {
2998
+ type: 'object',
2999
+ properties: {
3000
+ currency: {
3001
+ type: 'string',
3002
+ description: 'Currency being priced'
3003
+ },
3004
+ quoteCurrency: {
3005
+ type: 'string',
3006
+ description: 'Quote currency (pricing currency)'
3007
+ },
3008
+ amount: {
3009
+ type: 'number',
3010
+ description: 'Price amount (MUST be >= 0 per Beancount spec)',
3011
+ minimum: 0
3012
+ },
3013
+ date: {
3014
+ type: 'string',
3015
+ description: 'Price date (ISO 8601 format)'
3016
+ },
3017
+ metadata: {
3018
+ type: 'object',
3019
+ description: 'Metadata'
3020
+ }
3021
+ }
3022
+ } as const;
3023
+
3024
+ export const $CreateRecurringRuleDto = {
3025
+ type: 'object',
3026
+ properties: {
3027
+ name: {
3028
+ type: 'string',
3029
+ description: 'Rule name (unique per user)',
3030
+ maxLength: 100
3031
+ },
3032
+ icon: {
3033
+ type: 'string',
3034
+ description: 'Icon emoji',
3035
+ maxLength: 10
3036
+ },
3037
+ frequency: {
3038
+ type: 'string',
3039
+ description: 'Recurring frequency',
3040
+ enum: [
3041
+ 'WEEKLY',
3042
+ 'BIWEEKLY',
3043
+ 'MONTHLY',
3044
+ 'BIMONTHLY',
3045
+ 'QUARTERLY',
3046
+ 'YEARLY',
3047
+ 'CUSTOM'
3048
+ ]
3049
+ },
3050
+ expectedAmount: {
3051
+ type: 'number',
3052
+ description: 'Expected amount (positive number)',
3053
+ minimum: 0
3054
+ },
3055
+ expectedDay: {
3056
+ type: 'number',
3057
+ description: 'Expected day of month (1-31)',
3058
+ minimum: 1,
3059
+ maximum: 31
3060
+ },
3061
+ customIntervalDays: {
3062
+ type: 'number',
3063
+ description: 'Custom interval in days (required for CUSTOM frequency)',
3064
+ minimum: 1
3065
+ },
3066
+ currency: {
3067
+ type: 'string',
3068
+ description: 'Currency code',
3069
+ default: 'CNY',
3070
+ maxLength: 10
3071
+ },
3072
+ matchPayeePattern: {
3073
+ type: 'string',
3074
+ description: 'Payee matching pattern (supports wildcards)',
3075
+ maxLength: 200
3076
+ },
3077
+ matchAmountTolerance: {
3078
+ type: 'number',
3079
+ description: 'Amount tolerance percentage (0-1)',
3080
+ default: 0.075,
3081
+ minimum: 0,
3082
+ maximum: 1
3083
+ },
3084
+ defaultExpenseAccount: {
3085
+ type: 'string',
3086
+ description: 'Default expense account for auto-create',
3087
+ maxLength: 200
3088
+ },
3089
+ defaultPaymentAccount: {
3090
+ type: 'string',
3091
+ description: 'Default payment account for auto-create',
3092
+ maxLength: 200
3093
+ },
3094
+ defaultPayee: {
3095
+ type: 'string',
3096
+ description: 'Default payee for auto-create',
3097
+ maxLength: 200
3098
+ },
3099
+ autoCreate: {
3100
+ type: 'boolean',
3101
+ description: 'Auto-create transaction when expected date arrives',
3102
+ default: false
3103
+ },
3104
+ startDate: {
3105
+ type: 'string',
3106
+ description: 'Rule start date (ISO format)'
3107
+ },
3108
+ endDate: {
3109
+ type: 'string',
3110
+ description: 'Rule end date (ISO format)'
3111
+ }
3112
+ },
3113
+ required: [
3114
+ 'name',
3115
+ 'frequency',
3116
+ 'expectedAmount',
3117
+ 'currency',
3118
+ 'matchAmountTolerance',
3119
+ 'autoCreate'
3120
+ ]
3121
+ } as const;
3122
+
3123
+ export const $RecurringRuleResponseDto = {
3124
+ type: 'object',
3125
+ properties: {
3126
+ id: {
3127
+ type: 'string',
3128
+ description: 'Rule ID'
3129
+ },
3130
+ userId: {
3131
+ type: 'string',
3132
+ description: 'User ID'
3133
+ },
3134
+ name: {
2859
3135
  type: 'string',
2860
3136
  description: 'Rule name'
2861
3137
  },
@@ -3516,30 +3792,477 @@ export const $ForecastResponseDto = {
3516
3792
  ]
3517
3793
  } as const;
3518
3794
 
3519
- export const $CreateTransactionRuleDto = {
3795
+ export const $CurrencyBalanceDto = {
3520
3796
  type: 'object',
3521
3797
  properties: {
3522
- name: {
3798
+ currency: {
3523
3799
  type: 'string',
3524
- minLength: 1,
3525
- maxLength: 100
3800
+ description: 'ISO 4217 currency code',
3801
+ example: 'CNY'
3526
3802
  },
3527
- description: {
3803
+ balance: {
3528
3804
  type: 'string',
3529
- maxLength: 500
3805
+ description: 'Balance amount',
3806
+ example: '500000.00'
3807
+ }
3808
+ },
3809
+ required: ['currency', 'balance']
3810
+ } as const;
3811
+
3812
+ export const $TimeSeriesPointDto = {
3813
+ type: 'object',
3814
+ properties: {
3815
+ date: {
3816
+ type: 'string',
3817
+ description: 'Date in YYYY-MM-DD format',
3818
+ example: '2024-06-15'
3530
3819
  },
3531
- narrationKeywords: {
3532
- items: {
3533
- type: 'array'
3534
- },
3535
- maxItems: 50,
3536
- type: 'array'
3820
+ value: {
3821
+ type: 'string',
3822
+ description: 'Value at this date (in base currency)',
3823
+ example: '500000.00'
3537
3824
  },
3538
- payeeKeywords: {
3539
- items: {
3540
- type: 'array'
3541
- },
3542
- maxItems: 50,
3825
+ change: {
3826
+ type: 'object',
3827
+ description: 'Change from previous point',
3828
+ example: '5000.00'
3829
+ },
3830
+ assets: {
3831
+ type: 'string',
3832
+ description: 'Total assets at this date (in base currency)',
3833
+ example: '494338.00'
3834
+ },
3835
+ liabilities: {
3836
+ type: 'string',
3837
+ description: 'Total liabilities at this date (in base currency)',
3838
+ example: '310098.00'
3839
+ },
3840
+ byCurrency: {
3841
+ description: 'Multi-currency breakdown for this point',
3842
+ type: 'array',
3843
+ items: {
3844
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3845
+ }
3846
+ }
3847
+ },
3848
+ required: ['date', 'value']
3849
+ } as const;
3850
+
3851
+ export const $TrendSummaryDto = {
3852
+ type: 'object',
3853
+ properties: {
3854
+ startValue: {
3855
+ type: 'string',
3856
+ description: 'Value at start of period',
3857
+ example: '450000.00'
3858
+ },
3859
+ endValue: {
3860
+ type: 'string',
3861
+ description: 'Value at end of period',
3862
+ example: '500000.00'
3863
+ },
3864
+ totalChange: {
3865
+ type: 'string',
3866
+ description: 'Total change over period',
3867
+ example: '50000.00'
3868
+ },
3869
+ totalChangePercentage: {
3870
+ type: 'string',
3871
+ description: 'Total change percentage',
3872
+ example: '+11.11%'
3873
+ }
3874
+ },
3875
+ required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
3876
+ } as const;
3877
+
3878
+ export const $MultiCurrencyPointDto = {
3879
+ type: 'object',
3880
+ properties: {
3881
+ date: {
3882
+ type: 'string',
3883
+ description: 'Date in YYYY-MM-DD format',
3884
+ example: '2024-06-15'
3885
+ },
3886
+ byCurrency: {
3887
+ description: 'Balances by currency',
3888
+ type: 'array',
3889
+ items: {
3890
+ $ref: '#/components/schemas/CurrencyBalanceDto'
3891
+ }
3892
+ }
3893
+ },
3894
+ required: ['date', 'byCurrency']
3895
+ } as const;
3896
+
3897
+ export const $PortfolioTrendsResponseDto = {
3898
+ type: 'object',
3899
+ properties: {
3900
+ series: {
3901
+ description: 'Time series data points',
3902
+ type: 'array',
3903
+ items: {
3904
+ $ref: '#/components/schemas/TimeSeriesPointDto'
3905
+ }
3906
+ },
3907
+ summary: {
3908
+ description: 'Period summary',
3909
+ allOf: [
3910
+ {
3911
+ $ref: '#/components/schemas/TrendSummaryDto'
3912
+ }
3913
+ ]
3914
+ },
3915
+ period: {
3916
+ type: 'string',
3917
+ description: 'Period requested',
3918
+ example: '6m'
3919
+ },
3920
+ granularity: {
3921
+ type: 'string',
3922
+ description: 'Data granularity',
3923
+ example: 'month'
3924
+ },
3925
+ currency: {
3926
+ type: 'string',
3927
+ description: 'Base currency for converted values',
3928
+ example: 'CNY'
3929
+ },
3930
+ byCurrency: {
3931
+ description:
3932
+ 'Multi-currency time series (each point has currency breakdown)',
3933
+ type: 'array',
3934
+ items: {
3935
+ $ref: '#/components/schemas/MultiCurrencyPointDto'
3936
+ }
3937
+ },
3938
+ warnings: {
3939
+ description: 'Exchange rate warnings',
3940
+ type: 'array',
3941
+ items: {
3942
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
3943
+ }
3944
+ }
3945
+ },
3946
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
3947
+ } as const;
3948
+
3949
+ export const $CashFlowPointDto = {
3950
+ type: 'object',
3951
+ properties: {
3952
+ month: {
3953
+ type: 'string',
3954
+ description: 'Month key (YYYY-MM)',
3955
+ example: '2024-03'
3956
+ },
3957
+ income: {
3958
+ type: 'string',
3959
+ description: 'Income in base currency (absolute, converted)',
3960
+ example: '10000.00'
3961
+ },
3962
+ expense: {
3963
+ type: 'string',
3964
+ description: 'Expense in base currency (absolute, converted)',
3965
+ example: '5000.00'
3966
+ },
3967
+ netSavings: {
3968
+ type: 'string',
3969
+ description: 'netSavings = income − expense (savings positive)',
3970
+ example: '5000.00'
3971
+ }
3972
+ },
3973
+ required: ['month', 'income', 'expense', 'netSavings']
3974
+ } as const;
3975
+
3976
+ export const $CashFlowTrendSummaryDto = {
3977
+ type: 'object',
3978
+ properties: {
3979
+ totalIncome: {
3980
+ type: 'string',
3981
+ description: 'Total income across the period',
3982
+ example: '60000.00'
3983
+ },
3984
+ totalExpense: {
3985
+ type: 'string',
3986
+ description: 'Total expense across the period',
3987
+ example: '30000.00'
3988
+ },
3989
+ totalNetSavings: {
3990
+ type: 'string',
3991
+ description: 'income − expense across the period',
3992
+ example: '30000.00'
3993
+ },
3994
+ averageMonthlyNetSavings: {
3995
+ type: 'string',
3996
+ description:
3997
+ 'totalNetSavings divided by the window length (N months, incl. zero-filled)',
3998
+ example: '5000.00'
3999
+ }
4000
+ },
4001
+ required: [
4002
+ 'totalIncome',
4003
+ 'totalExpense',
4004
+ 'totalNetSavings',
4005
+ 'averageMonthlyNetSavings'
4006
+ ]
4007
+ } as const;
4008
+
4009
+ export const $CashFlowTrendsResponseDto = {
4010
+ type: 'object',
4011
+ properties: {
4012
+ series: {
4013
+ description:
4014
+ 'Monthly cash-flow series (fixed N-month window, zero-filled)',
4015
+ type: 'array',
4016
+ items: {
4017
+ $ref: '#/components/schemas/CashFlowPointDto'
4018
+ }
4019
+ },
4020
+ summary: {
4021
+ description: 'Period totals',
4022
+ allOf: [
4023
+ {
4024
+ $ref: '#/components/schemas/CashFlowTrendSummaryDto'
4025
+ }
4026
+ ]
4027
+ },
4028
+ period: {
4029
+ type: 'string',
4030
+ description: 'Period requested',
4031
+ example: '6m'
4032
+ },
4033
+ granularity: {
4034
+ type: 'string',
4035
+ description: 'Data granularity (v1 returns month buckets)',
4036
+ example: 'month'
4037
+ },
4038
+ currency: {
4039
+ type: 'string',
4040
+ description: 'Base currency for converted values',
4041
+ example: 'CNY'
4042
+ },
4043
+ warnings: {
4044
+ description: 'Exchange rate warnings (e.g. missing rate for a currency)',
4045
+ type: 'array',
4046
+ items: {
4047
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
4048
+ }
4049
+ }
4050
+ },
4051
+ required: ['series', 'summary', 'period', 'granularity', 'currency']
4052
+ } as const;
4053
+
4054
+ export const $GenerateSnapshotBody = {
4055
+ type: 'object',
4056
+ properties: {}
4057
+ } as const;
4058
+
4059
+ export const $GenerateSnapshotResponse = {
4060
+ type: 'object',
4061
+ properties: {}
4062
+ } as const;
4063
+
4064
+ export const $BackfillSnapshotsBody = {
4065
+ type: 'object',
4066
+ properties: {}
4067
+ } as const;
4068
+
4069
+ export const $BackfillSnapshotsResponse = {
4070
+ type: 'object',
4071
+ properties: {}
4072
+ } as const;
4073
+
4074
+ export const $DeleteOwnUserDto = {
4075
+ type: 'object',
4076
+ properties: {
4077
+ accessToken: {
4078
+ type: 'string',
4079
+ description: 'Access token for user verification',
4080
+ example: 'abc123xyz'
4081
+ }
4082
+ },
4083
+ required: ['accessToken']
4084
+ } as const;
4085
+
4086
+ export const $SignupDto = {
4087
+ type: 'object',
4088
+ properties: {
4089
+ turnstileToken: {
4090
+ type: 'string',
4091
+ description:
4092
+ 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4093
+ example: '0.abc123def456...'
4094
+ }
4095
+ }
4096
+ } as const;
4097
+
4098
+ export const $SignupResponseDto = {
4099
+ type: 'object',
4100
+ properties: {
4101
+ authToken: {
4102
+ type: 'string',
4103
+ description: 'JWT auth token',
4104
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
4105
+ },
4106
+ accessToken: {
4107
+ type: 'string',
4108
+ description: 'Auto-generated access token'
4109
+ },
4110
+ role: {
4111
+ type: 'string',
4112
+ description: 'Assigned user role',
4113
+ enum: ['USER', 'ADMIN', 'DEMO', 'INACTIVE', 'PAID', 'OPS']
4114
+ }
4115
+ },
4116
+ required: ['authToken', 'accessToken', 'role']
4117
+ } as const;
4118
+
4119
+ export const $UpdateUserSettingDto = {
4120
+ type: 'object',
4121
+ properties: {
4122
+ secId: {
4123
+ type: 'number',
4124
+ description: 'Security ID'
4125
+ },
4126
+ annualInterestRate: {
4127
+ type: 'number',
4128
+ description: 'Annual interest rate',
4129
+ example: 0.05
4130
+ },
4131
+ currency: {
4132
+ type: 'string',
4133
+ description: 'Currency code',
4134
+ example: 'USD'
4135
+ },
4136
+ baseCurrency: {
4137
+ type: 'string',
4138
+ description: 'Base currency code',
4139
+ example: 'USD'
4140
+ },
4141
+ benchmark: {
4142
+ type: 'string',
4143
+ description: 'Benchmark symbol',
4144
+ example: 'SPY'
4145
+ },
4146
+ colorScheme: {
4147
+ type: 'string',
4148
+ description: 'Color scheme',
4149
+ enum: ['DARK', 'LIGHT']
4150
+ },
4151
+ dateRange: {
4152
+ type: 'string',
4153
+ description: 'Date range filter',
4154
+ example: '1y'
4155
+ },
4156
+ emergencyFund: {
4157
+ type: 'number',
4158
+ description: 'Emergency fund amount',
4159
+ example: 10000
4160
+ },
4161
+ 'filters.accounts': {
4162
+ description: 'Account filter IDs',
4163
+ type: 'array',
4164
+ items: {
4165
+ type: 'string'
4166
+ }
4167
+ },
4168
+ 'filters.assetClasses': {
4169
+ description: 'Asset class filters',
4170
+ type: 'array',
4171
+ items: {
4172
+ type: 'string'
4173
+ }
4174
+ },
4175
+ 'filters.dataSource': {
4176
+ type: 'string',
4177
+ description: 'Data source filter'
4178
+ },
4179
+ 'filters.symbol': {
4180
+ type: 'string',
4181
+ description: 'Symbol filter'
4182
+ },
4183
+ 'filters.tags': {
4184
+ description: 'Tag filters',
4185
+ type: 'array',
4186
+ items: {
4187
+ type: 'string'
4188
+ }
4189
+ },
4190
+ isExperimentalFeatures: {
4191
+ type: 'boolean',
4192
+ description: 'Enable experimental features'
4193
+ },
4194
+ isRestrictedView: {
4195
+ type: 'boolean',
4196
+ description: 'Enable restricted view mode'
4197
+ },
4198
+ language: {
4199
+ type: 'string',
4200
+ description: 'Language code',
4201
+ example: 'en'
4202
+ },
4203
+ locale: {
4204
+ type: 'string',
4205
+ description: 'Locale code',
4206
+ example: 'en-US'
4207
+ },
4208
+ projectedTotalAmount: {
4209
+ type: 'number',
4210
+ description: 'Projected total amount',
4211
+ example: 1000000
4212
+ },
4213
+ retirementDate: {
4214
+ type: 'string',
4215
+ description: 'Retirement date in ISO 8601 format',
4216
+ example: '2050-01-01'
4217
+ },
4218
+ savingsRate: {
4219
+ type: 'number',
4220
+ description: 'Savings rate percentage',
4221
+ example: 0.2
4222
+ },
4223
+ viewMode: {
4224
+ type: 'string',
4225
+ description: 'View mode',
4226
+ enum: ['DEFAULT', 'ZEN']
4227
+ }
4228
+ }
4229
+ } as const;
4230
+
4231
+ export const $UpdatePropertyDto = {
4232
+ type: 'object',
4233
+ properties: {
4234
+ value: {
4235
+ type: 'string',
4236
+ description: 'Property value'
4237
+ }
4238
+ },
4239
+ required: ['value']
4240
+ } as const;
4241
+
4242
+ export const $CreateTransactionRuleDto = {
4243
+ type: 'object',
4244
+ properties: {
4245
+ name: {
4246
+ type: 'string',
4247
+ minLength: 1,
4248
+ maxLength: 100
4249
+ },
4250
+ description: {
4251
+ type: 'string',
4252
+ maxLength: 500
4253
+ },
4254
+ narrationKeywords: {
4255
+ items: {
4256
+ type: 'array'
4257
+ },
4258
+ maxItems: 50,
4259
+ type: 'array'
4260
+ },
4261
+ payeeKeywords: {
4262
+ items: {
4263
+ type: 'array'
4264
+ },
4265
+ maxItems: 50,
3543
4266
  type: 'array'
3544
4267
  },
3545
4268
  categoryKeywords: {
@@ -4165,151 +4888,393 @@ export const $TestRuleResponseDto = {
4165
4888
  required: ['ruleId', 'matches', 'confidence', 'matchDetails']
4166
4889
  } as const;
4167
4890
 
4168
- export const $DeleteOwnUserDto = {
4891
+ export const $CreateBeanEventDto = {
4169
4892
  type: 'object',
4170
4893
  properties: {
4171
- accessToken: {
4894
+ date: {
4172
4895
  type: 'string',
4173
- description: 'Access token for user verification',
4174
- example: 'abc123xyz'
4896
+ description: 'Life event date (ISO 8601)',
4897
+ example: '2024-03-15'
4898
+ },
4899
+ type: {
4900
+ type: 'string',
4901
+ description:
4902
+ 'Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer',
4903
+ example: 'employer'
4904
+ },
4905
+ description: {
4906
+ type: 'string',
4907
+ description:
4908
+ 'Life event description. Empty string is a VALID value (distinct from absence).',
4909
+ example: 'Acme Corp'
4910
+ },
4911
+ meta: {
4912
+ type: 'object',
4913
+ description:
4914
+ 'Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)',
4915
+ example: {
4916
+ note: 'Promotion'
4917
+ }
4175
4918
  }
4176
4919
  },
4177
- required: ['accessToken']
4920
+ required: ['date', 'type', 'description']
4178
4921
  } as const;
4179
4922
 
4180
- export const $SignupDto = {
4923
+ export const $EventResponseDto = {
4181
4924
  type: 'object',
4182
4925
  properties: {
4183
- turnstileToken: {
4926
+ id: {
4927
+ type: 'string',
4928
+ description: 'Unique identifier',
4929
+ example: 'uuid-123-456'
4930
+ },
4931
+ userId: {
4932
+ type: 'string',
4933
+ description: 'User ID (owner of the life event)',
4934
+ example: 'user-123'
4935
+ },
4936
+ date: {
4937
+ type: 'string',
4938
+ description: 'Life event date (ISO 8601 format)',
4939
+ example: '2024-03-15',
4940
+ format: 'date'
4941
+ },
4942
+ type: {
4184
4943
  type: 'string',
4185
4944
  description:
4186
- 'Cloudflare Turnstile verification token (optional when Turnstile disabled)',
4187
- example: '0.abc123def456...'
4945
+ 'Life event type (user-defined, e.g., "employer", "location")',
4946
+ example: 'employer'
4947
+ },
4948
+ description: {
4949
+ type: 'string',
4950
+ description:
4951
+ 'Life event description. May be an empty string (a valid value distinct from absence).',
4952
+ example: 'Acme Corp'
4953
+ },
4954
+ meta: {
4955
+ type: 'object',
4956
+ description: 'Product-side metadata (free-form JSON)',
4957
+ example: {
4958
+ note: 'Promotion'
4959
+ }
4960
+ },
4961
+ createdAt: {
4962
+ format: 'date-time',
4963
+ type: 'string',
4964
+ description: 'Creation timestamp',
4965
+ example: '2024-03-15T10:00:00Z'
4966
+ },
4967
+ updatedAt: {
4968
+ format: 'date-time',
4969
+ type: 'string',
4970
+ description:
4971
+ 'Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.',
4972
+ example: '2024-03-15T10:00:00Z'
4188
4973
  }
4189
- }
4974
+ },
4975
+ required: [
4976
+ 'id',
4977
+ 'userId',
4978
+ 'date',
4979
+ 'type',
4980
+ 'description',
4981
+ 'meta',
4982
+ 'createdAt',
4983
+ 'updatedAt'
4984
+ ]
4190
4985
  } as const;
4191
4986
 
4192
- export const $UpdateUserSettingDto = {
4987
+ export const $EventListResponseDto = {
4193
4988
  type: 'object',
4194
4989
  properties: {
4195
- secId: {
4196
- type: 'number',
4197
- description: 'Security ID'
4990
+ items: {
4991
+ description: 'List of life events',
4992
+ type: 'array',
4993
+ items: {
4994
+ $ref: '#/components/schemas/EventResponseDto'
4995
+ }
4198
4996
  },
4199
- annualInterestRate: {
4997
+ total: {
4200
4998
  type: 'number',
4201
- description: 'Annual interest rate',
4202
- example: 0.05
4999
+ description: 'Total number of life events matching the query',
5000
+ example: 42
5001
+ }
5002
+ },
5003
+ required: ['items', 'total']
5004
+ } as const;
5005
+
5006
+ export const $UpdateBeanEventDto = {
5007
+ type: 'object',
5008
+ properties: {
5009
+ date: {
5010
+ type: 'string',
5011
+ description: 'Life event date (ISO 8601)'
5012
+ },
5013
+ type: {
5014
+ type: 'string',
5015
+ description: 'Life event type (user-defined)'
5016
+ },
5017
+ description: {
5018
+ type: 'string',
5019
+ description:
5020
+ 'Life event description. Empty string is a VALID value (distinct from absence).'
5021
+ },
5022
+ meta: {
5023
+ type: 'object',
5024
+ description: 'Product-side metadata (free-form JSON)'
5025
+ }
5026
+ }
5027
+ } as const;
5028
+
5029
+ export const $OnboardingAccountDto = {
5030
+ type: 'object',
5031
+ properties: {
5032
+ path: {
5033
+ type: 'string',
5034
+ description:
5035
+ 'Account path (Assets/Liabilities only; format validated by the account service)',
5036
+ example: 'Assets:Checking'
5037
+ },
5038
+ currency: {
5039
+ type: 'string',
5040
+ description: 'ISO 4217 currency code (3 letters)',
5041
+ example: 'USD'
5042
+ },
5043
+ openingBalance: {
5044
+ type: 'string',
5045
+ description:
5046
+ 'Opening balance as a non-negative Decimal string (e.g. "1000.00")',
5047
+ example: '1000.00'
5048
+ },
5049
+ platformId: {
5050
+ type: 'string',
5051
+ description:
5052
+ 'Platform ID to bind the account to (references Platform.id); omit for unbound',
5053
+ example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
5054
+ }
5055
+ },
5056
+ required: ['path', 'currency']
5057
+ } as const;
5058
+
5059
+ export const $OnboardingDto = {
5060
+ type: 'object',
5061
+ properties: {
5062
+ accounts: {
5063
+ description: 'Asset/Liability accounts to register with opening balances',
5064
+ type: 'array',
5065
+ items: {
5066
+ $ref: '#/components/schemas/OnboardingAccountDto'
5067
+ }
5068
+ },
5069
+ skipAssetRegistration: {
5070
+ type: 'boolean',
5071
+ description:
5072
+ 'Skip asset registration; only bootstrap the core account set',
5073
+ default: false
5074
+ }
5075
+ }
5076
+ } as const;
5077
+
5078
+ export const $ActualBalanceDto = {
5079
+ type: 'object',
5080
+ properties: {
5081
+ amount: {
5082
+ type: 'string',
5083
+ description:
5084
+ 'Actual balance amount as a decimal string (preserves precision for tolerance inference).',
5085
+ example: '1234.56'
5086
+ },
5087
+ ccy: {
5088
+ type: 'string',
5089
+ description: 'Currency code (ISO 4217 or commodity ticker).',
5090
+ example: 'CNY'
5091
+ }
5092
+ },
5093
+ required: ['amount', 'ccy']
5094
+ } as const;
5095
+
5096
+ export const $ComputeReconciliationDto = {
5097
+ type: 'object',
5098
+ properties: {
5099
+ accountId: {
5100
+ type: 'string',
5101
+ description: 'BeanAccount id to reconcile.'
5102
+ },
5103
+ asOfDate: {
5104
+ type: 'string',
5105
+ description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
5106
+ example: '2026-07-24'
5107
+ },
5108
+ actualBalance: {
5109
+ description: 'Actual balance from the external statement.',
5110
+ allOf: [
5111
+ {
5112
+ $ref: '#/components/schemas/ActualBalanceDto'
5113
+ }
5114
+ ]
5115
+ }
5116
+ },
5117
+ required: ['accountId', 'asOfDate', 'actualBalance']
5118
+ } as const;
5119
+
5120
+ export const $ReconciliationComputeResultDto = {
5121
+ type: 'object',
5122
+ properties: {
5123
+ accountId: {
5124
+ type: 'string'
5125
+ },
5126
+ asOfDate: {
5127
+ type: 'string'
5128
+ },
5129
+ bookBalance: {
5130
+ type: 'string',
5131
+ description: 'System-computed book balance (decimal string).'
4203
5132
  },
4204
- currency: {
5133
+ actualBalance: {
4205
5134
  type: 'string',
4206
- description: 'Currency code',
4207
- example: 'USD'
5135
+ description: 'User-entered actual balance (decimal string).'
4208
5136
  },
4209
- baseCurrency: {
5137
+ currency: {
5138
+ type: 'string'
5139
+ },
5140
+ diff: {
4210
5141
  type: 'string',
4211
- description: 'Base currency code',
4212
- example: 'USD'
5142
+ description: 'Diff = book − actual (decimal string).'
4213
5143
  },
4214
- benchmark: {
5144
+ tolerance: {
4215
5145
  type: 'string',
4216
- description: 'Benchmark symbol',
4217
- example: 'SPY'
5146
+ description: 'Applied tolerance (decimal string).'
4218
5147
  },
4219
- colorScheme: {
5148
+ withinTolerance: {
5149
+ type: 'boolean',
5150
+ description: 'true when |diff| ≤ tolerance.'
5151
+ },
5152
+ suggestedAction: {
4220
5153
  type: 'string',
4221
- description: 'Color scheme',
4222
- enum: ['DARK', 'LIGHT']
5154
+ enum: ['assert', 'pad'],
5155
+ description:
5156
+ 'Suggested next action: assert when within tolerance, pad otherwise.'
5157
+ }
5158
+ },
5159
+ required: [
5160
+ 'accountId',
5161
+ 'asOfDate',
5162
+ 'bookBalance',
5163
+ 'actualBalance',
5164
+ 'currency',
5165
+ 'diff',
5166
+ 'tolerance',
5167
+ 'withinTolerance',
5168
+ 'suggestedAction'
5169
+ ]
5170
+ } as const;
5171
+
5172
+ export const $AssertReconciliationDto = {
5173
+ type: 'object',
5174
+ properties: {
5175
+ accountId: {
5176
+ type: 'string',
5177
+ description: 'BeanAccount id to reconcile.'
4223
5178
  },
4224
- dateRange: {
5179
+ asOfDate: {
4225
5180
  type: 'string',
4226
- description: 'Date range filter',
4227
- example: '1y'
5181
+ description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
5182
+ example: '2026-07-24'
4228
5183
  },
4229
- emergencyFund: {
4230
- type: 'number',
4231
- description: 'Emergency fund amount',
4232
- example: 10000
5184
+ actualBalance: {
5185
+ description: 'Actual balance from the external statement.',
5186
+ allOf: [
5187
+ {
5188
+ $ref: '#/components/schemas/ActualBalanceDto'
5189
+ }
5190
+ ]
4233
5191
  },
4234
- 'filters.accounts': {
4235
- description: 'Account filter IDs',
4236
- type: 'array',
4237
- items: {
4238
- type: 'string'
4239
- }
5192
+ tolerance: {
5193
+ type: 'string',
5194
+ description:
5195
+ 'Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).',
5196
+ example: '0.01'
5197
+ }
5198
+ },
5199
+ required: ['accountId', 'asOfDate', 'actualBalance']
5200
+ } as const;
5201
+
5202
+ export const $ReconciliationRecordDto = {
5203
+ type: 'object',
5204
+ properties: {
5205
+ id: {
5206
+ type: 'string'
4240
5207
  },
4241
- 'filters.assetClasses': {
4242
- description: 'Asset class filters',
4243
- type: 'array',
4244
- items: {
4245
- type: 'string'
4246
- }
5208
+ accountId: {
5209
+ type: 'string'
4247
5210
  },
4248
- 'filters.dataSource': {
4249
- type: 'string',
4250
- description: 'Data source filter'
5211
+ date: {
5212
+ type: 'string'
4251
5213
  },
4252
- 'filters.symbol': {
5214
+ amount: {
4253
5215
  type: 'string',
4254
- description: 'Symbol filter'
4255
- },
4256
- 'filters.tags': {
4257
- description: 'Tag filters',
4258
- type: 'array',
4259
- items: {
4260
- type: 'string'
4261
- }
5216
+ description: 'Asserted (actual) amount.'
4262
5217
  },
4263
- isExperimentalFeatures: {
4264
- type: 'boolean',
4265
- description: 'Enable experimental features'
5218
+ currency: {
5219
+ type: 'string'
4266
5220
  },
4267
- isRestrictedView: {
4268
- type: 'boolean',
4269
- description: 'Enable restricted view mode'
5221
+ tolerance: {
5222
+ type: 'string'
4270
5223
  },
4271
- language: {
5224
+ diffAmount: {
4272
5225
  type: 'string',
4273
- description: 'Language code',
4274
- example: 'en'
5226
+ description: 'book − actual.'
4275
5227
  },
4276
- locale: {
4277
- type: 'string',
4278
- description: 'Locale code',
4279
- example: 'en-US'
5228
+ diffCurrency: {
5229
+ type: 'string'
4280
5230
  },
4281
- projectedTotalAmount: {
4282
- type: 'number',
4283
- description: 'Projected total amount',
4284
- example: 1000000
5231
+ createdAt: {
5232
+ type: 'string'
5233
+ }
5234
+ },
5235
+ required: ['id', 'accountId', 'date', 'amount', 'currency', 'createdAt']
5236
+ } as const;
5237
+
5238
+ export const $PadReconciliationDto = {
5239
+ type: 'object',
5240
+ properties: {
5241
+ accountId: {
5242
+ type: 'string',
5243
+ description: 'BeanAccount id to reconcile.'
4285
5244
  },
4286
- retirementDate: {
5245
+ asOfDate: {
4287
5246
  type: 'string',
4288
- description: 'Retirement date in ISO 8601 format',
4289
- example: '2050-01-01'
5247
+ description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
5248
+ example: '2026-07-24'
4290
5249
  },
4291
- savingsRate: {
4292
- type: 'number',
4293
- description: 'Savings rate percentage',
4294
- example: 0.2
5250
+ actualBalance: {
5251
+ description: 'Actual balance from the external statement.',
5252
+ allOf: [
5253
+ {
5254
+ $ref: '#/components/schemas/ActualBalanceDto'
5255
+ }
5256
+ ]
4295
5257
  },
4296
- viewMode: {
5258
+ sourceAccount: {
4297
5259
  type: 'string',
4298
- description: 'View mode',
4299
- enum: ['DEFAULT', 'ZEN']
5260
+ description:
5261
+ 'Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).',
5262
+ example: 'Equity:Opening-Balances',
5263
+ default: 'Equity:Opening-Balances'
4300
5264
  }
4301
- }
5265
+ },
5266
+ required: ['accountId', 'asOfDate', 'actualBalance']
4302
5267
  } as const;
4303
5268
 
4304
- export const $UpdatePropertyDto = {
5269
+ export const $PadResultDto = {
4305
5270
  type: 'object',
4306
5271
  properties: {
4307
- value: {
5272
+ transactionId: {
4308
5273
  type: 'string',
4309
- description: 'Property value'
5274
+ description: 'Created pad adjusting transaction id.'
4310
5275
  }
4311
5276
  },
4312
- required: ['value']
5277
+ required: ['transactionId']
4313
5278
  } as const;
4314
5279
 
4315
5280
  export const $FileImportDto = {
@@ -4478,7 +5443,7 @@ export const $IdentifyResultDto = {
4478
5443
  account: {
4479
5444
  type: 'string',
4480
5445
  description: 'Default account used by this importer',
4481
- example: 'Assets:Alipay:Balance'
5446
+ example: 'Assets:CN:Alipay:Balance'
4482
5447
  },
4483
5448
  message: {
4484
5449
  type: 'string',
@@ -4495,7 +5460,7 @@ export const $MapperDefaultsDto = {
4495
5460
  sourceAccount: {
4496
5461
  type: 'string',
4497
5462
  description: 'Source account for transactions (Beancount format)',
4498
- example: 'Assets:Alipay:Balance'
5463
+ example: 'Assets:CN:Alipay:Balance'
4499
5464
  },
4500
5465
  currency: {
4501
5466
  type: 'string',
@@ -4532,7 +5497,7 @@ export const $MapperDefaultsDto = {
4532
5497
  description:
4533
5498
  'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
4534
5499
  example: {
4535
- HuaBei: 'Liabilities:Alipay:Huabei',
5500
+ HuaBei: 'Liabilities:CN:CreditLine',
4536
5501
  CreditCard: 'Liabilities:CreditCard'
4537
5502
  }
4538
5503
  }
@@ -4664,7 +5629,7 @@ export const $UpdateMapperDefaultsDto = {
4664
5629
  sourceAccount: {
4665
5630
  type: 'string',
4666
5631
  description: 'Source account for transactions (Beancount format)',
4667
- example: 'Assets:Alipay:Balance',
5632
+ example: 'Assets:CN:Alipay:Balance',
4668
5633
  pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
4669
5634
  },
4670
5635
  currency: {
@@ -4692,7 +5657,7 @@ export const $UpdateMapperDefaultsDto = {
4692
5657
  description:
4693
5658
  'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
4694
5659
  example: {
4695
- HuaBei: 'Liabilities:Alipay:Huabei',
5660
+ HuaBei: 'Liabilities:CN:CreditLine',
4696
5661
  CreditCard: 'Liabilities:CreditCard'
4697
5662
  }
4698
5663
  }
@@ -4710,125 +5675,19 @@ export const $UpdateConfigDataDto = {
4710
5675
  }
4711
5676
  ]
4712
5677
  }
4713
- }
4714
- } as const;
4715
-
4716
- export const $UpdateImporterConfigDto = {
4717
- type: 'object',
4718
- properties: {
4719
- data: {
4720
- description: 'Configuration data (v1 schema)',
4721
- allOf: [
4722
- {
4723
- $ref: '#/components/schemas/UpdateConfigDataDto'
4724
- }
4725
- ]
4726
- }
4727
- }
4728
- } as const;
4729
-
4730
- export const $CreatePlatformDto = {
4731
- type: 'object',
4732
- properties: {
4733
- name: {
4734
- type: 'string',
4735
- description: 'Platform name',
4736
- example: 'Binance'
4737
- },
4738
- canonical: {
4739
- type: 'string',
4740
- description: 'Platform canonical identifier (lowercase, kebab-case)',
4741
- example: 'binance'
4742
- },
4743
- aliases: {
4744
- description: 'Platform aliases (multi-language names for lookup)',
4745
- example: ['Binance', 'Binance Exchange', 'BNB'],
4746
- type: 'array',
4747
- items: {
4748
- type: 'string'
4749
- }
4750
- },
4751
- url: {
4752
- type: 'string',
4753
- description: 'Platform URL',
4754
- example: 'https://www.binance.com'
4755
- },
4756
- type: {
4757
- type: 'string',
4758
- description: 'Platform type',
4759
- enum: [
4760
- 'BANK',
4761
- 'BROKERAGE',
4762
- 'CRYPTO_EXCHANGE',
4763
- 'PAYMENT',
4764
- 'INVESTMENT',
4765
- 'INSURANCE',
4766
- 'OTHER'
4767
- ],
4768
- example: 'CRYPTO_EXCHANGE'
4769
- },
4770
- logoUrl: {
4771
- type: 'string',
4772
- description: 'Platform logo URL',
4773
- example: 'https://example.com/logos/binance.png'
4774
- },
4775
- isActive: {
4776
- type: 'boolean',
4777
- description: 'Whether the platform is active',
4778
- default: true
4779
- }
4780
- },
4781
- required: ['name', 'canonical', 'aliases', 'url', 'type']
4782
- } as const;
4783
-
4784
- export const $UpdatePlatformDto = {
4785
- type: 'object',
4786
- properties: {
4787
- name: {
4788
- type: 'string',
4789
- description: 'Platform name',
4790
- example: 'Binance'
4791
- },
4792
- canonical: {
4793
- type: 'string',
4794
- description: 'Platform canonical identifier (lowercase, kebab-case)',
4795
- example: 'binance'
4796
- },
4797
- aliases: {
4798
- description: 'Platform aliases (multi-language names for lookup)',
4799
- example: ['Binance', 'Binance Exchange', 'BNB'],
4800
- type: 'array',
4801
- items: {
4802
- type: 'string'
4803
- }
4804
- },
4805
- url: {
4806
- type: 'string',
4807
- description: 'Platform URL',
4808
- example: 'https://www.binance.com'
4809
- },
4810
- type: {
4811
- type: 'string',
4812
- description: 'Platform type',
4813
- enum: [
4814
- 'BANK',
4815
- 'BROKERAGE',
4816
- 'CRYPTO_EXCHANGE',
4817
- 'PAYMENT',
4818
- 'INVESTMENT',
4819
- 'INSURANCE',
4820
- 'OTHER'
4821
- ],
4822
- example: 'CRYPTO_EXCHANGE'
4823
- },
4824
- logoUrl: {
4825
- type: 'string',
4826
- description: 'Platform logo URL',
4827
- example: 'https://example.com/logos/binance.png'
4828
- },
4829
- isActive: {
4830
- type: 'boolean',
4831
- description: 'Whether the platform is active'
5678
+ }
5679
+ } as const;
5680
+
5681
+ export const $UpdateImporterConfigDto = {
5682
+ type: 'object',
5683
+ properties: {
5684
+ data: {
5685
+ description: 'Configuration data (v1 schema)',
5686
+ allOf: [
5687
+ {
5688
+ $ref: '#/components/schemas/UpdateConfigDataDto'
5689
+ }
5690
+ ]
4832
5691
  }
4833
5692
  }
4834
5693
  } as const;
@@ -4839,7 +5698,7 @@ export const $ProviderSyncConfigDto = {
4839
5698
  sourceAccount: {
4840
5699
  type: 'string',
4841
5700
  description: 'Source account for the first posting',
4842
- example: 'Assets:Bank:Chase'
5701
+ example: 'Assets:US:Chase:Checking'
4843
5702
  },
4844
5703
  defaultCurrency: {
4845
5704
  type: 'string',
@@ -4860,6 +5719,12 @@ export const $ProviderSyncConfigDto = {
4860
5719
  type: 'boolean',
4861
5720
  description: 'Filter pending transactions',
4862
5721
  default: true
5722
+ },
5723
+ externalAccountId: {
5724
+ type: 'string',
5725
+ description:
5726
+ 'External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.',
5727
+ example: 'acc_gocardless_001'
4863
5728
  }
4864
5729
  },
4865
5730
  required: [
@@ -4979,6 +5844,94 @@ export const $SupportedProvidersResponseDto = {
4979
5844
  required: ['providers']
4980
5845
  } as const;
4981
5846
 
5847
+ export const $CreateExternalAccountLinkDto = {
5848
+ type: 'object',
5849
+ properties: {
5850
+ provider: {
5851
+ type: 'string',
5852
+ enum: [
5853
+ 'plaid',
5854
+ 'teller',
5855
+ 'truelayer',
5856
+ 'gocardless',
5857
+ 'simplefin',
5858
+ 'yodlee',
5859
+ 'beancount-direct',
5860
+ 'parsed-bill'
5861
+ ],
5862
+ example: 'plaid',
5863
+ description: 'Open Banking provider (whitelist)'
5864
+ },
5865
+ externalAccountId: {
5866
+ type: 'string',
5867
+ example: 'acc-plaid-001',
5868
+ description: 'External account ID from the provider'
5869
+ },
5870
+ beanAccountId: {
5871
+ type: 'string',
5872
+ example: '550e8400-e29b-41d4-a716-446655440000',
5873
+ description: 'Target BeanAccount ID (must belong to the JWT user)'
5874
+ }
5875
+ },
5876
+ required: ['provider', 'externalAccountId', 'beanAccountId']
5877
+ } as const;
5878
+
5879
+ export const $ExternalAccountLinkResponseDto = {
5880
+ type: 'object',
5881
+ properties: {
5882
+ id: {
5883
+ type: 'string'
5884
+ },
5885
+ provider: {
5886
+ type: 'string'
5887
+ },
5888
+ externalAccountId: {
5889
+ type: 'string'
5890
+ },
5891
+ beanAccountId: {
5892
+ type: 'string'
5893
+ },
5894
+ isActive: {
5895
+ type: 'boolean'
5896
+ },
5897
+ createdAt: {
5898
+ type: 'string'
5899
+ },
5900
+ updatedAt: {
5901
+ type: 'string'
5902
+ }
5903
+ },
5904
+ required: [
5905
+ 'id',
5906
+ 'provider',
5907
+ 'externalAccountId',
5908
+ 'beanAccountId',
5909
+ 'isActive',
5910
+ 'createdAt',
5911
+ 'updatedAt'
5912
+ ]
5913
+ } as const;
5914
+
5915
+ export const $ExternalAccountLinkListResponseDto = {
5916
+ type: 'object',
5917
+ properties: {
5918
+ items: {
5919
+ type: 'array',
5920
+ items: {
5921
+ $ref: '#/components/schemas/ExternalAccountLinkResponseDto'
5922
+ }
5923
+ },
5924
+ total: {
5925
+ type: 'number'
5926
+ },
5927
+ provider: {
5928
+ type: 'string',
5929
+ description: 'Filter by provider (query param)'
5930
+ }
5931
+ },
5932
+ required: ['items', 'total']
5933
+ } as const;
5934
+
4982
5935
  export const $ParserTelemetryReportDto = {
4983
5936
  type: 'object',
4984
5937
  properties: {}
@@ -5337,7 +6290,8 @@ export const $NlpAccountConfirmationDataDto = {
5337
6290
  },
5338
6291
  suggestedAccount: {
5339
6292
  type: 'string',
5340
- description: 'Suggested replacement account',
6293
+ description:
6294
+ 'Suggested replacement account (omitted when no clear candidate)',
5341
6295
  example: 'Expenses:Food:Drinks'
5342
6296
  },
5343
6297
  similarAccounts: {
@@ -5359,7 +6313,6 @@ export const $NlpAccountConfirmationDataDto = {
5359
6313
  },
5360
6314
  required: [
5361
6315
  'invalidAccount',
5362
- 'suggestedAccount',
5363
6316
  'similarAccounts',
5364
6317
  'errorMessage',
5365
6318
  'transactionContext'
@@ -5528,7 +6481,7 @@ export const $NlpSuggestedAccountDto = {
5528
6481
  account: {
5529
6482
  type: 'string',
5530
6483
  description: 'Suggested account path',
5531
- example: 'Assets:Bank:Checking'
6484
+ example: 'Assets:Checking'
5532
6485
  },
5533
6486
  confidence: {
5534
6487
  type: 'number',
@@ -5569,7 +6522,7 @@ export const $NlpDefaultAccountsDto = {
5569
6522
  asset: {
5570
6523
  type: 'string',
5571
6524
  description: 'Default asset account',
5572
- example: 'Assets:Bank:Checking'
6525
+ example: 'Assets:Checking'
5573
6526
  },
5574
6527
  expense: {
5575
6528
  type: 'string',
@@ -5609,7 +6562,8 @@ export const $NlpResponseDto = {
5609
6562
  'confirm_rule',
5610
6563
  'confirm_account',
5611
6564
  'confirm_payee',
5612
- 'cancel'
6565
+ 'cancel',
6566
+ 'aborted'
5613
6567
  ]
5614
6568
  },
5615
6569
  intent: {
@@ -5713,99 +6667,330 @@ export const $NlpResponseDto = {
5713
6667
  }
5714
6668
  ]
5715
6669
  },
5716
- ruleData: {
6670
+ ruleData: {
6671
+ description:
6672
+ 'Rule match data (when action is "confirm_rule"). Contains information about medium-confidence rule match for user confirmation.',
6673
+ allOf: [
6674
+ {
6675
+ $ref: '#/components/schemas/NlpRuleConfirmationDataDto'
6676
+ }
6677
+ ]
6678
+ },
6679
+ accountData: {
6680
+ description:
6681
+ 'Account validation data (when action is "confirm_account"). Contains information about invalid account for user correction.',
6682
+ allOf: [
6683
+ {
6684
+ $ref: '#/components/schemas/NlpAccountConfirmationDataDto'
6685
+ }
6686
+ ]
6687
+ },
6688
+ payeeData: {
6689
+ description:
6690
+ 'Payee confirmation data (when action is "confirm_payee"). Contains information about medium/low confidence payee match for user confirmation.',
6691
+ allOf: [
6692
+ {
6693
+ $ref: '#/components/schemas/NlpPayeeConfirmationDataDto'
6694
+ }
6695
+ ]
6696
+ },
6697
+ confidence: {
6698
+ type: 'number',
6699
+ description: 'Overall confidence score (0-1)',
6700
+ example: 0.85
6701
+ },
6702
+ confidenceThreshold: {
6703
+ type: 'number',
6704
+ description:
6705
+ 'Confidence threshold for automatic creation (default: 0.75). When confidence < threshold, action will be "confirm" requiring user verification.',
6706
+ example: 0.75
6707
+ },
6708
+ recurringMatch: {
6709
+ description:
6710
+ 'Recurring transaction match info (when action is "created"). Contains match details when transaction matches a pending expected transaction.',
6711
+ allOf: [
6712
+ {
6713
+ $ref: '#/components/schemas/RecurringMatchInfoDto'
6714
+ }
6715
+ ]
6716
+ },
6717
+ recurringSuggestion: {
6718
+ description:
6719
+ 'Recurring rule creation suggestion (when action is "created"). Contains suggestion to create a recurring rule based on detected patterns. Only present when no existing rule matched and similar historical transactions were found.',
6720
+ allOf: [
6721
+ {
6722
+ $ref: '#/components/schemas/RecurringSuggestionDto'
6723
+ }
6724
+ ]
6725
+ },
6726
+ suggestedAccounts: {
6727
+ description:
6728
+ 'Suggested accounts for this transaction. Contains recommended source and destination accounts based on the detected intent and rules.',
6729
+ allOf: [
6730
+ {
6731
+ $ref: '#/components/schemas/NlpSuggestedAccountsDto'
6732
+ }
6733
+ ]
6734
+ },
6735
+ defaultAccounts: {
6736
+ description:
6737
+ 'Default accounts for the user/region. These are fallback accounts used when no specific suggestion is available.',
6738
+ allOf: [
6739
+ {
6740
+ $ref: '#/components/schemas/NlpDefaultAccountsDto'
6741
+ }
6742
+ ]
6743
+ }
6744
+ },
6745
+ required: ['status', 'action']
6746
+ } as const;
6747
+
6748
+ export const $PlatformListItemDto = {
6749
+ type: 'object',
6750
+ properties: {
6751
+ id: {
6752
+ type: 'string',
6753
+ description: 'Global platform ID'
6754
+ },
6755
+ name: {
6756
+ type: 'string',
6757
+ description: 'Platform name'
6758
+ },
6759
+ url: {
6760
+ type: 'string',
6761
+ description: 'Platform URL'
6762
+ },
6763
+ type: {
6764
+ type: 'string',
6765
+ description: 'Platform type',
6766
+ enum: [
6767
+ 'BANK',
6768
+ 'BROKERAGE',
6769
+ 'CRYPTO_EXCHANGE',
6770
+ 'PAYMENT',
6771
+ 'INVESTMENT',
6772
+ 'INSURANCE',
6773
+ 'OTHER'
6774
+ ]
6775
+ },
6776
+ canonical: {
6777
+ type: 'string',
6778
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
6779
+ },
6780
+ suggestedSegment: {
6781
+ type: 'string',
6782
+ description:
6783
+ 'Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)'
6784
+ },
6785
+ logoUrl: {
6786
+ type: 'string',
6787
+ description: 'Logo URL',
6788
+ nullable: true
6789
+ },
6790
+ isBound: {
6791
+ type: 'boolean',
6792
+ description: 'Whether user has accounts using this platform'
6793
+ }
6794
+ },
6795
+ required: [
6796
+ 'id',
6797
+ 'name',
6798
+ 'url',
6799
+ 'type',
6800
+ 'canonical',
6801
+ 'suggestedSegment',
6802
+ 'logoUrl',
6803
+ 'isBound'
6804
+ ]
6805
+ } as const;
6806
+
6807
+ export const $PlatformMatchResultDto = {
6808
+ type: 'object',
6809
+ properties: {
6810
+ id: {
6811
+ type: 'string',
6812
+ description: 'Global platform ID'
6813
+ },
6814
+ name: {
6815
+ type: 'string',
6816
+ description: 'Platform name (e.g., "ICBC")'
6817
+ },
6818
+ canonical: {
6819
+ type: 'string',
6820
+ description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
6821
+ },
6822
+ type: {
6823
+ type: 'string',
6824
+ description: 'Platform type',
6825
+ enum: [
6826
+ 'BANK',
6827
+ 'BROKERAGE',
6828
+ 'CRYPTO_EXCHANGE',
6829
+ 'PAYMENT',
6830
+ 'INVESTMENT',
6831
+ 'INSURANCE',
6832
+ 'OTHER'
6833
+ ]
6834
+ },
6835
+ suggestedSegment: {
6836
+ type: 'string',
6837
+ description:
6838
+ 'Suggested path segment — canonical, already in ACCOUNT_RE format'
6839
+ },
6840
+ logoUrl: {
6841
+ type: 'string',
6842
+ description: 'Logo URL',
6843
+ nullable: true
6844
+ },
6845
+ matchType: {
6846
+ type: 'string',
6847
+ description: "How this row matched: 'exact' > 'prefix' > 'substring'",
6848
+ enum: ['exact', 'prefix', 'substring']
6849
+ }
6850
+ },
6851
+ required: [
6852
+ 'id',
6853
+ 'name',
6854
+ 'canonical',
6855
+ 'type',
6856
+ 'suggestedSegment',
6857
+ 'logoUrl',
6858
+ 'matchType'
6859
+ ]
6860
+ } as const;
6861
+
6862
+ export const $PlatformMatchResponseDto = {
6863
+ type: 'object',
6864
+ properties: {
6865
+ platforms: {
6866
+ description: 'Ranked matches, best tier first (at most 10 rows)',
6867
+ type: 'array',
6868
+ items: {
6869
+ $ref: '#/components/schemas/PlatformMatchResultDto'
6870
+ }
6871
+ },
6872
+ matchType: {
6873
+ type: 'string',
5717
6874
  description:
5718
- 'Rule match data (when action is "confirm_rule"). Contains information about medium-confidence rule match for user confirmation.',
5719
- allOf: [
5720
- {
5721
- $ref: '#/components/schemas/NlpRuleConfirmationDataDto'
5722
- }
5723
- ]
6875
+ "Overall match quality — top row's tier, or 'none' when no hits",
6876
+ enum: ['none', 'exact', 'prefix', 'substring']
5724
6877
  },
5725
- accountData: {
5726
- description:
5727
- 'Account validation data (when action is "confirm_account"). Contains information about invalid account for user correction.',
5728
- allOf: [
5729
- {
5730
- $ref: '#/components/schemas/NlpAccountConfirmationDataDto'
5731
- }
5732
- ]
6878
+ total: {
6879
+ type: 'number',
6880
+ description: 'Total matches before LIMIT (truncation transparency)'
5733
6881
  },
5734
- payeeData: {
5735
- description:
5736
- 'Payee confirmation data (when action is "confirm_payee"). Contains information about medium/low confidence payee match for user confirmation.',
5737
- allOf: [
5738
- {
5739
- $ref: '#/components/schemas/NlpPayeeConfirmationDataDto'
5740
- }
5741
- ]
6882
+ hasMore: {
6883
+ type: 'boolean',
6884
+ description: 'true when total > platforms.length (more matches exist)'
6885
+ }
6886
+ },
6887
+ required: ['platforms', 'matchType', 'total', 'hasMore']
6888
+ } as const;
6889
+
6890
+ export const $CreatePlatformDto = {
6891
+ type: 'object',
6892
+ properties: {
6893
+ name: {
6894
+ type: 'string',
6895
+ description: 'Platform name',
6896
+ example: 'Binance'
5742
6897
  },
5743
- confidence: {
5744
- type: 'number',
5745
- description: 'Overall confidence score (0-1)',
5746
- example: 0.85
6898
+ canonical: {
6899
+ type: 'string',
6900
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
6901
+ example: 'binance'
5747
6902
  },
5748
- confidenceThreshold: {
5749
- type: 'number',
5750
- description:
5751
- 'Confidence threshold for automatic creation (default: 0.75). When confidence < threshold, action will be "confirm" requiring user verification.',
5752
- example: 0.75
6903
+ aliases: {
6904
+ description: 'Platform aliases (multi-language names for lookup)',
6905
+ example: ['Binance', 'Binance Exchange', 'BNB'],
6906
+ type: 'array',
6907
+ items: {
6908
+ type: 'string'
6909
+ }
5753
6910
  },
5754
- recurringMatch: {
5755
- description:
5756
- 'Recurring transaction match info (when action is "created"). Contains match details when transaction matches a pending expected transaction.',
5757
- allOf: [
5758
- {
5759
- $ref: '#/components/schemas/RecurringMatchInfoDto'
5760
- }
5761
- ]
6911
+ url: {
6912
+ type: 'string',
6913
+ description: 'Platform URL',
6914
+ example: 'https://www.binance.com'
5762
6915
  },
5763
- recurringSuggestion: {
5764
- description:
5765
- 'Recurring rule creation suggestion (when action is "created"). Contains suggestion to create a recurring rule based on detected patterns. Only present when no existing rule matched and similar historical transactions were found.',
5766
- allOf: [
5767
- {
5768
- $ref: '#/components/schemas/RecurringSuggestionDto'
5769
- }
5770
- ]
6916
+ type: {
6917
+ type: 'string',
6918
+ description: 'Platform type',
6919
+ enum: [
6920
+ 'BANK',
6921
+ 'BROKERAGE',
6922
+ 'CRYPTO_EXCHANGE',
6923
+ 'PAYMENT',
6924
+ 'INVESTMENT',
6925
+ 'INSURANCE',
6926
+ 'OTHER'
6927
+ ],
6928
+ example: 'CRYPTO_EXCHANGE'
5771
6929
  },
5772
- suggestedAccounts: {
5773
- description:
5774
- 'Suggested accounts for this transaction. Contains recommended source and destination accounts based on the detected intent and rules.',
5775
- allOf: [
5776
- {
5777
- $ref: '#/components/schemas/NlpSuggestedAccountsDto'
5778
- }
5779
- ]
6930
+ logoUrl: {
6931
+ type: 'string',
6932
+ description: 'Platform logo URL',
6933
+ example: 'https://example.com/logos/binance.png'
5780
6934
  },
5781
- defaultAccounts: {
5782
- description:
5783
- 'Default accounts for the user/region. These are fallback accounts used when no specific suggestion is available.',
5784
- allOf: [
5785
- {
5786
- $ref: '#/components/schemas/NlpDefaultAccountsDto'
5787
- }
5788
- ]
6935
+ isActive: {
6936
+ type: 'boolean',
6937
+ description: 'Whether the platform is active',
6938
+ default: true
5789
6939
  }
5790
6940
  },
5791
- required: ['status', 'action']
6941
+ required: ['name', 'canonical', 'aliases', 'url', 'type']
5792
6942
  } as const;
5793
6943
 
5794
- export const $BalanceByCurrencyDto = {
6944
+ export const $UpdatePlatformDto = {
5795
6945
  type: 'object',
5796
6946
  properties: {
5797
- currency: {
6947
+ name: {
5798
6948
  type: 'string',
5799
- description: 'ISO 4217 currency code',
5800
- example: 'CNY'
6949
+ description: 'Platform name',
6950
+ example: 'Binance'
5801
6951
  },
5802
- balance: {
6952
+ canonical: {
5803
6953
  type: 'string',
5804
- description: 'Balance amount',
5805
- example: '50000.00'
6954
+ description: 'Platform canonical identifier (lowercase, kebab-case)',
6955
+ example: 'binance'
6956
+ },
6957
+ aliases: {
6958
+ description: 'Platform aliases (multi-language names for lookup)',
6959
+ example: ['Binance', 'Binance Exchange', 'BNB'],
6960
+ type: 'array',
6961
+ items: {
6962
+ type: 'string'
6963
+ }
6964
+ },
6965
+ url: {
6966
+ type: 'string',
6967
+ description: 'Platform URL',
6968
+ example: 'https://www.binance.com'
6969
+ },
6970
+ type: {
6971
+ type: 'string',
6972
+ description: 'Platform type',
6973
+ enum: [
6974
+ 'BANK',
6975
+ 'BROKERAGE',
6976
+ 'CRYPTO_EXCHANGE',
6977
+ 'PAYMENT',
6978
+ 'INVESTMENT',
6979
+ 'INSURANCE',
6980
+ 'OTHER'
6981
+ ],
6982
+ example: 'CRYPTO_EXCHANGE'
6983
+ },
6984
+ logoUrl: {
6985
+ type: 'string',
6986
+ description: 'Platform logo URL',
6987
+ example: 'https://example.com/logos/binance.png'
6988
+ },
6989
+ isActive: {
6990
+ type: 'boolean',
6991
+ description: 'Whether the platform is active'
5806
6992
  }
5807
- },
5808
- required: ['currency', 'balance']
6993
+ }
5809
6994
  } as const;
5810
6995
 
5811
6996
  export const $NetWorthByCurrencyDto = {
@@ -5877,28 +7062,6 @@ export const $ConvertedNetWorthDto = {
5877
7062
  ]
5878
7063
  } as const;
5879
7064
 
5880
- export const $ExchangeRateWarningDto = {
5881
- type: 'object',
5882
- properties: {
5883
- type: {
5884
- type: 'string',
5885
- description: 'Warning type',
5886
- example: 'MISSING_EXCHANGE_RATE'
5887
- },
5888
- currency: {
5889
- type: 'string',
5890
- description: 'Currency without exchange rate',
5891
- example: 'EUR'
5892
- },
5893
- totalAmount: {
5894
- type: 'string',
5895
- description: 'Total amount affected',
5896
- example: '1000.00'
5897
- }
5898
- },
5899
- required: ['type', 'currency', 'totalAmount']
5900
- } as const;
5901
-
5902
7065
  export const $NetWorthResponseDto = {
5903
7066
  type: 'object',
5904
7067
  properties: {
@@ -5984,7 +7147,7 @@ export const $AccountItemDto = {
5984
7147
  name: {
5985
7148
  type: 'string',
5986
7149
  description: 'Full account name',
5987
- example: 'Assets:Bank:CMB:Savings'
7150
+ example: 'Assets:CN:CMB:Savings'
5988
7151
  },
5989
7152
  displayName: {
5990
7153
  type: 'string',
@@ -6000,6 +7163,12 @@ export const $AccountItemDto = {
6000
7163
  type: 'string',
6001
7164
  description: 'Currency code',
6002
7165
  example: 'CNY'
7166
+ },
7167
+ convertedBalance: {
7168
+ type: 'string',
7169
+ description:
7170
+ 'FX-converted balance in base currency; omitted when not convertible',
7171
+ example: '50000.00'
6003
7172
  }
6004
7173
  },
6005
7174
  required: ['id', 'name', 'displayName', 'balance', 'currency']
@@ -6026,11 +7195,66 @@ export const $PlatformGroupDto = {
6026
7195
  },
6027
7196
  totalBalance: {
6028
7197
  type: 'string',
6029
- description: 'Total balance across all accounts in platform',
7198
+ description: 'FX-converted total balance in base currency',
7199
+ example: '100000.00'
7200
+ },
7201
+ balanceByCurrency: {
7202
+ description: 'Raw (unconverted) balances grouped by currency',
7203
+ type: 'array',
7204
+ items: {
7205
+ $ref: '#/components/schemas/BalanceByCurrencyDto'
7206
+ }
7207
+ },
7208
+ convertedBalance: {
7209
+ type: 'string',
7210
+ description:
7211
+ 'Converted balance in base currency (omitted when no currency is convertible)',
6030
7212
  example: '100000.00'
7213
+ },
7214
+ sharePct: {
7215
+ type: 'number',
7216
+ description:
7217
+ 'Share of the grand converted total (0-100); 0 when grand total is 0',
7218
+ example: 42.5
7219
+ }
7220
+ },
7221
+ required: [
7222
+ 'platformId',
7223
+ 'platformName',
7224
+ 'accounts',
7225
+ 'totalBalance',
7226
+ 'balanceByCurrency',
7227
+ 'sharePct'
7228
+ ]
7229
+ } as const;
7230
+
7231
+ export const $AccountExchangeRateWarningDto = {
7232
+ type: 'object',
7233
+ properties: {
7234
+ type: {
7235
+ type: 'string',
7236
+ description: 'Warning type',
7237
+ example: 'MISSING_EXCHANGE_RATE'
7238
+ },
7239
+ currency: {
7240
+ type: 'string',
7241
+ description: 'Currency without exchange rate',
7242
+ example: 'USD'
7243
+ },
7244
+ accounts: {
7245
+ description: 'Affected account paths',
7246
+ type: 'array',
7247
+ items: {
7248
+ type: 'string'
7249
+ }
7250
+ },
7251
+ totalAmount: {
7252
+ type: 'string',
7253
+ description: 'Total amount in this currency',
7254
+ example: '5000.00'
6031
7255
  }
6032
7256
  },
6033
- required: ['platformId', 'platformName', 'accounts', 'totalBalance']
7257
+ required: ['type', 'currency', 'accounts', 'totalAmount']
6034
7258
  } as const;
6035
7259
 
6036
7260
  export const $AccountsSummaryDto = {
@@ -6043,9 +7267,21 @@ export const $AccountsSummaryDto = {
6043
7267
  totalPlatforms: {
6044
7268
  type: 'number',
6045
7269
  description: 'Total number of platforms'
7270
+ },
7271
+ baseCurrency: {
7272
+ type: 'string',
7273
+ description: 'Base currency for conversion',
7274
+ example: 'CNY'
7275
+ },
7276
+ warnings: {
7277
+ description: 'Per-account exchange rate warnings',
7278
+ type: 'array',
7279
+ items: {
7280
+ $ref: '#/components/schemas/AccountExchangeRateWarningDto'
7281
+ }
6046
7282
  }
6047
7283
  },
6048
- required: ['totalAccounts', 'totalPlatforms']
7284
+ required: ['totalAccounts', 'totalPlatforms', 'baseCurrency']
6049
7285
  } as const;
6050
7286
 
6051
7287
  export const $AccountsResponseDto = {
@@ -6080,7 +7316,7 @@ export const $AccountItemWithAssetClassDto = {
6080
7316
  name: {
6081
7317
  type: 'string',
6082
7318
  description: 'Full account name',
6083
- example: 'Assets:Bank:CMB:Savings'
7319
+ example: 'Assets:CN:CMB:Savings'
6084
7320
  },
6085
7321
  displayName: {
6086
7322
  type: 'string',
@@ -6097,6 +7333,12 @@ export const $AccountItemWithAssetClassDto = {
6097
7333
  description: 'Currency code',
6098
7334
  example: 'CNY'
6099
7335
  },
7336
+ convertedBalance: {
7337
+ type: 'string',
7338
+ description:
7339
+ 'FX-converted balance in base currency; omitted when not convertible',
7340
+ example: '50000.00'
7341
+ },
6100
7342
  assetClass: {
6101
7343
  type: 'string',
6102
7344
  description: 'Asset class',
@@ -6176,35 +7418,6 @@ export const $AssetClassGroupDto = {
6176
7418
  required: ['assetClass', 'accounts', 'balanceByCurrency']
6177
7419
  } as const;
6178
7420
 
6179
- export const $AccountExchangeRateWarningDto = {
6180
- type: 'object',
6181
- properties: {
6182
- type: {
6183
- type: 'string',
6184
- description: 'Warning type',
6185
- example: 'MISSING_EXCHANGE_RATE'
6186
- },
6187
- currency: {
6188
- type: 'string',
6189
- description: 'Currency without exchange rate',
6190
- example: 'USD'
6191
- },
6192
- accounts: {
6193
- description: 'Affected account paths',
6194
- type: 'array',
6195
- items: {
6196
- type: 'string'
6197
- }
6198
- },
6199
- totalAmount: {
6200
- type: 'string',
6201
- description: 'Total amount in this currency',
6202
- example: '5000.00'
6203
- }
6204
- },
6205
- required: ['type', 'currency', 'accounts', 'totalAmount']
6206
- } as const;
6207
-
6208
7421
  export const $AssetClassSummaryDto = {
6209
7422
  type: 'object',
6210
7423
  properties: {
@@ -6278,7 +7491,7 @@ export const $HoldingAssetClassAccountSliceDto = {
6278
7491
  accountPath: {
6279
7492
  type: 'string',
6280
7493
  description: 'Full account path',
6281
- example: 'Assets:US:Investments:Brokerage'
7494
+ example: 'Assets:US:Fidelity:Brokerage'
6282
7495
  },
6283
7496
  accountCurrency: {
6284
7497
  type: 'string',
@@ -6484,614 +7697,388 @@ export const $CashFlowResponseDto = {
6484
7697
  ]
6485
7698
  } as const;
6486
7699
 
6487
- export const $MonetaryDto = {
6488
- type: 'object',
6489
- properties: {
6490
- amount: {
6491
- type: 'string',
6492
- description: 'Amount (Decimal string)',
6493
- example: '3000'
6494
- },
6495
- currency: {
6496
- type: 'string',
6497
- description: 'ISO 4217 currency',
6498
- example: 'USD'
6499
- },
6500
- baseCcyEquivalent: {
6501
- type: 'object',
6502
- description: 'Converted to user base currency (Decimal string)',
6503
- example: '21600',
6504
- nullable: true
6505
- }
6506
- },
6507
- required: ['amount', 'currency']
6508
- } as const;
6509
-
6510
- export const $CurrentPriceDto = {
6511
- type: 'object',
6512
- properties: {
6513
- amount: {
6514
- type: 'string',
6515
- description: 'Price amount (Decimal string)',
6516
- example: '250'
6517
- },
6518
- currency: {
6519
- type: 'string',
6520
- description: 'Price currency (ISO 4217)',
6521
- example: 'USD'
6522
- },
6523
- date: {
6524
- type: 'string',
6525
- description: 'Price date (ISO 8601)',
6526
- example: '2024-06-01'
6527
- },
6528
- source: {
6529
- type: 'string',
6530
- description: 'Price source',
6531
- example: 'USER_OVERRIDE',
6532
- enum: ['USER_OVERRIDE', 'OPENBB_EQUITY', 'OPENBB_CURRENCY']
6533
- }
6534
- },
6535
- required: ['amount', 'currency', 'date', 'source']
6536
- } as const;
6537
-
6538
- export const $FxRateDto = {
6539
- type: 'object',
6540
- properties: {
6541
- from: {
6542
- type: 'string',
6543
- example: 'USD'
6544
- },
6545
- to: {
6546
- type: 'string',
6547
- example: 'CNY'
6548
- },
6549
- rate: {
6550
- type: 'string',
6551
- description: 'FX rate (Decimal string)',
6552
- example: '7.2'
6553
- },
6554
- date: {
6555
- type: 'string',
6556
- description: 'Rate date (ISO 8601)',
6557
- example: '2024-01-15'
6558
- }
6559
- },
6560
- required: ['from', 'to', 'rate', 'date']
6561
- } as const;
6562
-
6563
- export const $HoldingPnlRowDto = {
7700
+ export const $CategoryGroupDto = {
6564
7701
  type: 'object',
6565
7702
  properties: {
6566
- accountId: {
6567
- type: 'string',
6568
- description: 'Account UUID',
6569
- example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
6570
- },
6571
- accountPath: {
6572
- type: 'string',
6573
- description: 'Full account path',
6574
- example: 'Assets:US:Broker:AAPL'
6575
- },
6576
- accountCcy: {
6577
- type: 'object',
6578
- description: 'Account settlement currency (ISO 4217), from cost currency',
6579
- nullable: true,
6580
- example: 'USD'
6581
- },
6582
- brokerType: {
6583
- type: 'object',
6584
- description: 'Broker type derived from Platform.type',
6585
- nullable: true,
6586
- example: 'broker'
6587
- },
6588
- symbol: {
6589
- type: 'string',
6590
- description: 'Commodity symbol',
6591
- example: 'AAPL'
6592
- },
6593
- chartToken: {
6594
- type: 'string',
6595
- description: 'Chart segment token (libs/common resolver)',
6596
- example: 'equity',
6597
- enum: ['equity', 'fund', 'bond', 'cash', 'other']
6598
- },
6599
- assetClass: {
6600
- type: 'string',
6601
- example: 'EQUITY'
6602
- },
6603
- assetSubClass: {
6604
- type: 'object',
6605
- nullable: true,
6606
- example: 'STOCK'
6607
- },
6608
- units: {
7703
+ category: {
6609
7704
  type: 'string',
6610
- description: 'Net held units (Decimal string)',
6611
- example: '12'
6612
- },
6613
- averageCostPerUnit: {
6614
7705
  description:
6615
- 'Average cost per unit; null when cost currency conflicts or no cost',
6616
- nullable: true,
6617
- allOf: [
6618
- {
6619
- $ref: '#/components/schemas/MonetaryDto'
6620
- }
6621
- ]
6622
- },
6623
- costBasis: {
6624
- description: 'Cost basis of held units',
6625
- nullable: true,
6626
- allOf: [
6627
- {
6628
- $ref: '#/components/schemas/MonetaryDto'
6629
- }
6630
- ]
6631
- },
6632
- marketValue: {
6633
- description: 'Market value at asOf price',
6634
- nullable: true,
6635
- allOf: [
6636
- {
6637
- $ref: '#/components/schemas/MonetaryDto'
6638
- }
6639
- ]
6640
- },
6641
- currentPrice: {
6642
- description: 'Price used for market value',
6643
- nullable: true,
6644
- allOf: [
6645
- {
6646
- $ref: '#/components/schemas/CurrentPriceDto'
6647
- }
6648
- ]
7706
+ 'Functional category (account-path Group segment); regional and universal account paths merge under it',
7707
+ example: 'Food'
6649
7708
  },
6650
- unrealizedPnlBase: {
6651
- type: 'object',
7709
+ totalExpense: {
7710
+ type: 'string',
6652
7711
  description:
6653
- 'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
6654
- nullable: true,
6655
- example: '6000'
6656
- },
6657
- unrealizedPnlPct: {
6658
- type: 'object',
6659
- description: 'Unrealized P&L % (Decimal string)',
6660
- nullable: true,
6661
- example: '25'
6662
- },
6663
- costFxRate: {
6664
- description: 'Historical FX rate applied to cost basis',
6665
- nullable: true,
6666
- allOf: [
6667
- {
6668
- $ref: '#/components/schemas/FxRateDto'
6669
- }
6670
- ]
7712
+ 'Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)',
7713
+ example: '1200.00'
6671
7714
  },
6672
- marketFxRate: {
6673
- description: 'FX rate applied to market value',
6674
- nullable: true,
6675
- allOf: [
6676
- {
6677
- $ref: '#/components/schemas/FxRateDto'
6678
- }
6679
- ]
7715
+ sharePct: {
7716
+ type: 'number',
7717
+ description: 'Share of grand total (0-100); 0 when grand total is 0',
7718
+ example: 42.5
6680
7719
  },
6681
- pctOfInvestedAssets: {
6682
- type: 'object',
6683
- description:
6684
- 'Share of invested assets % (Decimal string); only for invested chartTokens',
6685
- nullable: true,
6686
- example: '40'
7720
+ balanceByCurrency: {
7721
+ description: 'Raw (unconverted) expense per currency',
7722
+ type: 'array',
7723
+ items: {
7724
+ $ref: '#/components/schemas/BalanceByCurrencyDto'
7725
+ }
6687
7726
  },
6688
- realizedPnl: {
6689
- description:
6690
- 'Cumulative realized P&L on sold lots (asOf-date cutoff); null when the method has no applicable sells, a sell lacks a price, or any required FX rate is missing (never-mix). When a sell spans multiple currencies (cross-currency sale), amount and currency reflect the base currency; baseCcyEquivalent is always the authoritative dual-FX figure',
6691
- nullable: true,
6692
- allOf: [
6693
- {
6694
- $ref: '#/components/schemas/MonetaryDto'
6695
- }
6696
- ]
6697
- }
6698
- },
6699
- required: [
6700
- 'accountId',
6701
- 'accountPath',
6702
- 'symbol',
6703
- 'chartToken',
6704
- 'assetClass',
6705
- 'units'
6706
- ]
7727
+ convertedBalance: {
7728
+ type: 'string',
7729
+ description:
7730
+ 'Converted total in base currency (omitted when FX missing for all currencies in this category)',
7731
+ example: '1200.00'
7732
+ }
7733
+ },
7734
+ required: ['category', 'totalExpense', 'sharePct', 'balanceByCurrency']
6707
7735
  } as const;
6708
7736
 
6709
- export const $HoldingPnlWarningDto = {
7737
+ export const $ExpensesByCategorySummaryDto = {
6710
7738
  type: 'object',
6711
7739
  properties: {
6712
- type: {
7740
+ totalExpense: {
6713
7741
  type: 'string',
6714
- description: 'Warning type',
6715
- example: 'MISSING_COST_FX_RATE',
6716
- enum: [
6717
- 'MISSING_COST_FX_RATE',
6718
- 'MISSING_MARKET_FX_RATE',
6719
- 'MISSING_SALE_PRICE',
6720
- 'MISSING_REALIZED_FX_RATE',
6721
- 'OVERSOLD_LOTS',
6722
- 'NO_PRICE',
6723
- 'MIXED_COST_CURRENCY'
6724
- ]
6725
- },
6726
- symbol: {
6727
- type: 'object',
6728
- nullable: true
6729
- },
6730
- accountId: {
6731
- type: 'object',
6732
- nullable: true
7742
+ description:
7743
+ 'Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income',
7744
+ example: '5000.00'
6733
7745
  },
6734
- currency: {
6735
- type: 'object',
6736
- nullable: true
7746
+ categoryCount: {
7747
+ type: 'number',
7748
+ description: 'Number of categories',
7749
+ example: 8
6737
7750
  }
6738
7751
  },
6739
- required: ['type']
7752
+ required: ['totalExpense', 'categoryCount']
6740
7753
  } as const;
6741
7754
 
6742
- export const $HoldingPnlResponseDto = {
7755
+ export const $ExpensesByCategoryResponseDto = {
6743
7756
  type: 'object',
6744
7757
  properties: {
6745
- asOfDate: {
7758
+ period: {
6746
7759
  type: 'string',
6747
- example: '2026-07-08'
7760
+ description: 'Period requested',
7761
+ example: '1m'
6748
7762
  },
6749
7763
  baseCurrency: {
6750
7764
  type: 'string',
7765
+ description: 'Base currency for converted values',
6751
7766
  example: 'CNY'
6752
7767
  },
6753
- method: {
6754
- type: 'string',
7768
+ groups: {
6755
7769
  description:
6756
- 'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
6757
- enum: ['average', 'FIFO'],
6758
- example: 'average'
6759
- },
6760
- rows: {
7770
+ 'Expense groups by functional category, sorted by converted total desc',
6761
7771
  type: 'array',
6762
7772
  items: {
6763
- $ref: '#/components/schemas/HoldingPnlRowDto'
7773
+ $ref: '#/components/schemas/CategoryGroupDto'
6764
7774
  }
6765
7775
  },
7776
+ summary: {
7777
+ description: 'Summary statistics',
7778
+ allOf: [
7779
+ {
7780
+ $ref: '#/components/schemas/ExpensesByCategorySummaryDto'
7781
+ }
7782
+ ]
7783
+ },
6766
7784
  warnings: {
7785
+ description: 'Exchange rate warnings (e.g. missing rate for a currency)',
6767
7786
  type: 'array',
6768
7787
  items: {
6769
- $ref: '#/components/schemas/HoldingPnlWarningDto'
7788
+ $ref: '#/components/schemas/ExchangeRateWarningDto'
6770
7789
  }
6771
7790
  }
6772
7791
  },
6773
- required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
7792
+ required: ['period', 'baseCurrency', 'groups', 'summary']
6774
7793
  } as const;
6775
7794
 
6776
- export const $CreateBeanPriceDto = {
7795
+ export const $MonetaryDto = {
6777
7796
  type: 'object',
6778
7797
  properties: {
6779
- currency: {
6780
- type: 'string',
6781
- description: 'Currency being priced (e.g., USD, AAPL, BTC)',
6782
- example: 'USD'
6783
- },
6784
- quoteCurrency: {
6785
- type: 'string',
6786
- description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
6787
- example: 'CNY'
6788
- },
6789
7798
  amount: {
6790
- type: 'number',
6791
- description:
6792
- 'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
6793
- example: 175.5,
6794
- minimum: 0
7799
+ type: 'string',
7800
+ description: 'Amount (Decimal string)',
7801
+ example: '3000'
6795
7802
  },
6796
- date: {
7803
+ currency: {
6797
7804
  type: 'string',
6798
- description: 'Price date (ISO 8601 format)',
6799
- example: '2024-11-05'
7805
+ description: 'ISO 4217 currency',
7806
+ example: 'USD'
6800
7807
  },
6801
- metadata: {
7808
+ baseCcyEquivalent: {
6802
7809
  type: 'object',
6803
- description:
6804
- 'Metadata (validated by Zod schema, max field lengths enforced)',
6805
- example: {
6806
- source: 'MANUAL',
6807
- note: 'Bank valuation report',
6808
- confidence: 0.95
6809
- }
7810
+ description: 'Converted to user base currency (Decimal string)',
7811
+ example: '21600',
7812
+ nullable: true
6810
7813
  }
6811
7814
  },
6812
- required: ['currency', 'quoteCurrency', 'amount', 'date']
7815
+ required: ['amount', 'currency']
6813
7816
  } as const;
6814
7817
 
6815
- export const $PriceResponseDto = {
7818
+ export const $CurrentPriceDto = {
6816
7819
  type: 'object',
6817
7820
  properties: {
6818
- id: {
6819
- type: 'string',
6820
- description: 'Unique identifier',
6821
- example: 'uuid-123-456'
6822
- },
6823
- userId: {
7821
+ amount: {
6824
7822
  type: 'string',
6825
- description: 'User ID (owner of the price)',
6826
- example: 'user-123'
7823
+ description: 'Price amount (Decimal string)',
7824
+ example: '250'
6827
7825
  },
6828
7826
  currency: {
6829
7827
  type: 'string',
6830
- description: 'Currency being priced (e.g., USD, AAPL, BTC)',
6831
- example: 'BTC'
6832
- },
6833
- quoteCurrency: {
6834
- type: 'string',
6835
- description: 'Quote currency (pricing currency, e.g., USD, CNY)',
7828
+ description: 'Price currency (ISO 4217)',
6836
7829
  example: 'USD'
6837
7830
  },
6838
- amount: {
6839
- type: 'number',
6840
- description:
6841
- 'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
6842
- example: 50000
6843
- },
6844
7831
  date: {
6845
7832
  type: 'string',
6846
- description:
6847
- 'Price date (ISO 8601 format). Represents the date this price was valid.',
6848
- example: '2024-01-01',
6849
- format: 'date'
6850
- },
6851
- meta: {
6852
- type: 'object',
6853
- description:
6854
- 'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
6855
- example: {
6856
- source: 'MANUAL',
6857
- note: 'User-defined price',
6858
- confidence: 1
6859
- }
6860
- },
6861
- createdAt: {
6862
- format: 'date-time',
6863
- type: 'string',
6864
- description: 'Creation timestamp',
6865
- example: '2024-11-03T10:00:00Z'
7833
+ description: 'Price date (ISO 8601)',
7834
+ example: '2024-06-01'
6866
7835
  },
6867
- updatedAt: {
6868
- format: 'date-time',
7836
+ source: {
6869
7837
  type: 'string',
6870
- description: 'Last update timestamp',
6871
- example: '2024-11-03T10:00:00Z'
7838
+ description: 'Price source',
7839
+ example: 'USER_OVERRIDE',
7840
+ enum: ['USER_OVERRIDE', 'OPENBB_EQUITY', 'OPENBB_CURRENCY']
6872
7841
  }
6873
7842
  },
6874
- required: [
6875
- 'id',
6876
- 'userId',
6877
- 'currency',
6878
- 'quoteCurrency',
6879
- 'amount',
6880
- 'date',
6881
- 'meta',
6882
- 'createdAt',
6883
- 'updatedAt'
6884
- ]
7843
+ required: ['amount', 'currency', 'date', 'source']
6885
7844
  } as const;
6886
7845
 
6887
- export const $PriceListResponseDto = {
7846
+ export const $FxRateDto = {
6888
7847
  type: 'object',
6889
7848
  properties: {
6890
- items: {
6891
- description: 'List of prices',
6892
- type: 'array',
6893
- items: {
6894
- $ref: '#/components/schemas/PriceResponseDto'
6895
- }
7849
+ from: {
7850
+ type: 'string',
7851
+ example: 'USD'
6896
7852
  },
6897
- total: {
6898
- type: 'number',
6899
- description: 'Total number of prices',
6900
- example: 42
7853
+ to: {
7854
+ type: 'string',
7855
+ example: 'CNY'
7856
+ },
7857
+ rate: {
7858
+ type: 'string',
7859
+ description: 'FX rate (Decimal string)',
7860
+ example: '7.2'
7861
+ },
7862
+ date: {
7863
+ type: 'string',
7864
+ description: 'Rate date (ISO 8601)',
7865
+ example: '2024-01-15'
6901
7866
  }
6902
7867
  },
6903
- required: ['items', 'total']
7868
+ required: ['from', 'to', 'rate', 'date']
6904
7869
  } as const;
6905
7870
 
6906
- export const $UpdateBeanPriceDto = {
7871
+ export const $HoldingPnlRowDto = {
6907
7872
  type: 'object',
6908
7873
  properties: {
6909
- currency: {
7874
+ accountId: {
6910
7875
  type: 'string',
6911
- description: 'Currency being priced'
7876
+ description: 'Account UUID',
7877
+ example: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
7878
+ },
7879
+ accountPath: {
7880
+ type: 'string',
7881
+ description: 'Full account path',
7882
+ example: 'Assets:US:Broker:AAPL'
7883
+ },
7884
+ accountCcy: {
7885
+ type: 'object',
7886
+ description: 'Account settlement currency (ISO 4217), from cost currency',
7887
+ nullable: true,
7888
+ example: 'USD'
7889
+ },
7890
+ brokerType: {
7891
+ type: 'object',
7892
+ description: 'Broker type derived from Platform.type',
7893
+ nullable: true,
7894
+ example: 'broker'
7895
+ },
7896
+ symbol: {
7897
+ type: 'string',
7898
+ description: 'Commodity symbol',
7899
+ example: 'AAPL'
7900
+ },
7901
+ chartToken: {
7902
+ type: 'string',
7903
+ description: 'Chart segment token (libs/common resolver)',
7904
+ example: 'equity',
7905
+ enum: ['equity', 'fund', 'bond', 'cash', 'other']
7906
+ },
7907
+ assetClass: {
7908
+ type: 'string',
7909
+ example: 'EQUITY'
7910
+ },
7911
+ assetSubClass: {
7912
+ type: 'object',
7913
+ nullable: true,
7914
+ example: 'STOCK'
7915
+ },
7916
+ units: {
7917
+ type: 'string',
7918
+ description: 'Net held units (Decimal string)',
7919
+ example: '12'
7920
+ },
7921
+ averageCostPerUnit: {
7922
+ description:
7923
+ 'Average cost per unit; null when cost currency conflicts or no cost',
7924
+ nullable: true,
7925
+ allOf: [
7926
+ {
7927
+ $ref: '#/components/schemas/MonetaryDto'
7928
+ }
7929
+ ]
7930
+ },
7931
+ costBasis: {
7932
+ description: 'Cost basis of held units',
7933
+ nullable: true,
7934
+ allOf: [
7935
+ {
7936
+ $ref: '#/components/schemas/MonetaryDto'
7937
+ }
7938
+ ]
6912
7939
  },
6913
- quoteCurrency: {
6914
- type: 'string',
6915
- description: 'Quote currency (pricing currency)'
7940
+ marketValue: {
7941
+ description: 'Market value at asOf price',
7942
+ nullable: true,
7943
+ allOf: [
7944
+ {
7945
+ $ref: '#/components/schemas/MonetaryDto'
7946
+ }
7947
+ ]
6916
7948
  },
6917
- amount: {
6918
- type: 'number',
6919
- description: 'Price amount (MUST be >= 0 per Beancount spec)',
6920
- minimum: 0
7949
+ currentPrice: {
7950
+ description: 'Price used for market value',
7951
+ nullable: true,
7952
+ allOf: [
7953
+ {
7954
+ $ref: '#/components/schemas/CurrentPriceDto'
7955
+ }
7956
+ ]
6921
7957
  },
6922
- date: {
6923
- type: 'string',
6924
- description: 'Price date (ISO 8601 format)'
7958
+ unrealizedPnlBase: {
7959
+ type: 'object',
7960
+ description:
7961
+ 'Unrealized P&L in base currency (Decimal string); null when any FX/price missing',
7962
+ nullable: true,
7963
+ example: '6000'
6925
7964
  },
6926
- metadata: {
7965
+ unrealizedPnlPct: {
6927
7966
  type: 'object',
6928
- description: 'Metadata'
6929
- }
6930
- }
6931
- } as const;
6932
-
6933
- export const $CurrencyBalanceDto = {
6934
- type: 'object',
6935
- properties: {
6936
- currency: {
6937
- type: 'string',
6938
- description: 'ISO 4217 currency code',
6939
- example: 'CNY'
7967
+ description: 'Unrealized P&L % (Decimal string)',
7968
+ nullable: true,
7969
+ example: '25'
6940
7970
  },
6941
- balance: {
6942
- type: 'string',
6943
- description: 'Balance amount',
6944
- example: '500000.00'
6945
- }
6946
- },
6947
- required: ['currency', 'balance']
6948
- } as const;
6949
-
6950
- export const $TimeSeriesPointDto = {
6951
- type: 'object',
6952
- properties: {
6953
- date: {
6954
- type: 'string',
6955
- description: 'Date in YYYY-MM-DD format',
6956
- example: '2024-06-15'
7971
+ costFxRate: {
7972
+ description: 'Historical FX rate applied to cost basis',
7973
+ nullable: true,
7974
+ allOf: [
7975
+ {
7976
+ $ref: '#/components/schemas/FxRateDto'
7977
+ }
7978
+ ]
6957
7979
  },
6958
- value: {
6959
- type: 'string',
6960
- description: 'Value at this date (in base currency)',
6961
- example: '500000.00'
7980
+ marketFxRate: {
7981
+ description: 'FX rate applied to market value',
7982
+ nullable: true,
7983
+ allOf: [
7984
+ {
7985
+ $ref: '#/components/schemas/FxRateDto'
7986
+ }
7987
+ ]
6962
7988
  },
6963
- change: {
7989
+ pctOfInvestedAssets: {
6964
7990
  type: 'object',
6965
- description: 'Change from previous point',
6966
- example: '5000.00'
7991
+ description:
7992
+ 'Share of invested assets % (Decimal string); only for invested chartTokens',
7993
+ nullable: true,
7994
+ example: '40'
6967
7995
  },
6968
- byCurrency: {
6969
- description: 'Multi-currency breakdown for this point',
6970
- type: 'array',
6971
- items: {
6972
- $ref: '#/components/schemas/CurrencyBalanceDto'
6973
- }
7996
+ realizedPnl: {
7997
+ description:
7998
+ 'Cumulative realized P&L on sold lots (asOf-date cutoff); null when the method has no applicable sells, a sell lacks a price, or any required FX rate is missing (never-mix). When a sell spans multiple currencies (cross-currency sale), amount and currency reflect the base currency; baseCcyEquivalent is always the authoritative dual-FX figure',
7999
+ nullable: true,
8000
+ allOf: [
8001
+ {
8002
+ $ref: '#/components/schemas/MonetaryDto'
8003
+ }
8004
+ ]
6974
8005
  }
6975
8006
  },
6976
- required: ['date', 'value']
8007
+ required: [
8008
+ 'accountId',
8009
+ 'accountPath',
8010
+ 'symbol',
8011
+ 'chartToken',
8012
+ 'assetClass',
8013
+ 'units'
8014
+ ]
6977
8015
  } as const;
6978
8016
 
6979
- export const $TrendSummaryDto = {
8017
+ export const $HoldingPnlWarningDto = {
6980
8018
  type: 'object',
6981
8019
  properties: {
6982
- startValue: {
6983
- type: 'string',
6984
- description: 'Value at start of period',
6985
- example: '450000.00'
6986
- },
6987
- endValue: {
8020
+ type: {
6988
8021
  type: 'string',
6989
- description: 'Value at end of period',
6990
- example: '500000.00'
8022
+ description: 'Warning type',
8023
+ example: 'MISSING_COST_FX_RATE',
8024
+ enum: [
8025
+ 'MISSING_COST_FX_RATE',
8026
+ 'MISSING_MARKET_FX_RATE',
8027
+ 'MISSING_SALE_PRICE',
8028
+ 'MISSING_REALIZED_FX_RATE',
8029
+ 'OVERSOLD_LOTS',
8030
+ 'NO_PRICE',
8031
+ 'MIXED_COST_CURRENCY'
8032
+ ]
6991
8033
  },
6992
- totalChange: {
6993
- type: 'string',
6994
- description: 'Total change over period',
6995
- example: '50000.00'
8034
+ symbol: {
8035
+ type: 'object',
8036
+ nullable: true
6996
8037
  },
6997
- totalChangePercentage: {
6998
- type: 'string',
6999
- description: 'Total change percentage',
7000
- example: '+11.11%'
7001
- }
7002
- },
7003
- required: ['startValue', 'endValue', 'totalChange', 'totalChangePercentage']
7004
- } as const;
7005
-
7006
- export const $MultiCurrencyPointDto = {
7007
- type: 'object',
7008
- properties: {
7009
- date: {
7010
- type: 'string',
7011
- description: 'Date in YYYY-MM-DD format',
7012
- example: '2024-06-15'
8038
+ accountId: {
8039
+ type: 'object',
8040
+ nullable: true
7013
8041
  },
7014
- byCurrency: {
7015
- description: 'Balances by currency',
7016
- type: 'array',
7017
- items: {
7018
- $ref: '#/components/schemas/CurrencyBalanceDto'
7019
- }
8042
+ currency: {
8043
+ type: 'object',
8044
+ nullable: true
7020
8045
  }
7021
8046
  },
7022
- required: ['date', 'byCurrency']
8047
+ required: ['type']
7023
8048
  } as const;
7024
8049
 
7025
- export const $PortfolioTrendsResponseDto = {
8050
+ export const $HoldingPnlResponseDto = {
7026
8051
  type: 'object',
7027
8052
  properties: {
7028
- series: {
7029
- description: 'Time series data points',
7030
- type: 'array',
7031
- items: {
7032
- $ref: '#/components/schemas/TimeSeriesPointDto'
7033
- }
7034
- },
7035
- summary: {
7036
- description: 'Period summary',
7037
- allOf: [
7038
- {
7039
- $ref: '#/components/schemas/TrendSummaryDto'
7040
- }
7041
- ]
7042
- },
7043
- period: {
7044
- type: 'string',
7045
- description: 'Period requested',
7046
- example: '6m'
7047
- },
7048
- granularity: {
8053
+ asOfDate: {
7049
8054
  type: 'string',
7050
- description: 'Data granularity',
7051
- example: 'month'
8055
+ example: '2026-07-08'
7052
8056
  },
7053
- currency: {
8057
+ baseCurrency: {
7054
8058
  type: 'string',
7055
- description: 'Base currency for converted values',
7056
8059
  example: 'CNY'
7057
8060
  },
7058
- byCurrency: {
8061
+ method: {
8062
+ type: 'string',
7059
8063
  description:
7060
- 'Multi-currency time series (each point has currency breakdown)',
8064
+ 'Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).',
8065
+ enum: ['average', 'FIFO'],
8066
+ example: 'average'
8067
+ },
8068
+ rows: {
7061
8069
  type: 'array',
7062
8070
  items: {
7063
- $ref: '#/components/schemas/MultiCurrencyPointDto'
8071
+ $ref: '#/components/schemas/HoldingPnlRowDto'
7064
8072
  }
7065
8073
  },
7066
8074
  warnings: {
7067
- description: 'Exchange rate warnings',
7068
8075
  type: 'array',
7069
8076
  items: {
7070
- $ref: '#/components/schemas/ExchangeRateWarningDto'
8077
+ $ref: '#/components/schemas/HoldingPnlWarningDto'
7071
8078
  }
7072
8079
  }
7073
8080
  },
7074
- required: ['series', 'summary', 'period', 'granularity', 'currency']
7075
- } as const;
7076
-
7077
- export const $GenerateSnapshotBody = {
7078
- type: 'object',
7079
- properties: {}
7080
- } as const;
7081
-
7082
- export const $GenerateSnapshotResponse = {
7083
- type: 'object',
7084
- properties: {}
7085
- } as const;
7086
-
7087
- export const $BackfillSnapshotsBody = {
7088
- type: 'object',
7089
- properties: {}
7090
- } as const;
7091
-
7092
- export const $BackfillSnapshotsResponse = {
7093
- type: 'object',
7094
- properties: {}
8081
+ required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
7095
8082
  } as const;
7096
8083
 
7097
8084
  export const $AnonymousLoginDto = {
@@ -7104,3 +8091,15 @@ export const $AnonymousLoginDto = {
7104
8091
  },
7105
8092
  required: ['accessToken']
7106
8093
  } as const;
8094
+
8095
+ export const $AnonymousLoginResponseDto = {
8096
+ type: 'object',
8097
+ properties: {
8098
+ authToken: {
8099
+ type: 'string',
8100
+ description: 'JWT auth token',
8101
+ example: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
8102
+ }
8103
+ },
8104
+ required: ['authToken']
8105
+ } as const;