@firela/api-types 0.0.0-canary.614ff760 → 0.0.0-canary.63a53b7d

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,13 +6,9 @@ export type CreateAccountDto = {
6
6
  */
7
7
  path: string;
8
8
  /**
9
- * Display name to distinguish accounts at the same path (default: "")
9
+ * Account open date (server defaults to today)
10
10
  */
11
- displayName?: string;
12
- /**
13
- * Account open date
14
- */
15
- openDate: string;
11
+ openDate?: string;
16
12
  /**
17
13
  * Allowed currencies (null = no restriction)
18
14
  */
@@ -36,18 +32,14 @@ export type CreateAccountDto = {
36
32
  * Whether this is a custom (user-created) account
37
33
  */
38
34
  isCustom?: boolean;
39
- /**
40
- * i18n key for display name (overrides template)
41
- */
42
- i18nKey?: string;
43
35
  /**
44
36
  * Icon identifier (overrides template)
45
37
  */
46
38
  icon?: string;
47
39
  /**
48
- * Additional metadata
40
+ * Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)
49
41
  */
50
- openMeta?: {
42
+ openDirectiveMeta?: {
51
43
  [key: string]: unknown;
52
44
  };
53
45
  /**
@@ -77,10 +69,6 @@ export type AccountResponseDto = {
77
69
  * Account path (hierarchical, colon-separated)
78
70
  */
79
71
  path: string;
80
- /**
81
- * Display name distinguishing multiple accounts at the same path
82
- */
83
- displayName: string;
84
72
  /**
85
73
  * Account type (root segment)
86
74
  */
@@ -121,17 +109,17 @@ export type AccountResponseDto = {
121
109
  */
122
110
  isCustom: boolean;
123
111
  /**
124
- * i18n key for display name
112
+ * Localized display name (ADR-0114, read-time projection)
125
113
  */
126
- i18nKey?: string;
114
+ displayName?: string;
127
115
  /**
128
116
  * Icon identifier
129
117
  */
130
118
  icon?: string;
131
119
  /**
132
- * Account metadata
120
+ * Open directive metadata (ADR-0115 Decision 9)
133
121
  */
134
- openMeta?: {
122
+ openDirectiveMeta?: {
135
123
  [key: string]: unknown;
136
124
  };
137
125
  /**
@@ -178,10 +166,6 @@ export type AccountListResponseDto = {
178
166
  };
179
167
 
180
168
  export type UpdateAccountDto = {
181
- /**
182
- * Display name to distinguish accounts at the same path
183
- */
184
- displayName?: string;
185
169
  /**
186
170
  * Allowed currencies (null = no restriction)
187
171
  */
@@ -197,18 +181,14 @@ export type UpdateAccountDto = {
197
181
  | 'STRICT'
198
182
  | 'STRICT_WITH_SIZE'
199
183
  | 'NONE';
200
- /**
201
- * i18n key for display name
202
- */
203
- i18nKey?: string;
204
184
  /**
205
185
  * Icon identifier
206
186
  */
207
187
  icon?: string;
208
188
  /**
209
- * Additional metadata (merged with existing)
189
+ * Open directive metadata (merged with existing; NOT an opening-balance amount)
210
190
  */
211
- openMeta?: {
191
+ openDirectiveMeta?: {
212
192
  [key: string]: unknown;
213
193
  };
214
194
  /**
@@ -237,6 +217,28 @@ export type ReopenAccountDto = {
237
217
  reopenDate?: string;
238
218
  };
239
219
 
220
+ export type CreateOpeningBalanceDto = {
221
+ /**
222
+ * Opening balance amount (non-negative)
223
+ */
224
+ amount: number;
225
+ /**
226
+ * Currency code
227
+ */
228
+ currency: string;
229
+ /**
230
+ * Opening-balance date (defaults to now)
231
+ */
232
+ date?: string;
233
+ };
234
+
235
+ export type OpeningBalanceResultDto = {
236
+ /**
237
+ * Created opening-balance transaction id.
238
+ */
239
+ transactionId: string;
240
+ };
241
+
240
242
  export type AccountStandardResponseDto = {
241
243
  /**
242
244
  * Account path (hierarchical, colon-separated)
@@ -246,10 +248,6 @@ export type AccountStandardResponseDto = {
246
248
  * Account type in Beancount hierarchy
247
249
  */
248
250
  type: 'Assets' | 'Liabilities' | 'Income' | 'Expenses' | 'Equity';
249
- /**
250
- * i18n key for localized display name
251
- */
252
- i18nKey: string;
253
251
  /**
254
252
  * Short localized display name
255
253
  */
@@ -284,10 +282,6 @@ export type AccountStandardListResponseDto = {
284
282
  };
285
283
 
286
284
  export type TemplateMetadataDto = {
287
- /**
288
- * Whether this path can be extended
289
- */
290
- extendable: boolean;
291
285
  /**
292
286
  * Root account type
293
287
  */
@@ -316,6 +310,53 @@ export type RegionsMetadataResponseDto = {
316
310
  regions: Array<RegionInfoDto>;
317
311
  };
318
312
 
313
+ export type CostSpecDto = {
314
+ /**
315
+ * Cost specification mode (mirrors engine CostSpec)
316
+ */
317
+ mode: 'per-unit' | 'total' | 'date' | 'label' | 'auto';
318
+ /**
319
+ * Per-unit cost (required when mode is "per-unit")
320
+ */
321
+ numberPerUnit?: string;
322
+ /**
323
+ * Total cost for all units (required when mode is "total")
324
+ */
325
+ totalNumber?: string;
326
+ /**
327
+ * Cost currency (required in all modes)
328
+ */
329
+ currency: string;
330
+ /**
331
+ * Lot acquisition date, ISO 8601 (required when mode is "date")
332
+ */
333
+ date?: string;
334
+ /**
335
+ * Lot label (required when mode is "label"; optional tag in buy modes)
336
+ */
337
+ label?: string;
338
+ /**
339
+ * Merge lots for AVERAGE booking (mode: auto)
340
+ */
341
+ merge?: boolean;
342
+ };
343
+
344
+ /**
345
+ * Cost specification mode (mirrors engine CostSpec)
346
+ */
347
+ export type mode = 'per-unit' | 'total' | 'date' | 'label' | 'auto';
348
+
349
+ export type AmountDto = {
350
+ /**
351
+ * Amount as decimal string (max 15 integer + 15 decimal digits)
352
+ */
353
+ number: string;
354
+ /**
355
+ * Currency/commodity code
356
+ */
357
+ currency: string;
358
+ };
359
+
319
360
  export type CreatePostingDto = {
320
361
  /**
321
362
  * Account name in Beancount format (must start with uppercase, colon-separated)
@@ -335,6 +376,14 @@ export type CreatePostingDto = {
335
376
  meta?: {
336
377
  [key: string]: unknown;
337
378
  };
379
+ /**
380
+ * Cost basis (Beancount `{...}`). Maps to engine costSpec. Required for commodity holdings so they carry a monetary weight that can balance.
381
+ */
382
+ cost?: CostSpecDto;
383
+ /**
384
+ * Price annotation (Beancount `@...`). Maps to engine price. Used for valuation; cost takes priority for balance weight.
385
+ */
386
+ price?: AmountDto;
338
387
  };
339
388
 
340
389
  export type CreateTransactionDto = {
@@ -387,6 +436,25 @@ export type CreateTransactionDto = {
387
436
  */
388
437
  export type flag = '*' | '!';
389
438
 
439
+ export type CostDetailDto = {
440
+ /**
441
+ * Per-unit cost basis (mirrors engine Cost.number)
442
+ */
443
+ number?: string;
444
+ /**
445
+ * Cost currency
446
+ */
447
+ currency?: string;
448
+ /**
449
+ * Lot acquisition date (ISO yyyy-mm-dd)
450
+ */
451
+ date?: string;
452
+ /**
453
+ * Lot label
454
+ */
455
+ label?: string;
456
+ };
457
+
390
458
  export type PostingResponseDto = {
391
459
  /**
392
460
  * Account name
@@ -400,6 +468,10 @@ export type PostingResponseDto = {
400
468
  * Currency
401
469
  */
402
470
  currency?: string;
471
+ /**
472
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
473
+ */
474
+ cost?: CostDetailDto;
403
475
  };
404
476
 
405
477
  export type RecurringSuggestionDto = {
@@ -620,9 +692,9 @@ export type PostingDetailDto = {
620
692
  */
621
693
  accountId: string;
622
694
  /**
623
- * Account name
695
+ * Fully-qualified Beancount account path
624
696
  */
625
- accountName: string;
697
+ account: string;
626
698
  /**
627
699
  * Amount as decimal string. Typed optional but always present in responses: interpolation fills any MISSING posting before it is persisted or returned.
628
700
  */
@@ -643,6 +715,10 @@ export type PostingDetailDto = {
643
715
  * Cost date
644
716
  */
645
717
  costDate?: string;
718
+ /**
719
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
720
+ */
721
+ cost?: CostDetailDto;
646
722
  /**
647
723
  * Price amount
648
724
  */
@@ -766,6 +842,51 @@ export type flag2 =
766
842
  */
767
843
  export type status2 = 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
768
844
 
845
+ export type BalanceByCurrencyDto = {
846
+ /**
847
+ * ISO 4217 currency code
848
+ */
849
+ currency: string;
850
+ /**
851
+ * Balance amount
852
+ */
853
+ balance: string;
854
+ };
855
+
856
+ export type ExchangeRateWarningDto = {
857
+ /**
858
+ * Warning type
859
+ */
860
+ type: string;
861
+ /**
862
+ * Currency without exchange rate
863
+ */
864
+ currency: string;
865
+ /**
866
+ * Total amount affected
867
+ */
868
+ totalAmount: string;
869
+ };
870
+
871
+ export type TransactionListSummaryDto = {
872
+ /**
873
+ * 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.
874
+ */
875
+ totalAmount: string;
876
+ /**
877
+ * Base currency (ISO 4217)
878
+ */
879
+ currency: string;
880
+ /**
881
+ * Raw (unconverted) balance per currency
882
+ */
883
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
884
+ /**
885
+ * Currencies missing an FX rate (omitted when empty)
886
+ */
887
+ warnings?: Array<ExchangeRateWarningDto>;
888
+ };
889
+
769
890
  export type TransactionListResponseDto = {
770
891
  /**
771
892
  * List of transactions
@@ -783,6 +904,10 @@ export type TransactionListResponseDto = {
783
904
  * Number of items skipped
784
905
  */
785
906
  offset: number;
907
+ /**
908
+ * 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.
909
+ */
910
+ summary?: TransactionListSummaryDto;
786
911
  };
787
912
 
788
913
  export type TagSuggestionDto = {
@@ -1242,17 +1367,17 @@ export type ResolveResultDto = {
1242
1367
  [key: string]: string;
1243
1368
  };
1244
1369
  /**
1245
- * Resolution ID for undo
1370
+ * Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).
1246
1371
  */
1247
- resolutionId: string;
1372
+ resolutionId?: string;
1248
1373
  /**
1249
1374
  * Whether this decision can be undone
1250
1375
  */
1251
- canUndo: boolean;
1376
+ canUndo?: boolean;
1252
1377
  /**
1253
1378
  * Deadline for undo (24h from resolution)
1254
1379
  */
1255
- undoDeadline: string;
1380
+ undoDeadline?: string;
1256
1381
  /**
1257
1382
  * Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.
1258
1383
  */
@@ -1835,6 +1960,108 @@ export type UpdateCommodityDto = {
1835
1960
  };
1836
1961
  };
1837
1962
 
1963
+ export type CreateBeanPriceDto = {
1964
+ /**
1965
+ * Currency being priced (e.g., USD, AAPL, BTC)
1966
+ */
1967
+ currency: string;
1968
+ /**
1969
+ * Quote currency (pricing currency, e.g., CNY, EUR)
1970
+ */
1971
+ quoteCurrency: string;
1972
+ /**
1973
+ * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
1974
+ */
1975
+ amount: number;
1976
+ /**
1977
+ * Price date (ISO 8601 format)
1978
+ */
1979
+ date: string;
1980
+ /**
1981
+ * Metadata (validated by Zod schema, max field lengths enforced)
1982
+ */
1983
+ metadata?: {
1984
+ [key: string]: unknown;
1985
+ };
1986
+ };
1987
+
1988
+ export type PriceResponseDto = {
1989
+ /**
1990
+ * Unique identifier
1991
+ */
1992
+ id: string;
1993
+ /**
1994
+ * User ID (owner of the price)
1995
+ */
1996
+ userId: string;
1997
+ /**
1998
+ * Currency being priced (e.g., USD, AAPL, BTC)
1999
+ */
2000
+ currency: string;
2001
+ /**
2002
+ * Quote currency (pricing currency, e.g., USD, CNY)
2003
+ */
2004
+ quoteCurrency: string;
2005
+ /**
2006
+ * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
2007
+ */
2008
+ amount: number;
2009
+ /**
2010
+ * Price date (ISO 8601 format). Represents the date this price was valid.
2011
+ */
2012
+ date: string;
2013
+ /**
2014
+ * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
2015
+ */
2016
+ meta: {
2017
+ [key: string]: unknown;
2018
+ };
2019
+ /**
2020
+ * Creation timestamp
2021
+ */
2022
+ createdAt: string;
2023
+ /**
2024
+ * Last update timestamp
2025
+ */
2026
+ updatedAt: string;
2027
+ };
2028
+
2029
+ export type PriceListResponseDto = {
2030
+ /**
2031
+ * List of prices
2032
+ */
2033
+ items: Array<PriceResponseDto>;
2034
+ /**
2035
+ * Total number of prices
2036
+ */
2037
+ total: number;
2038
+ };
2039
+
2040
+ export type UpdateBeanPriceDto = {
2041
+ /**
2042
+ * Currency being priced
2043
+ */
2044
+ currency?: string;
2045
+ /**
2046
+ * Quote currency (pricing currency)
2047
+ */
2048
+ quoteCurrency?: string;
2049
+ /**
2050
+ * Price amount (MUST be >= 0 per Beancount spec)
2051
+ */
2052
+ amount?: number;
2053
+ /**
2054
+ * Price date (ISO 8601 format)
2055
+ */
2056
+ date?: string;
2057
+ /**
2058
+ * Metadata
2059
+ */
2060
+ metadata?: {
2061
+ [key: string]: unknown;
2062
+ };
2063
+ };
2064
+
1838
2065
  export type CreateRecurringRuleDto = {
1839
2066
  /**
1840
2067
  * Rule name (unique per user)
@@ -2947,57 +3174,301 @@ export type UpdatePropertyDto = {
2947
3174
  value: string;
2948
3175
  };
2949
3176
 
2950
- export type FileImportDto = {
3177
+ export type CreateBeanEventDto = {
2951
3178
  /**
2952
- * Bill file to import (CSV, PDF, OFX, etc.)
3179
+ * Life event date (ISO 8601)
2953
3180
  */
2954
- file: Blob | File;
2955
- };
2956
-
2957
- export type ImportErrorDto = {
3181
+ date: string;
2958
3182
  /**
2959
- * Index of failed transaction in the file
3183
+ * Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer
2960
3184
  */
2961
- index: number;
3185
+ type: string;
2962
3186
  /**
2963
- * Error message
3187
+ * Life event description. Empty string is a VALID value (distinct from absence).
2964
3188
  */
2965
- error: string;
3189
+ description: string;
3190
+ /**
3191
+ * Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)
3192
+ */
3193
+ meta?: {
3194
+ [key: string]: unknown;
3195
+ };
2966
3196
  };
2967
3197
 
2968
- export type ReviewItemPreviewDto = {
3198
+ export type EventResponseDto = {
2969
3199
  /**
2970
- * Index in the import batch (for tracking)
3200
+ * Unique identifier
2971
3201
  */
2972
- index: number;
3202
+ id: string;
2973
3203
  /**
2974
- * Transaction date (ISO format)
3204
+ * User ID (owner of the life event)
2975
3205
  */
2976
- date: string;
3206
+ userId: string;
2977
3207
  /**
2978
- * Transaction amount (absolute value)
3208
+ * Life event date (ISO 8601 format)
2979
3209
  */
2980
- amount?: number;
3210
+ date: string;
2981
3211
  /**
2982
- * Currency code
3212
+ * Life event type (user-defined, e.g., "employer", "location")
2983
3213
  */
2984
- currency?: string;
3214
+ type: string;
2985
3215
  /**
2986
- * Transaction narration/description
3216
+ * Life event description. May be an empty string (a valid value distinct from absence).
2987
3217
  */
2988
- narration: string;
3218
+ description: string;
2989
3219
  /**
2990
- * Payee name
3220
+ * Product-side metadata (free-form JSON)
2991
3221
  */
2992
- payee?: string;
3222
+ meta: {
3223
+ [key: string]: unknown;
3224
+ };
2993
3225
  /**
2994
- * Inferred category from rule matching
3226
+ * Creation timestamp
2995
3227
  */
2996
- category?: string;
3228
+ createdAt: string;
2997
3229
  /**
2998
- * Confidence score for the match (0-1)
3230
+ * Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.
2999
3231
  */
3000
- confidence?: number;
3232
+ updatedAt: string;
3233
+ };
3234
+
3235
+ export type EventListResponseDto = {
3236
+ /**
3237
+ * List of life events
3238
+ */
3239
+ items: Array<EventResponseDto>;
3240
+ /**
3241
+ * Total number of life events matching the query
3242
+ */
3243
+ total: number;
3244
+ };
3245
+
3246
+ export type UpdateBeanEventDto = {
3247
+ /**
3248
+ * Life event date (ISO 8601)
3249
+ */
3250
+ date?: string;
3251
+ /**
3252
+ * Life event type (user-defined)
3253
+ */
3254
+ type?: string;
3255
+ /**
3256
+ * Life event description. Empty string is a VALID value (distinct from absence).
3257
+ */
3258
+ description?: string;
3259
+ /**
3260
+ * Product-side metadata (free-form JSON)
3261
+ */
3262
+ meta?: {
3263
+ [key: string]: unknown;
3264
+ };
3265
+ };
3266
+
3267
+ export type OnboardingAccountDto = {
3268
+ /**
3269
+ * Account path (Assets/Liabilities only; format validated by the account service)
3270
+ */
3271
+ path: string;
3272
+ /**
3273
+ * ISO 4217 currency code (3 letters)
3274
+ */
3275
+ currency: string;
3276
+ /**
3277
+ * Opening balance as a non-negative Decimal string (e.g. "1000.00")
3278
+ */
3279
+ openingBalance?: string;
3280
+ /**
3281
+ * Platform ID to bind the account to (references Platform.id); omit for unbound
3282
+ */
3283
+ platformId?: string;
3284
+ };
3285
+
3286
+ export type OnboardingDto = {
3287
+ /**
3288
+ * Asset/Liability accounts to register with opening balances
3289
+ */
3290
+ accounts?: Array<OnboardingAccountDto>;
3291
+ /**
3292
+ * Skip asset registration; only bootstrap the core account set
3293
+ */
3294
+ skipAssetRegistration?: boolean;
3295
+ };
3296
+
3297
+ export type ActualBalanceDto = {
3298
+ /**
3299
+ * Actual balance amount as a decimal string (preserves precision for tolerance inference).
3300
+ */
3301
+ amount: string;
3302
+ /**
3303
+ * Currency code (ISO 4217 or commodity ticker).
3304
+ */
3305
+ ccy: string;
3306
+ };
3307
+
3308
+ export type ComputeReconciliationDto = {
3309
+ /**
3310
+ * BeanAccount id to reconcile.
3311
+ */
3312
+ accountId: string;
3313
+ /**
3314
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3315
+ */
3316
+ asOfDate: string;
3317
+ /**
3318
+ * Actual balance from the external statement.
3319
+ */
3320
+ actualBalance: ActualBalanceDto;
3321
+ };
3322
+
3323
+ export type ReconciliationComputeResultDto = {
3324
+ accountId: string;
3325
+ asOfDate: string;
3326
+ /**
3327
+ * System-computed book balance (decimal string).
3328
+ */
3329
+ bookBalance: string;
3330
+ /**
3331
+ * User-entered actual balance (decimal string).
3332
+ */
3333
+ actualBalance: string;
3334
+ currency: string;
3335
+ /**
3336
+ * Diff = book − actual (decimal string).
3337
+ */
3338
+ diff: string;
3339
+ /**
3340
+ * Applied tolerance (decimal string).
3341
+ */
3342
+ tolerance: string;
3343
+ /**
3344
+ * true when |diff| ≤ tolerance.
3345
+ */
3346
+ withinTolerance: boolean;
3347
+ /**
3348
+ * Suggested next action: assert when within tolerance, pad otherwise.
3349
+ */
3350
+ suggestedAction: 'assert' | 'pad';
3351
+ };
3352
+
3353
+ /**
3354
+ * Suggested next action: assert when within tolerance, pad otherwise.
3355
+ */
3356
+ export type suggestedAction = 'assert' | 'pad';
3357
+
3358
+ export type AssertReconciliationDto = {
3359
+ /**
3360
+ * BeanAccount id to reconcile.
3361
+ */
3362
+ accountId: string;
3363
+ /**
3364
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3365
+ */
3366
+ asOfDate: string;
3367
+ /**
3368
+ * Actual balance from the external statement.
3369
+ */
3370
+ actualBalance: ActualBalanceDto;
3371
+ /**
3372
+ * Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).
3373
+ */
3374
+ tolerance?: string;
3375
+ };
3376
+
3377
+ export type ReconciliationRecordDto = {
3378
+ id: string;
3379
+ accountId: string;
3380
+ date: string;
3381
+ /**
3382
+ * Asserted (actual) amount.
3383
+ */
3384
+ amount: string;
3385
+ currency: string;
3386
+ tolerance?: string;
3387
+ /**
3388
+ * book − actual.
3389
+ */
3390
+ diffAmount?: string;
3391
+ diffCurrency?: string;
3392
+ createdAt: string;
3393
+ };
3394
+
3395
+ export type PadReconciliationDto = {
3396
+ /**
3397
+ * BeanAccount id to reconcile.
3398
+ */
3399
+ accountId: string;
3400
+ /**
3401
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3402
+ */
3403
+ asOfDate: string;
3404
+ /**
3405
+ * Actual balance from the external statement.
3406
+ */
3407
+ actualBalance: ActualBalanceDto;
3408
+ /**
3409
+ * Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).
3410
+ */
3411
+ sourceAccount?: string;
3412
+ };
3413
+
3414
+ export type PadResultDto = {
3415
+ /**
3416
+ * Created pad adjusting transaction id.
3417
+ */
3418
+ transactionId: string;
3419
+ };
3420
+
3421
+ export type FileImportDto = {
3422
+ /**
3423
+ * Bill file to import (CSV, PDF, OFX, etc.)
3424
+ */
3425
+ file: Blob | File;
3426
+ };
3427
+
3428
+ export type ImportErrorDto = {
3429
+ /**
3430
+ * Index of failed transaction in the file
3431
+ */
3432
+ index: number;
3433
+ /**
3434
+ * Error message
3435
+ */
3436
+ error: string;
3437
+ };
3438
+
3439
+ export type ReviewItemPreviewDto = {
3440
+ /**
3441
+ * Index in the import batch (for tracking)
3442
+ */
3443
+ index: number;
3444
+ /**
3445
+ * Transaction date (ISO format)
3446
+ */
3447
+ date: string;
3448
+ /**
3449
+ * Transaction amount (absolute value)
3450
+ */
3451
+ amount?: number;
3452
+ /**
3453
+ * Currency code
3454
+ */
3455
+ currency?: string;
3456
+ /**
3457
+ * Transaction narration/description
3458
+ */
3459
+ narration: string;
3460
+ /**
3461
+ * Payee name
3462
+ */
3463
+ payee?: string;
3464
+ /**
3465
+ * Inferred category from rule matching
3466
+ */
3467
+ category?: string;
3468
+ /**
3469
+ * Confidence score for the match (0-1)
3470
+ */
3471
+ confidence?: number;
3001
3472
  /**
3002
3473
  * Type of branch requiring review
3003
3474
  */
@@ -3245,172 +3716,145 @@ export type UpdateImporterConfigDto = {
3245
3716
  data?: UpdateConfigDataDto;
3246
3717
  };
3247
3718
 
3248
- export type CreatePlatformDto = {
3249
- /**
3250
- * Platform name
3251
- */
3252
- name: string;
3719
+ export type ProviderSyncConfigDto = {
3253
3720
  /**
3254
- * Platform canonical identifier (lowercase, kebab-case)
3721
+ * Source account for the first posting
3255
3722
  */
3256
- canonical: string;
3723
+ sourceAccount: string;
3257
3724
  /**
3258
- * Platform aliases (multi-language names for lookup)
3725
+ * Default currency for transactions
3259
3726
  */
3260
- aliases: Array<string>;
3727
+ defaultCurrency: string;
3261
3728
  /**
3262
- * Platform URL
3729
+ * Default expense account for the second posting
3263
3730
  */
3264
- url: string;
3731
+ defaultExpenseAccount: string;
3265
3732
  /**
3266
- * Platform type
3733
+ * Default income account for the second posting
3267
3734
  */
3268
- type:
3269
- | 'BANK'
3270
- | 'BROKERAGE'
3271
- | 'CRYPTO_EXCHANGE'
3272
- | 'PAYMENT'
3273
- | 'INVESTMENT'
3274
- | 'INSURANCE'
3275
- | 'OTHER';
3735
+ defaultIncomeAccount: string;
3276
3736
  /**
3277
- * Platform logo URL
3737
+ * Filter pending transactions
3278
3738
  */
3279
- logoUrl?: string;
3739
+ filterPending?: boolean;
3280
3740
  /**
3281
- * Whether the platform is active
3741
+ * External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.
3282
3742
  */
3283
- isActive?: boolean;
3743
+ externalAccountId?: string;
3284
3744
  };
3285
3745
 
3286
- /**
3287
- * Platform type
3288
- */
3289
- export type type3 =
3290
- | 'BANK'
3291
- | 'BROKERAGE'
3292
- | 'CRYPTO_EXCHANGE'
3293
- | 'PAYMENT'
3294
- | 'INVESTMENT'
3295
- | 'INSURANCE'
3296
- | 'OTHER';
3297
-
3298
- export type UpdatePlatformDto = {
3746
+ export type ProviderSyncDto = {
3299
3747
  /**
3300
- * Platform name
3748
+ * Provider name (already in URL path, optional here for reference)
3301
3749
  */
3302
- name?: string;
3750
+ provider?: string;
3303
3751
  /**
3304
- * Platform canonical identifier (lowercase, kebab-case)
3752
+ * Unique sync identifier for idempotency
3305
3753
  */
3306
- canonical?: string;
3754
+ syncId?: string;
3307
3755
  /**
3308
- * Platform aliases (multi-language names for lookup)
3756
+ * Provider sync configuration
3309
3757
  */
3310
- aliases?: Array<string>;
3758
+ config: ProviderSyncConfigDto;
3311
3759
  /**
3312
- * Platform URL
3760
+ * Raw transactions from provider
3313
3761
  */
3314
- url?: string;
3762
+ transactions: unknown[];
3763
+ };
3764
+
3765
+ export type ProviderSyncResponseDto = {
3315
3766
  /**
3316
- * Platform type
3767
+ * Number of transactions successfully imported
3317
3768
  */
3318
- type?:
3319
- | 'BANK'
3320
- | 'BROKERAGE'
3321
- | 'CRYPTO_EXCHANGE'
3322
- | 'PAYMENT'
3323
- | 'INVESTMENT'
3324
- | 'INSURANCE'
3325
- | 'OTHER';
3769
+ imported: number;
3326
3770
  /**
3327
- * Platform logo URL
3771
+ * Number of transactions skipped (duplicates)
3328
3772
  */
3329
- logoUrl?: string;
3773
+ skipped: number;
3330
3774
  /**
3331
- * Whether the platform is active
3775
+ * Number of transactions pending review
3332
3776
  */
3333
- isActive?: boolean;
3334
- };
3335
-
3336
- export type ProviderSyncConfigDto = {
3337
- /**
3338
- * Source account for the first posting
3339
- */
3340
- sourceAccount: string;
3341
- /**
3342
- * Default currency for transactions
3343
- */
3344
- defaultCurrency: string;
3777
+ pendingReview: number;
3345
3778
  /**
3346
- * Default expense account for the second posting
3779
+ * Number of transactions that failed to import
3347
3780
  */
3348
- defaultExpenseAccount: string;
3781
+ failed: number;
3349
3782
  /**
3350
- * Default income account for the second posting
3783
+ * IDs of successfully imported transactions
3351
3784
  */
3352
- defaultIncomeAccount: string;
3785
+ importedTransactionIds?: Array<string>;
3353
3786
  /**
3354
- * Filter pending transactions
3787
+ * IDs of review items created for branched transactions
3355
3788
  */
3356
- filterPending?: boolean;
3789
+ reviewItemIds?: Array<string>;
3357
3790
  };
3358
3791
 
3359
- export type ProviderSyncDto = {
3360
- /**
3361
- * Provider name (already in URL path, optional here for reference)
3362
- */
3363
- provider?: string;
3364
- /**
3365
- * Unique sync identifier for idempotency
3366
- */
3367
- syncId?: string;
3368
- /**
3369
- * Provider sync configuration
3370
- */
3371
- config: ProviderSyncConfigDto;
3792
+ export type SupportedProvidersResponseDto = {
3372
3793
  /**
3373
- * Raw transactions from provider
3794
+ * List of supported provider names
3374
3795
  */
3375
- transactions: unknown[];
3796
+ providers: Array<string>;
3376
3797
  };
3377
3798
 
3378
- export type ProviderSyncResponseDto = {
3379
- /**
3380
- * Number of transactions successfully imported
3381
- */
3382
- imported: number;
3799
+ export type CreateExternalAccountLinkDto = {
3383
3800
  /**
3384
- * Number of transactions skipped (duplicates)
3801
+ * Open Banking provider (whitelist)
3385
3802
  */
3386
- skipped: number;
3387
- /**
3388
- * Number of transactions pending review
3389
- */
3390
- pendingReview: number;
3391
- /**
3392
- * Number of transactions that failed to import
3393
- */
3394
- failed: number;
3803
+ provider:
3804
+ | 'plaid'
3805
+ | 'teller'
3806
+ | 'truelayer'
3807
+ | 'gocardless'
3808
+ | 'simplefin'
3809
+ | 'yodlee'
3810
+ | 'beancount-direct'
3811
+ | 'parsed-bill';
3395
3812
  /**
3396
- * IDs of successfully imported transactions
3813
+ * External account ID from the provider
3397
3814
  */
3398
- importedTransactionIds?: Array<string>;
3815
+ externalAccountId: string;
3399
3816
  /**
3400
- * IDs of review items created for branched transactions
3817
+ * Target BeanAccount ID (must belong to the JWT user)
3401
3818
  */
3402
- reviewItemIds?: Array<string>;
3819
+ beanAccountId: string;
3403
3820
  };
3404
3821
 
3405
- export type SupportedProvidersResponseDto = {
3822
+ /**
3823
+ * Open Banking provider (whitelist)
3824
+ */
3825
+ export type provider =
3826
+ | 'plaid'
3827
+ | 'teller'
3828
+ | 'truelayer'
3829
+ | 'gocardless'
3830
+ | 'simplefin'
3831
+ | 'yodlee'
3832
+ | 'beancount-direct'
3833
+ | 'parsed-bill';
3834
+
3835
+ export type ExternalAccountLinkResponseDto = {
3836
+ id: string;
3837
+ provider: string;
3838
+ externalAccountId: string;
3839
+ beanAccountId: string;
3840
+ isActive: boolean;
3841
+ createdAt: string;
3842
+ updatedAt: string;
3843
+ };
3844
+
3845
+ export type ExternalAccountLinkListResponseDto = {
3846
+ items: Array<ExternalAccountLinkResponseDto>;
3847
+ total: number;
3406
3848
  /**
3407
- * List of supported provider names
3849
+ * Filter by provider (query param)
3408
3850
  */
3409
- providers: Array<string>;
3851
+ provider?: string;
3410
3852
  };
3411
3853
 
3412
3854
  export type ParserTelemetryReportDto = unknown;
3413
3855
 
3856
+ export type UncoveredFormatMissDto = unknown;
3857
+
3414
3858
  export type ProcessNlpDto = {
3415
3859
  /**
3416
3860
  * Natural language text describing a transaction (Chinese)
@@ -3986,15 +4430,92 @@ export type liabilitySubType = 'borrow' | 'repay';
3986
4430
  */
3987
4431
  export type equitySubType = 'opening' | 'adjustment';
3988
4432
 
3989
- export type BalanceByCurrencyDto = {
4433
+ export type CreatePlatformDto = {
3990
4434
  /**
3991
- * ISO 4217 currency code
4435
+ * Platform name
3992
4436
  */
3993
- currency: string;
4437
+ name: string;
3994
4438
  /**
3995
- * Balance amount
4439
+ * Platform canonical identifier (lowercase, kebab-case)
3996
4440
  */
3997
- balance: string;
4441
+ canonical: string;
4442
+ /**
4443
+ * Platform aliases (multi-language names for lookup)
4444
+ */
4445
+ aliases: Array<string>;
4446
+ /**
4447
+ * Platform URL
4448
+ */
4449
+ url: string;
4450
+ /**
4451
+ * Platform type
4452
+ */
4453
+ type:
4454
+ | 'BANK'
4455
+ | 'BROKERAGE'
4456
+ | 'CRYPTO_EXCHANGE'
4457
+ | 'PAYMENT'
4458
+ | 'INVESTMENT'
4459
+ | 'INSURANCE'
4460
+ | 'OTHER';
4461
+ /**
4462
+ * Platform logo URL
4463
+ */
4464
+ logoUrl?: string;
4465
+ /**
4466
+ * Whether the platform is active
4467
+ */
4468
+ isActive?: boolean;
4469
+ };
4470
+
4471
+ /**
4472
+ * Platform type
4473
+ */
4474
+ export type type3 =
4475
+ | 'BANK'
4476
+ | 'BROKERAGE'
4477
+ | 'CRYPTO_EXCHANGE'
4478
+ | 'PAYMENT'
4479
+ | 'INVESTMENT'
4480
+ | 'INSURANCE'
4481
+ | 'OTHER';
4482
+
4483
+ export type UpdatePlatformDto = {
4484
+ /**
4485
+ * Platform name
4486
+ */
4487
+ name?: string;
4488
+ /**
4489
+ * Platform canonical identifier (lowercase, kebab-case)
4490
+ */
4491
+ canonical?: string;
4492
+ /**
4493
+ * Platform aliases (multi-language names for lookup)
4494
+ */
4495
+ aliases?: Array<string>;
4496
+ /**
4497
+ * Platform URL
4498
+ */
4499
+ url?: string;
4500
+ /**
4501
+ * Platform type
4502
+ */
4503
+ type?:
4504
+ | 'BANK'
4505
+ | 'BROKERAGE'
4506
+ | 'CRYPTO_EXCHANGE'
4507
+ | 'PAYMENT'
4508
+ | 'INVESTMENT'
4509
+ | 'INSURANCE'
4510
+ | 'OTHER';
4511
+ /**
4512
+ * Platform logo URL
4513
+ */
4514
+ logoUrl?: string;
4515
+ /**
4516
+ * Whether the platform is active
4517
+ */
4518
+ isActive?: boolean;
3998
4519
  };
3999
4520
 
4000
4521
  export type NetWorthByCurrencyDto = {
@@ -4037,21 +4558,6 @@ export type ConvertedNetWorthDto = {
4037
4558
  };
4038
4559
  };
4039
4560
 
4040
- export type ExchangeRateWarningDto = {
4041
- /**
4042
- * Warning type
4043
- */
4044
- type: string;
4045
- /**
4046
- * Currency without exchange rate
4047
- */
4048
- currency: string;
4049
- /**
4050
- * Total amount affected
4051
- */
4052
- totalAmount: string;
4053
- };
4054
-
4055
4561
  export type NetWorthResponseDto = {
4056
4562
  /**
4057
4563
  * Total net worth (assets - liabilities, converted to base currency)
@@ -4116,6 +4622,10 @@ export type AccountItemDto = {
4116
4622
  * Currency code
4117
4623
  */
4118
4624
  currency: string;
4625
+ /**
4626
+ * FX-converted balance in base currency; omitted when not convertible
4627
+ */
4628
+ convertedBalance?: string;
4119
4629
  };
4120
4630
 
4121
4631
  export type PlatformGroupDto = {
@@ -4132,9 +4642,40 @@ export type PlatformGroupDto = {
4132
4642
  */
4133
4643
  accounts: Array<AccountItemDto>;
4134
4644
  /**
4135
- * Total balance across all accounts in platform
4645
+ * FX-converted total balance in base currency
4136
4646
  */
4137
4647
  totalBalance: string;
4648
+ /**
4649
+ * Raw (unconverted) balances grouped by currency
4650
+ */
4651
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
4652
+ /**
4653
+ * Converted balance in base currency (omitted when no currency is convertible)
4654
+ */
4655
+ convertedBalance?: string;
4656
+ /**
4657
+ * Share of the grand converted total (0-100); 0 when grand total is 0
4658
+ */
4659
+ sharePct: number;
4660
+ };
4661
+
4662
+ export type AccountExchangeRateWarningDto = {
4663
+ /**
4664
+ * Warning type
4665
+ */
4666
+ type: string;
4667
+ /**
4668
+ * Currency without exchange rate
4669
+ */
4670
+ currency: string;
4671
+ /**
4672
+ * Affected account paths
4673
+ */
4674
+ accounts: Array<string>;
4675
+ /**
4676
+ * Total amount in this currency
4677
+ */
4678
+ totalAmount: string;
4138
4679
  };
4139
4680
 
4140
4681
  export type AccountsSummaryDto = {
@@ -4146,6 +4687,14 @@ export type AccountsSummaryDto = {
4146
4687
  * Total number of platforms
4147
4688
  */
4148
4689
  totalPlatforms: number;
4690
+ /**
4691
+ * Base currency for conversion
4692
+ */
4693
+ baseCurrency: string;
4694
+ /**
4695
+ * Per-account exchange rate warnings
4696
+ */
4697
+ warnings?: Array<AccountExchangeRateWarningDto>;
4149
4698
  };
4150
4699
 
4151
4700
  export type AccountsResponseDto = {
@@ -4180,6 +4729,10 @@ export type AccountItemWithAssetClassDto = {
4180
4729
  * Currency code
4181
4730
  */
4182
4731
  currency: string;
4732
+ /**
4733
+ * FX-converted balance in base currency; omitted when not convertible
4734
+ */
4735
+ convertedBalance?: string;
4183
4736
  /**
4184
4737
  * Asset class
4185
4738
  */
@@ -4196,8 +4749,21 @@ export type AccountItemWithAssetClassDto = {
4196
4749
  * Risk level
4197
4750
  */
4198
4751
  riskLevel?: string;
4752
+ /**
4753
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4754
+ */
4755
+ source?: 'USER_META' | 'FIAT_CURRENCY' | 'OPENBB_MAPPING' | 'FALLBACK';
4199
4756
  };
4200
4757
 
4758
+ /**
4759
+ * ADR-0105 classification provenance (holding level always; account level only on FALLBACK)
4760
+ */
4761
+ export type source2 =
4762
+ | 'USER_META'
4763
+ | 'FIAT_CURRENCY'
4764
+ | 'OPENBB_MAPPING'
4765
+ | 'FALLBACK';
4766
+
4201
4767
  export type AssetClassGroupDto = {
4202
4768
  /**
4203
4769
  * Asset class name
@@ -4248,134 +4814,423 @@ export type assetClass =
4248
4814
  | 'REAL_ESTATE'
4249
4815
  | 'INDEX';
4250
4816
 
4251
- export type AccountExchangeRateWarningDto = {
4817
+ export type AssetClassSummaryDto = {
4818
+ /**
4819
+ * Total number of accounts
4820
+ */
4821
+ totalAccounts: number;
4822
+ /**
4823
+ * Total number of asset classes
4824
+ */
4825
+ totalAssetClasses: number;
4826
+ /**
4827
+ * Base currency for conversion
4828
+ */
4829
+ baseCurrency: string;
4830
+ /**
4831
+ * Exchange rate warnings
4832
+ */
4833
+ warnings?: Array<AccountExchangeRateWarningDto>;
4834
+ /**
4835
+ * ADR-0105 §4 fallback provenance stats (holding level only). valueRatio is the grey-area share of total converted value; count is the number of source=FALLBACK holdings.
4836
+ */
4837
+ fallback?: {
4838
+ [key: string]: unknown;
4839
+ };
4840
+ };
4841
+
4842
+ export type AssetClassAccountsResponseDto = {
4843
+ /**
4844
+ * Account groups by asset class
4845
+ */
4846
+ groups: Array<AssetClassGroupDto>;
4847
+ /**
4848
+ * Summary statistics
4849
+ */
4850
+ summary: AssetClassSummaryDto;
4851
+ /**
4852
+ * ADR-0105 §6 holding-level grey-area bucket (source=FALLBACK holdings peeled out of groups). Present only for groupBy=holdingAssetClass when FALLBACK holdings exist.
4853
+ */
4854
+ uncategorized?: AssetClassGroupDto;
4855
+ };
4856
+
4857
+ export type HoldingAssetClassAccountSliceDto = {
4858
+ /**
4859
+ * Account ID
4860
+ */
4861
+ accountId: string;
4862
+ /**
4863
+ * Full account path
4864
+ */
4865
+ accountPath: string;
4866
+ /**
4867
+ * Currency of the holding with the largest converted base value; undefined when no holding is convertible
4868
+ */
4869
+ accountCurrency?: string;
4870
+ /**
4871
+ * Account's market value in base currency (Σ converted holdings; grey bucket included)
4872
+ */
4873
+ marketValueBase: string;
4874
+ /**
4875
+ * Share of the global total (0-100). 0 when globalTotal is zero (no NaN/Infinity).
4876
+ */
4877
+ shareOfTotalPct: number;
4878
+ /**
4879
+ * Per-account asset-class breakdown
4880
+ */
4881
+ groups: Array<AssetClassGroupDto>;
4882
+ /**
4883
+ * Per-account grey bucket (source=FALLBACK holdings, incl. broker cash)
4884
+ */
4885
+ uncategorized?: AssetClassGroupDto;
4886
+ /**
4887
+ * Every holding row for this account (account ID in each row’s `id` field)
4888
+ */
4889
+ holdings: Array<AccountItemWithAssetClassDto>;
4890
+ };
4891
+
4892
+ export type HoldingAssetClassCrossAccountResponseDto = {
4893
+ /**
4894
+ * Merged cross-account holding aggregation
4895
+ */
4896
+ global: AssetClassAccountsResponseDto;
4897
+ /**
4898
+ * Per-account slices
4899
+ */
4900
+ byAccount: Array<HoldingAssetClassAccountSliceDto>;
4901
+ };
4902
+
4903
+ export type CashFlowByCurrencyDto = {
4904
+ /**
4905
+ * Income by currency
4906
+ */
4907
+ income: Array<BalanceByCurrencyDto>;
4908
+ /**
4909
+ * Expense by currency
4910
+ */
4911
+ expense: Array<BalanceByCurrencyDto>;
4912
+ /**
4913
+ * Net savings by currency
4914
+ */
4915
+ netSavings: Array<BalanceByCurrencyDto>;
4916
+ };
4917
+
4918
+ export type ConvertedCashFlowDto = {
4919
+ /**
4920
+ * Base currency for conversion
4921
+ */
4922
+ baseCurrency: string;
4923
+ /**
4924
+ * Converted income
4925
+ */
4926
+ income: string;
4927
+ /**
4928
+ * Converted expense
4929
+ */
4930
+ expense: string;
4931
+ /**
4932
+ * Converted net savings
4933
+ */
4934
+ netSavings: string;
4935
+ /**
4936
+ * Exchange rates used for conversion
4937
+ */
4938
+ exchangeRates: {
4939
+ [key: string]: unknown;
4940
+ };
4941
+ };
4942
+
4943
+ export type CashFlowResponseDto = {
4944
+ /**
4945
+ * Period identifier (YYYY-MM)
4946
+ */
4947
+ period: string;
4948
+ /**
4949
+ * Total income for the period (converted)
4950
+ */
4951
+ income: string;
4952
+ /**
4953
+ * Total expenses for the period (converted)
4954
+ */
4955
+ expense: string;
4956
+ /**
4957
+ * Net savings (income - expense, converted)
4958
+ */
4959
+ netSavings: string;
4960
+ /**
4961
+ * Savings rate percentage (netSavings / income * 100)
4962
+ */
4963
+ savingsRate: string;
4964
+ /**
4965
+ * Base currency code
4966
+ */
4967
+ currency: string;
4968
+ /**
4969
+ * Cash flow grouped by original currency
4970
+ */
4971
+ byCurrency?: CashFlowByCurrencyDto;
4972
+ /**
4973
+ * Converted values in base currency
4974
+ */
4975
+ converted?: ConvertedCashFlowDto;
4976
+ /**
4977
+ * Exchange rate warnings
4978
+ */
4979
+ warnings?: Array<ExchangeRateWarningDto>;
4980
+ };
4981
+
4982
+ export type CategoryGroupDto = {
4983
+ /**
4984
+ * Functional category (account-path Group segment); regional and universal account paths merge under it
4985
+ */
4986
+ category: string;
4987
+ /**
4988
+ * Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)
4989
+ */
4990
+ totalExpense: string;
4991
+ /**
4992
+ * Share of grand total (0-100); 0 when grand total is 0
4993
+ */
4994
+ sharePct: number;
4995
+ /**
4996
+ * Raw (unconverted) expense per currency
4997
+ */
4998
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
4999
+ /**
5000
+ * Converted total in base currency (omitted when FX missing for all currencies in this category)
5001
+ */
5002
+ convertedBalance?: string;
5003
+ };
5004
+
5005
+ export type ExpensesByCategorySummaryDto = {
5006
+ /**
5007
+ * Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income
5008
+ */
5009
+ totalExpense: string;
5010
+ /**
5011
+ * Number of categories
5012
+ */
5013
+ categoryCount: number;
5014
+ };
5015
+
5016
+ export type ExpensesByCategoryResponseDto = {
5017
+ /**
5018
+ * Period requested
5019
+ */
5020
+ period: string;
5021
+ /**
5022
+ * Base currency for converted values
5023
+ */
5024
+ baseCurrency: string;
5025
+ /**
5026
+ * Expense groups by functional category, sorted by converted total desc
5027
+ */
5028
+ groups: Array<CategoryGroupDto>;
4252
5029
  /**
4253
- * Warning type
5030
+ * Summary statistics
4254
5031
  */
4255
- type: string;
5032
+ summary: ExpensesByCategorySummaryDto;
4256
5033
  /**
4257
- * Currency without exchange rate
5034
+ * Exchange rate warnings (e.g. missing rate for a currency)
4258
5035
  */
4259
- currency: string;
5036
+ warnings?: Array<ExchangeRateWarningDto>;
5037
+ };
5038
+
5039
+ export type MonetaryDto = {
4260
5040
  /**
4261
- * Affected account paths
5041
+ * Amount (Decimal string)
4262
5042
  */
4263
- accounts: Array<string>;
5043
+ amount: string;
4264
5044
  /**
4265
- * Total amount in this currency
5045
+ * ISO 4217 currency
4266
5046
  */
4267
- totalAmount: string;
5047
+ currency: string;
5048
+ /**
5049
+ * Converted to user base currency (Decimal string)
5050
+ */
5051
+ baseCcyEquivalent?: {
5052
+ [key: string]: unknown;
5053
+ } | null;
4268
5054
  };
4269
5055
 
4270
- export type AssetClassSummaryDto = {
5056
+ export type CurrentPriceDto = {
4271
5057
  /**
4272
- * Total number of accounts
5058
+ * Price amount (Decimal string)
4273
5059
  */
4274
- totalAccounts: number;
5060
+ amount: string;
4275
5061
  /**
4276
- * Total number of asset classes
5062
+ * Price currency (ISO 4217)
4277
5063
  */
4278
- totalAssetClasses: number;
5064
+ currency: string;
4279
5065
  /**
4280
- * Base currency for conversion
5066
+ * Price date (ISO 8601)
4281
5067
  */
4282
- baseCurrency: string;
5068
+ date: string;
4283
5069
  /**
4284
- * Exchange rate warnings
5070
+ * Price source
4285
5071
  */
4286
- warnings?: Array<AccountExchangeRateWarningDto>;
5072
+ source: 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
4287
5073
  };
4288
5074
 
4289
- export type AssetClassAccountsResponseDto = {
5075
+ /**
5076
+ * Price source
5077
+ */
5078
+ export type source3 = 'USER_OVERRIDE' | 'OPENBB_EQUITY' | 'OPENBB_CURRENCY';
5079
+
5080
+ export type FxRateDto = {
5081
+ from: string;
5082
+ to: string;
4290
5083
  /**
4291
- * Account groups by asset class
5084
+ * FX rate (Decimal string)
4292
5085
  */
4293
- groups: Array<AssetClassGroupDto>;
5086
+ rate: string;
4294
5087
  /**
4295
- * Summary statistics
5088
+ * Rate date (ISO 8601)
4296
5089
  */
4297
- summary: AssetClassSummaryDto;
5090
+ date: string;
4298
5091
  };
4299
5092
 
4300
- export type CashFlowByCurrencyDto = {
5093
+ export type HoldingPnlRowDto = {
4301
5094
  /**
4302
- * Income by currency
5095
+ * Account UUID
4303
5096
  */
4304
- income: Array<BalanceByCurrencyDto>;
5097
+ accountId: string;
4305
5098
  /**
4306
- * Expense by currency
5099
+ * Full account path
4307
5100
  */
4308
- expense: Array<BalanceByCurrencyDto>;
5101
+ accountPath: string;
4309
5102
  /**
4310
- * Net savings by currency
5103
+ * Account settlement currency (ISO 4217), from cost currency
4311
5104
  */
4312
- netSavings: Array<BalanceByCurrencyDto>;
4313
- };
4314
-
4315
- export type ConvertedCashFlowDto = {
5105
+ accountCcy?: {
5106
+ [key: string]: unknown;
5107
+ } | null;
4316
5108
  /**
4317
- * Base currency for conversion
5109
+ * Broker type derived from Platform.type
4318
5110
  */
4319
- baseCurrency: string;
5111
+ brokerType?: {
5112
+ [key: string]: unknown;
5113
+ } | null;
4320
5114
  /**
4321
- * Converted income
5115
+ * Commodity symbol
4322
5116
  */
4323
- income: string;
5117
+ symbol: string;
4324
5118
  /**
4325
- * Converted expense
5119
+ * Chart segment token (libs/common resolver)
4326
5120
  */
4327
- expense: string;
5121
+ chartToken: 'equity' | 'fund' | 'bond' | 'cash' | 'other';
5122
+ assetClass: string;
5123
+ assetSubClass?: {
5124
+ [key: string]: unknown;
5125
+ } | null;
4328
5126
  /**
4329
- * Converted net savings
5127
+ * Net held units (Decimal string)
4330
5128
  */
4331
- netSavings: string;
5129
+ units: string;
4332
5130
  /**
4333
- * Exchange rates used for conversion
5131
+ * Average cost per unit; null when cost currency conflicts or no cost
4334
5132
  */
4335
- exchangeRates: {
4336
- [key: string]: unknown;
4337
- };
4338
- };
4339
-
4340
- export type CashFlowResponseDto = {
5133
+ averageCostPerUnit?: MonetaryDto | null;
4341
5134
  /**
4342
- * Period identifier (YYYY-MM)
5135
+ * Cost basis of held units
4343
5136
  */
4344
- period: string;
5137
+ costBasis?: MonetaryDto | null;
4345
5138
  /**
4346
- * Total income for the period (converted)
5139
+ * Market value at asOf price
4347
5140
  */
4348
- income: string;
5141
+ marketValue?: MonetaryDto | null;
4349
5142
  /**
4350
- * Total expenses for the period (converted)
5143
+ * Price used for market value
4351
5144
  */
4352
- expense: string;
5145
+ currentPrice?: CurrentPriceDto | null;
4353
5146
  /**
4354
- * Net savings (income - expense, converted)
5147
+ * Unrealized P&L in base currency (Decimal string); null when any FX/price missing
4355
5148
  */
4356
- netSavings: string;
5149
+ unrealizedPnlBase?: {
5150
+ [key: string]: unknown;
5151
+ } | null;
4357
5152
  /**
4358
- * Savings rate percentage (netSavings / income * 100)
5153
+ * Unrealized P&L % (Decimal string)
4359
5154
  */
4360
- savingsRate: string;
5155
+ unrealizedPnlPct?: {
5156
+ [key: string]: unknown;
5157
+ } | null;
4361
5158
  /**
4362
- * Base currency code
5159
+ * Historical FX rate applied to cost basis
4363
5160
  */
4364
- currency: string;
5161
+ costFxRate?: FxRateDto | null;
4365
5162
  /**
4366
- * Cash flow grouped by original currency
5163
+ * FX rate applied to market value
4367
5164
  */
4368
- byCurrency?: CashFlowByCurrencyDto;
5165
+ marketFxRate?: FxRateDto | null;
4369
5166
  /**
4370
- * Converted values in base currency
5167
+ * Share of invested assets % (Decimal string); only for invested chartTokens
4371
5168
  */
4372
- converted?: ConvertedCashFlowDto;
5169
+ pctOfInvestedAssets?: {
5170
+ [key: string]: unknown;
5171
+ } | null;
4373
5172
  /**
4374
- * Exchange rate warnings
5173
+ * 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
4375
5174
  */
4376
- warnings?: Array<ExchangeRateWarningDto>;
5175
+ realizedPnl?: MonetaryDto | null;
5176
+ };
5177
+
5178
+ /**
5179
+ * Chart segment token (libs/common resolver)
5180
+ */
5181
+ export type chartToken = 'equity' | 'fund' | 'bond' | 'cash' | 'other';
5182
+
5183
+ export type HoldingPnlWarningDto = {
5184
+ /**
5185
+ * Warning type
5186
+ */
5187
+ type:
5188
+ | 'MISSING_COST_FX_RATE'
5189
+ | 'MISSING_MARKET_FX_RATE'
5190
+ | 'MISSING_SALE_PRICE'
5191
+ | 'MISSING_REALIZED_FX_RATE'
5192
+ | 'OVERSOLD_LOTS'
5193
+ | 'NO_PRICE'
5194
+ | 'MIXED_COST_CURRENCY';
5195
+ symbol?: {
5196
+ [key: string]: unknown;
5197
+ } | null;
5198
+ accountId?: {
5199
+ [key: string]: unknown;
5200
+ } | null;
5201
+ currency?: {
5202
+ [key: string]: unknown;
5203
+ } | null;
4377
5204
  };
4378
5205
 
5206
+ /**
5207
+ * Warning type
5208
+ */
5209
+ export type type4 =
5210
+ | 'MISSING_COST_FX_RATE'
5211
+ | 'MISSING_MARKET_FX_RATE'
5212
+ | 'MISSING_SALE_PRICE'
5213
+ | 'MISSING_REALIZED_FX_RATE'
5214
+ | 'OVERSOLD_LOTS'
5215
+ | 'NO_PRICE'
5216
+ | 'MIXED_COST_CURRENCY';
5217
+
5218
+ export type HoldingPnlResponseDto = {
5219
+ asOfDate: string;
5220
+ baseCurrency: string;
5221
+ /**
5222
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
5223
+ */
5224
+ method: 'average' | 'FIFO';
5225
+ rows: Array<HoldingPnlRowDto>;
5226
+ warnings: Array<HoldingPnlWarningDto>;
5227
+ };
5228
+
5229
+ /**
5230
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
5231
+ */
5232
+ export type method = 'average' | 'FIFO';
5233
+
4379
5234
  export type CurrencyBalanceDto = {
4380
5235
  /**
4381
5236
  * ISO 4217 currency code
@@ -4402,6 +5257,14 @@ export type TimeSeriesPointDto = {
4402
5257
  change?: {
4403
5258
  [key: string]: unknown;
4404
5259
  };
5260
+ /**
5261
+ * Total assets at this date (in base currency)
5262
+ */
5263
+ assets?: string;
5264
+ /**
5265
+ * Total liabilities at this date (in base currency)
5266
+ */
5267
+ liabilities?: string;
4405
5268
  /**
4406
5269
  * Multi-currency breakdown for this point
4407
5270
  */
@@ -4469,6 +5332,71 @@ export type PortfolioTrendsResponseDto = {
4469
5332
  warnings?: Array<ExchangeRateWarningDto>;
4470
5333
  };
4471
5334
 
5335
+ export type CashFlowPointDto = {
5336
+ /**
5337
+ * Month key (YYYY-MM)
5338
+ */
5339
+ month: string;
5340
+ /**
5341
+ * Income in base currency (absolute, converted)
5342
+ */
5343
+ income: string;
5344
+ /**
5345
+ * Expense in base currency (absolute, converted)
5346
+ */
5347
+ expense: string;
5348
+ /**
5349
+ * netSavings = income − expense (savings positive)
5350
+ */
5351
+ netSavings: string;
5352
+ };
5353
+
5354
+ export type CashFlowTrendSummaryDto = {
5355
+ /**
5356
+ * Total income across the period
5357
+ */
5358
+ totalIncome: string;
5359
+ /**
5360
+ * Total expense across the period
5361
+ */
5362
+ totalExpense: string;
5363
+ /**
5364
+ * income − expense across the period
5365
+ */
5366
+ totalNetSavings: string;
5367
+ /**
5368
+ * totalNetSavings divided by the window length (N months, incl. zero-filled)
5369
+ */
5370
+ averageMonthlyNetSavings: string;
5371
+ };
5372
+
5373
+ export type CashFlowTrendsResponseDto = {
5374
+ /**
5375
+ * Monthly cash-flow series (fixed N-month window, zero-filled)
5376
+ */
5377
+ series: Array<CashFlowPointDto>;
5378
+ /**
5379
+ * Period totals
5380
+ */
5381
+ summary: CashFlowTrendSummaryDto;
5382
+ /**
5383
+ * Period requested
5384
+ */
5385
+ period: string;
5386
+ /**
5387
+ * Data granularity (v1 returns month buckets)
5388
+ */
5389
+ granularity: string;
5390
+ /**
5391
+ * Base currency for converted values
5392
+ */
5393
+ currency: string;
5394
+ /**
5395
+ * Exchange rate warnings (e.g. missing rate for a currency)
5396
+ */
5397
+ warnings?: Array<ExchangeRateWarningDto>;
5398
+ };
5399
+
4472
5400
  export type GenerateSnapshotBody = unknown;
4473
5401
 
4474
5402
  export type GenerateSnapshotResponse = unknown;
@@ -4512,7 +5440,7 @@ export type AccountControllerFindAllData = {
4512
5440
  */
4513
5441
  region: 'cn' | 'us' | 'de' | 'gb';
4514
5442
  /**
4515
- * Search term for path or i18nKey
5443
+ * Search term for account path
4516
5444
  */
4517
5445
  search?: string;
4518
5446
  /**
@@ -4595,6 +5523,21 @@ export type AccountControllerReopenData = {
4595
5523
 
4596
5524
  export type AccountControllerReopenResponse = AccountResponseDto;
4597
5525
 
5526
+ export type AccountControllerAddOpeningBalanceData = {
5527
+ /**
5528
+ * Account UUID
5529
+ */
5530
+ id: string;
5531
+ /**
5532
+ * Region code for tenant context
5533
+ */
5534
+ region: 'cn' | 'us' | 'de' | 'gb';
5535
+ requestBody: CreateOpeningBalanceDto;
5536
+ };
5537
+
5538
+ export type AccountControllerAddOpeningBalanceResponse =
5539
+ OpeningBalanceResultDto;
5540
+
4598
5541
  export type AccountStandardsControllerGetTemplatesData = {
4599
5542
  /**
4600
5543
  * Region code (cn, us, de)
@@ -4655,6 +5598,10 @@ export type TransactionControllerListData = {
4655
5598
  * Filter by account ID (transactions with postings to this account)
4656
5599
  */
4657
5600
  accountId?: string;
5601
+ /**
5602
+ * Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
5603
+ */
5604
+ category?: string;
4658
5605
  /**
4659
5606
  * Filter by start date (inclusive), format: YYYY-MM-DD
4660
5607
  */
@@ -4779,7 +5726,7 @@ export type TransactionControllerDeleteResponse = void;
4779
5726
 
4780
5727
  export type BalanceControllerGetBalanceData = {
4781
5728
  /**
4782
- * Account name (e.g., "Assets:Bank:Checking")
5729
+ * Account name (e.g., "Assets:Checking")
4783
5730
  */
4784
5731
  account: string;
4785
5732
  /**
@@ -5139,47 +6086,144 @@ export type CommodityControllerUpdateData = {
5139
6086
  region: 'cn' | 'us' | 'de' | 'gb';
5140
6087
  requestBody: UpdateCommodityDto;
5141
6088
  /**
5142
- * Commodity symbol
6089
+ * Commodity symbol
6090
+ */
6091
+ symbol: string;
6092
+ };
6093
+
6094
+ export type CommodityControllerUpdateResponse = CommodityResponseDto;
6095
+
6096
+ export type CommodityControllerDeleteData = {
6097
+ /**
6098
+ * Region code for tenant context
6099
+ */
6100
+ region: 'cn' | 'us' | 'de' | 'gb';
6101
+ /**
6102
+ * Commodity symbol
6103
+ */
6104
+ symbol: string;
6105
+ };
6106
+
6107
+ export type CommodityControllerDeleteResponse = void;
6108
+
6109
+ export type CommodityControllerGetOrCreateData = {
6110
+ /**
6111
+ * Region code for tenant context
6112
+ */
6113
+ region: 'cn' | 'us' | 'de' | 'gb';
6114
+ /**
6115
+ * Commodity symbol
6116
+ */
6117
+ symbol: string;
6118
+ };
6119
+
6120
+ export type CommodityControllerGetOrCreateResponse = CommodityResponseDto;
6121
+
6122
+ export type CommodityControllerBulkCreateData = {
6123
+ /**
6124
+ * Region code for tenant context
6125
+ */
6126
+ region: 'cn' | 'us' | 'de' | 'gb';
6127
+ };
6128
+
6129
+ export type CommodityControllerBulkCreateResponse = Array<CommodityResponseDto>;
6130
+
6131
+ export type PriceControllerCreateData = {
6132
+ /**
6133
+ * Region code for tenant context
6134
+ */
6135
+ region: 'cn' | 'us' | 'de' | 'gb';
6136
+ requestBody: CreateBeanPriceDto;
6137
+ };
6138
+
6139
+ export type PriceControllerCreateResponse = PriceResponseDto;
6140
+
6141
+ export type PriceControllerFindAllData = {
6142
+ /**
6143
+ * Filter by currency (e.g., BTC, AAPL, USD)
6144
+ */
6145
+ currency?: string;
6146
+ /**
6147
+ * Filter prices from this date (ISO 8601 format)
6148
+ */
6149
+ dateFrom?: string;
6150
+ /**
6151
+ * Filter prices to this date (ISO 8601 format)
6152
+ */
6153
+ dateTo?: string;
6154
+ /**
6155
+ * Number of items per page (default: 20, max: 100)
6156
+ */
6157
+ limit?: number;
6158
+ /**
6159
+ * Page number for pagination (default: 1)
6160
+ */
6161
+ page?: number;
6162
+ /**
6163
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6164
+ */
6165
+ quoteCurrency?: string;
6166
+ /**
6167
+ * Region code for tenant context
6168
+ */
6169
+ region: 'cn' | 'us' | 'de' | 'gb';
6170
+ /**
6171
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6172
+ */
6173
+ search?: string;
6174
+ };
6175
+
6176
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6177
+
6178
+ export type PriceControllerFindOneData = {
6179
+ /**
6180
+ * Price ID
6181
+ */
6182
+ id: string;
6183
+ /**
6184
+ * Region code for tenant context
5143
6185
  */
5144
- symbol: string;
6186
+ region: 'cn' | 'us' | 'de' | 'gb';
5145
6187
  };
5146
6188
 
5147
- export type CommodityControllerUpdateResponse = CommodityResponseDto;
6189
+ export type PriceControllerFindOneResponse = PriceResponseDto;
5148
6190
 
5149
- export type CommodityControllerDeleteData = {
6191
+ export type PriceControllerUpdateData = {
5150
6192
  /**
5151
- * Region code for tenant context
6193
+ * Price ID
5152
6194
  */
5153
- region: 'cn' | 'us' | 'de' | 'gb';
6195
+ id: string;
5154
6196
  /**
5155
- * Commodity symbol
6197
+ * Region code for tenant context
5156
6198
  */
5157
- symbol: string;
6199
+ region: 'cn' | 'us' | 'de' | 'gb';
6200
+ requestBody: UpdateBeanPriceDto;
5158
6201
  };
5159
6202
 
5160
- export type CommodityControllerDeleteResponse = void;
6203
+ export type PriceControllerUpdateResponse = PriceResponseDto;
5161
6204
 
5162
- export type CommodityControllerGetOrCreateData = {
6205
+ export type PriceControllerDeleteData = {
5163
6206
  /**
5164
- * Region code for tenant context
6207
+ * Price ID
5165
6208
  */
5166
- region: 'cn' | 'us' | 'de' | 'gb';
6209
+ id: string;
5167
6210
  /**
5168
- * Commodity symbol
6211
+ * Region code for tenant context
5169
6212
  */
5170
- symbol: string;
6213
+ region: 'cn' | 'us' | 'de' | 'gb';
5171
6214
  };
5172
6215
 
5173
- export type CommodityControllerGetOrCreateResponse = CommodityResponseDto;
6216
+ export type PriceControllerDeleteResponse = void;
5174
6217
 
5175
- export type CommodityControllerBulkCreateData = {
6218
+ export type PriceControllerBulkCreateData = {
5176
6219
  /**
5177
6220
  * Region code for tenant context
5178
6221
  */
5179
6222
  region: 'cn' | 'us' | 'de' | 'gb';
6223
+ requestBody: Array<string>;
5180
6224
  };
5181
6225
 
5182
- export type CommodityControllerBulkCreateResponse = Array<CommodityResponseDto>;
6226
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
5183
6227
 
5184
6228
  export type RecurringRuleControllerCreateData = {
5185
6229
  /**
@@ -5646,6 +6690,159 @@ export type PropertyControllerDeleteData = {
5646
6690
 
5647
6691
  export type PropertyControllerDeleteResponse = void;
5648
6692
 
6693
+ export type EventControllerCreateData = {
6694
+ /**
6695
+ * Region code for tenant context (decorative for life events)
6696
+ */
6697
+ region: 'cn' | 'us' | 'de' | 'gb';
6698
+ requestBody: CreateBeanEventDto;
6699
+ };
6700
+
6701
+ export type EventControllerCreateResponse = EventResponseDto;
6702
+
6703
+ export type EventControllerFindAllData = {
6704
+ /**
6705
+ * Filter life events from this date (ISO 8601 format)
6706
+ */
6707
+ from?: string;
6708
+ /**
6709
+ * Number of items per page (default: 20, max: 100)
6710
+ */
6711
+ limit?: number;
6712
+ /**
6713
+ * Page number for pagination (default: 1)
6714
+ */
6715
+ page?: number;
6716
+ /**
6717
+ * Search term for description (case-insensitive partial match)
6718
+ */
6719
+ q?: string;
6720
+ /**
6721
+ * Region code for tenant context (decorative for life events)
6722
+ */
6723
+ region: 'cn' | 'us' | 'de' | 'gb';
6724
+ /**
6725
+ * Filter life events to this date (ISO 8601 format)
6726
+ */
6727
+ to?: string;
6728
+ /**
6729
+ * Filter by life event type (exact match)
6730
+ */
6731
+ type?: string;
6732
+ };
6733
+
6734
+ export type EventControllerFindAllResponse = EventListResponseDto;
6735
+
6736
+ export type EventControllerFindOneData = {
6737
+ /**
6738
+ * Life event ID
6739
+ */
6740
+ id: string;
6741
+ /**
6742
+ * Region code for tenant context (decorative for life events)
6743
+ */
6744
+ region: 'cn' | 'us' | 'de' | 'gb';
6745
+ };
6746
+
6747
+ export type EventControllerFindOneResponse = EventResponseDto;
6748
+
6749
+ export type EventControllerUpdateData = {
6750
+ /**
6751
+ * Life event ID
6752
+ */
6753
+ id: string;
6754
+ /**
6755
+ * Region code for tenant context (decorative for life events)
6756
+ */
6757
+ region: 'cn' | 'us' | 'de' | 'gb';
6758
+ requestBody: UpdateBeanEventDto;
6759
+ };
6760
+
6761
+ export type EventControllerUpdateResponse = EventResponseDto;
6762
+
6763
+ export type EventControllerDeleteData = {
6764
+ /**
6765
+ * Life event ID
6766
+ */
6767
+ id: string;
6768
+ /**
6769
+ * Region code for tenant context (decorative for life events)
6770
+ */
6771
+ region: 'cn' | 'us' | 'de' | 'gb';
6772
+ };
6773
+
6774
+ export type EventControllerDeleteResponse = void;
6775
+
6776
+ export type EventControllerGetSliceData = {
6777
+ accountPattern: string;
6778
+ granularity: string;
6779
+ /**
6780
+ * Life event ID
6781
+ */
6782
+ id: string;
6783
+ /**
6784
+ * Region code for tenant context (decorative for life events)
6785
+ */
6786
+ region: 'cn' | 'us' | 'de' | 'gb';
6787
+ };
6788
+
6789
+ export type EventControllerGetSliceResponse = unknown;
6790
+
6791
+ export type OnboardingControllerBootstrapData = {
6792
+ /**
6793
+ * Region code for tenant context
6794
+ */
6795
+ region: 'cn' | 'us' | 'de' | 'gb';
6796
+ requestBody: OnboardingDto;
6797
+ };
6798
+
6799
+ export type OnboardingControllerBootstrapResponse = unknown;
6800
+
6801
+ export type ReconciliationControllerComputeData = {
6802
+ /**
6803
+ * Region code for tenant context (decorative for reconciliation)
6804
+ */
6805
+ region: 'cn' | 'us' | 'de' | 'gb';
6806
+ requestBody: ComputeReconciliationDto;
6807
+ };
6808
+
6809
+ export type ReconciliationControllerComputeResponse =
6810
+ ReconciliationComputeResultDto;
6811
+
6812
+ export type ReconciliationControllerAssertData = {
6813
+ /**
6814
+ * Region code for tenant context (decorative for reconciliation)
6815
+ */
6816
+ region: 'cn' | 'us' | 'de' | 'gb';
6817
+ requestBody: AssertReconciliationDto;
6818
+ };
6819
+
6820
+ export type ReconciliationControllerAssertResponse = ReconciliationRecordDto;
6821
+
6822
+ export type ReconciliationControllerPadData = {
6823
+ /**
6824
+ * Region code for tenant context (decorative for reconciliation)
6825
+ */
6826
+ region: 'cn' | 'us' | 'de' | 'gb';
6827
+ requestBody: PadReconciliationDto;
6828
+ };
6829
+
6830
+ export type ReconciliationControllerPadResponse = PadResultDto;
6831
+
6832
+ export type ReconciliationControllerHistoryData = {
6833
+ /**
6834
+ * BeanAccount id
6835
+ */
6836
+ accountId: string;
6837
+ /**
6838
+ * Region code for tenant context (decorative for reconciliation)
6839
+ */
6840
+ region: 'cn' | 'us' | 'de' | 'gb';
6841
+ };
6842
+
6843
+ export type ReconciliationControllerHistoryResponse =
6844
+ Array<ReconciliationRecordDto>;
6845
+
5649
6846
  export type ExportControllerExportBeancountResponse = unknown;
5650
6847
 
5651
6848
  export type FileImportControllerImportFileData = {
@@ -5738,48 +6935,6 @@ export type ImporterConfigControllerResetConfigData = {
5738
6935
 
5739
6936
  export type ImporterConfigControllerResetConfigResponse = ImporterConfigDto;
5740
6937
 
5741
- export type PlatformControllerFindAllResponse = unknown;
5742
-
5743
- export type PlatformControllerCreateData = {
5744
- requestBody: CreatePlatformDto;
5745
- };
5746
-
5747
- export type PlatformControllerCreateResponse = unknown;
5748
-
5749
- export type PlatformControllerGetPlatformListResponse = unknown;
5750
-
5751
- export type PlatformControllerMatchPlatformsData = {
5752
- /**
5753
- * Search query — Chinese name, English name, or abbreviation
5754
- */
5755
- q: string;
5756
- /**
5757
- * Region code for category override lookup
5758
- */
5759
- region?: string;
5760
- };
5761
-
5762
- export type PlatformControllerMatchPlatformsResponse = unknown;
5763
-
5764
- export type PlatformControllerUpdateData = {
5765
- /**
5766
- * Platform ID
5767
- */
5768
- id: string;
5769
- requestBody: UpdatePlatformDto;
5770
- };
5771
-
5772
- export type PlatformControllerUpdateResponse = unknown;
5773
-
5774
- export type PlatformControllerDeleteData = {
5775
- /**
5776
- * Platform ID
5777
- */
5778
- id: string;
5779
- };
5780
-
5781
- export type PlatformControllerDeleteResponse = void;
5782
-
5783
6938
  export type ProviderSyncControllerSyncData = {
5784
6939
  /**
5785
6940
  * Provider name
@@ -5794,9 +6949,9 @@ export type ProviderSyncControllerSyncData = {
5794
6949
  | 'beancount-direct'
5795
6950
  | 'parsed-bill';
5796
6951
  /**
5797
- * Region code
6952
+ * Region code for tenant context
5798
6953
  */
5799
- region: unknown;
6954
+ region: 'cn' | 'us' | 'de' | 'gb';
5800
6955
  requestBody: ProviderSyncDto;
5801
6956
  };
5802
6957
 
@@ -5825,6 +6980,49 @@ export type ProviderSyncControllerIsProviderSupportedData = {
5825
6980
 
5826
6981
  export type ProviderSyncControllerIsProviderSupportedResponse = unknown;
5827
6982
 
6983
+ export type ExternalAccountLinkControllerCreateData = {
6984
+ /**
6985
+ * Region code for tenant context
6986
+ */
6987
+ region: 'cn' | 'us' | 'de' | 'gb';
6988
+ requestBody: CreateExternalAccountLinkDto;
6989
+ };
6990
+
6991
+ export type ExternalAccountLinkControllerCreateResponse =
6992
+ ExternalAccountLinkResponseDto;
6993
+
6994
+ export type ExternalAccountLinkControllerFindAllData = {
6995
+ provider: string;
6996
+ /**
6997
+ * Region code for tenant context
6998
+ */
6999
+ region: 'cn' | 'us' | 'de' | 'gb';
7000
+ };
7001
+
7002
+ export type ExternalAccountLinkControllerFindAllResponse =
7003
+ ExternalAccountLinkListResponseDto;
7004
+
7005
+ export type ExternalAccountLinkControllerFindOneData = {
7006
+ id: string;
7007
+ /**
7008
+ * Region code for tenant context
7009
+ */
7010
+ region: 'cn' | 'us' | 'de' | 'gb';
7011
+ };
7012
+
7013
+ export type ExternalAccountLinkControllerFindOneResponse =
7014
+ ExternalAccountLinkResponseDto;
7015
+
7016
+ export type ExternalAccountLinkControllerRemoveData = {
7017
+ id: string;
7018
+ /**
7019
+ * Region code for tenant context
7020
+ */
7021
+ region: 'cn' | 'us' | 'de' | 'gb';
7022
+ };
7023
+
7024
+ export type ExternalAccountLinkControllerRemoveResponse = void;
7025
+
5828
7026
  export type TelemetryControllerReportTelemetryData = {
5829
7027
  /**
5830
7028
  * Region code for tenant context
@@ -5835,6 +7033,29 @@ export type TelemetryControllerReportTelemetryData = {
5835
7033
 
5836
7034
  export type TelemetryControllerReportTelemetryResponse = unknown;
5837
7035
 
7036
+ export type TelemetryControllerReportCoverageMissData = {
7037
+ /**
7038
+ * Region code for tenant context
7039
+ */
7040
+ region: 'cn' | 'us' | 'de' | 'gb';
7041
+ requestBody: UncoveredFormatMissDto;
7042
+ };
7043
+
7044
+ export type TelemetryControllerReportCoverageMissResponse = unknown;
7045
+
7046
+ export type TelemetryControllerGetCoverageMetricsData = {
7047
+ /**
7048
+ * Region code for tenant context
7049
+ */
7050
+ region: 'cn' | 'us' | 'de' | 'gb';
7051
+ /**
7052
+ * Top-N uncovered formats (default 10)
7053
+ */
7054
+ topN?: unknown;
7055
+ };
7056
+
7057
+ export type TelemetryControllerGetCoverageMetricsResponse = unknown;
7058
+
5838
7059
  export type NlpControllerProcessNaturalLanguageData = {
5839
7060
  /**
5840
7061
  * Region code for tenant context
@@ -5874,6 +7095,48 @@ export type NlpControllerGetSessionData = {
5874
7095
 
5875
7096
  export type NlpControllerGetSessionResponse = unknown;
5876
7097
 
7098
+ export type PlatformControllerFindAllResponse = unknown;
7099
+
7100
+ export type PlatformControllerCreateData = {
7101
+ requestBody: CreatePlatformDto;
7102
+ };
7103
+
7104
+ export type PlatformControllerCreateResponse = unknown;
7105
+
7106
+ export type PlatformControllerGetPlatformListResponse = unknown;
7107
+
7108
+ export type PlatformControllerMatchPlatformsData = {
7109
+ /**
7110
+ * Search query — Chinese name, English name, or abbreviation
7111
+ */
7112
+ q: string;
7113
+ /**
7114
+ * Region code for category override lookup
7115
+ */
7116
+ region?: string;
7117
+ };
7118
+
7119
+ export type PlatformControllerMatchPlatformsResponse = unknown;
7120
+
7121
+ export type PlatformControllerUpdateData = {
7122
+ /**
7123
+ * Platform ID
7124
+ */
7125
+ id: string;
7126
+ requestBody: UpdatePlatformDto;
7127
+ };
7128
+
7129
+ export type PlatformControllerUpdateResponse = unknown;
7130
+
7131
+ export type PlatformControllerDeleteData = {
7132
+ /**
7133
+ * Platform ID
7134
+ */
7135
+ id: string;
7136
+ };
7137
+
7138
+ export type PlatformControllerDeleteResponse = void;
7139
+
5877
7140
  export type DashboardControllerGetNetWorthData = {
5878
7141
  /**
5879
7142
  * Date for balance calculation (ISO 8601 format)
@@ -5888,6 +7151,10 @@ export type DashboardControllerGetNetWorthData = {
5888
7151
  export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
5889
7152
 
5890
7153
  export type DashboardControllerGetAccountsData = {
7154
+ /**
7155
+ * Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
7156
+ */
7157
+ accountId?: string;
5891
7158
  /**
5892
7159
  * Date for balance calculation (ISO 8601 format)
5893
7160
  */
@@ -5895,7 +7162,11 @@ export type DashboardControllerGetAccountsData = {
5895
7162
  /**
5896
7163
  * Grouping strategy
5897
7164
  */
5898
- groupBy?: 'platform' | 'assetClass';
7165
+ groupBy?:
7166
+ | 'platform'
7167
+ | 'assetClass'
7168
+ | 'holdingAssetClass'
7169
+ | 'holdingAssetClassByAccount';
5899
7170
  /**
5900
7171
  * Region code for tenant context
5901
7172
  */
@@ -5904,7 +7175,8 @@ export type DashboardControllerGetAccountsData = {
5904
7175
 
5905
7176
  export type DashboardControllerGetAccountsResponse =
5906
7177
  | AccountsResponseDto
5907
- | AssetClassAccountsResponseDto;
7178
+ | AssetClassAccountsResponseDto
7179
+ | HoldingAssetClassCrossAccountResponseDto;
5908
7180
 
5909
7181
  export type DashboardControllerGetCashFlowData = {
5910
7182
  /**
@@ -5919,6 +7191,49 @@ export type DashboardControllerGetCashFlowData = {
5919
7191
 
5920
7192
  export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
5921
7193
 
7194
+ export type DashboardControllerGetExpensesData = {
7195
+ /**
7196
+ * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
7197
+ */
7198
+ flow?: 'expense' | 'income';
7199
+ /**
7200
+ * Grouping strategy
7201
+ */
7202
+ groupBy?: 'category';
7203
+ /**
7204
+ * Time window (1m = current calendar month)
7205
+ */
7206
+ period?: '1m' | '3m' | '6m' | '1y';
7207
+ /**
7208
+ * Region code for tenant context
7209
+ */
7210
+ region: 'cn' | 'us' | 'de' | 'gb';
7211
+ };
7212
+
7213
+ export type DashboardControllerGetExpensesResponse =
7214
+ ExpensesByCategoryResponseDto;
7215
+
7216
+ export type HoldingPnlControllerGetHoldingPnlData = {
7217
+ /**
7218
+ * Scope to a single account
7219
+ */
7220
+ accountId?: string;
7221
+ /**
7222
+ * As-of date (ISO 8601), defaults to today
7223
+ */
7224
+ asOf?: string;
7225
+ /**
7226
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
7227
+ */
7228
+ method?: 'FIFO' | 'average';
7229
+ /**
7230
+ * Region code for tenant context
7231
+ */
7232
+ region: 'cn' | 'us' | 'de' | 'gb';
7233
+ };
7234
+
7235
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
7236
+
5922
7237
  export type ReportingControllerGetPortfolioTrendsData = {
5923
7238
  /**
5924
7239
  * Data granularity
@@ -5937,6 +7252,24 @@ export type ReportingControllerGetPortfolioTrendsData = {
5937
7252
  export type ReportingControllerGetPortfolioTrendsResponse =
5938
7253
  PortfolioTrendsResponseDto;
5939
7254
 
7255
+ export type ReportingControllerGetCashFlowTrendsData = {
7256
+ /**
7257
+ * Data granularity (accepted for API symmetry; v1 returns month buckets)
7258
+ */
7259
+ granularity?: 'day' | 'week' | 'month';
7260
+ /**
7261
+ * Time period
7262
+ */
7263
+ period?: '1m' | '3m' | '6m' | '1y';
7264
+ /**
7265
+ * Region code for tenant context
7266
+ */
7267
+ region: 'cn' | 'us' | 'de' | 'gb';
7268
+ };
7269
+
7270
+ export type ReportingControllerGetCashFlowTrendsResponse =
7271
+ CashFlowTrendsResponseDto;
7272
+
5940
7273
  export type ReportingControllerGenerateSnapshotData = {
5941
7274
  /**
5942
7275
  * Region code for tenant context
@@ -6116,6 +7449,25 @@ export type $OpenApiTs = {
6116
7449
  };
6117
7450
  };
6118
7451
  };
7452
+ '/api/v1/{region}/bean/accounts/{id}/opening-balance': {
7453
+ post: {
7454
+ req: AccountControllerAddOpeningBalanceData;
7455
+ res: {
7456
+ /**
7457
+ * Opening-balance transaction created
7458
+ */
7459
+ 201: OpeningBalanceResultDto;
7460
+ /**
7461
+ * Account not found
7462
+ */
7463
+ 404: unknown;
7464
+ /**
7465
+ * An opening balance already exists for this account
7466
+ */
7467
+ 409: unknown;
7468
+ };
7469
+ };
7470
+ };
6119
7471
  '/api/v1/{region}/bean/account-standards': {
6120
7472
  get: {
6121
7473
  req: AccountStandardsControllerGetTemplatesData;
@@ -6724,6 +8076,90 @@ export type $OpenApiTs = {
6724
8076
  };
6725
8077
  };
6726
8078
  };
8079
+ '/api/v1/{region}/bean/prices': {
8080
+ post: {
8081
+ req: PriceControllerCreateData;
8082
+ res: {
8083
+ /**
8084
+ * Price created successfully
8085
+ */
8086
+ 201: PriceResponseDto;
8087
+ /**
8088
+ * Currency or quoteCurrency commodity not found
8089
+ */
8090
+ 404: unknown;
8091
+ /**
8092
+ * Price already exists for this currency pair and date
8093
+ */
8094
+ 409: unknown;
8095
+ };
8096
+ };
8097
+ get: {
8098
+ req: PriceControllerFindAllData;
8099
+ res: {
8100
+ /**
8101
+ * Prices retrieved successfully
8102
+ */
8103
+ 200: PriceListResponseDto;
8104
+ };
8105
+ };
8106
+ };
8107
+ '/api/v1/{region}/bean/prices/{id}': {
8108
+ get: {
8109
+ req: PriceControllerFindOneData;
8110
+ res: {
8111
+ /**
8112
+ * Price retrieved successfully
8113
+ */
8114
+ 200: PriceResponseDto;
8115
+ /**
8116
+ * Price not found
8117
+ */
8118
+ 404: unknown;
8119
+ };
8120
+ };
8121
+ put: {
8122
+ req: PriceControllerUpdateData;
8123
+ res: {
8124
+ /**
8125
+ * Price updated successfully
8126
+ */
8127
+ 200: PriceResponseDto;
8128
+ /**
8129
+ * Price not found
8130
+ */
8131
+ 404: unknown;
8132
+ /**
8133
+ * Updated price conflicts with existing price
8134
+ */
8135
+ 409: unknown;
8136
+ };
8137
+ };
8138
+ delete: {
8139
+ req: PriceControllerDeleteData;
8140
+ res: {
8141
+ /**
8142
+ * Price deleted successfully
8143
+ */
8144
+ 204: void;
8145
+ /**
8146
+ * Price not found
8147
+ */
8148
+ 404: unknown;
8149
+ };
8150
+ };
8151
+ };
8152
+ '/api/v1/{region}/bean/prices/bulk': {
8153
+ post: {
8154
+ req: PriceControllerBulkCreateData;
8155
+ res: {
8156
+ /**
8157
+ * Prices created successfully
8158
+ */
8159
+ 201: Array<PriceResponseDto>;
8160
+ };
8161
+ };
8162
+ };
6727
8163
  '/api/v1/{region}/bean/recurring-rules': {
6728
8164
  post: {
6729
8165
  req: RecurringRuleControllerCreateData;
@@ -7320,49 +8756,224 @@ export type $OpenApiTs = {
7320
8756
  */
7321
8757
  401: unknown;
7322
8758
  /**
7323
- * Forbidden - insufficient permissions
8759
+ * Forbidden - insufficient permissions
8760
+ */
8761
+ 403: unknown;
8762
+ /**
8763
+ * Property not found
8764
+ */
8765
+ 404: unknown;
8766
+ };
8767
+ };
8768
+ put: {
8769
+ req: PropertyControllerUpdateData;
8770
+ res: {
8771
+ /**
8772
+ * Property updated successfully
8773
+ */
8774
+ 200: unknown;
8775
+ /**
8776
+ * Unauthorized
8777
+ */
8778
+ 401: unknown;
8779
+ /**
8780
+ * Forbidden - insufficient permissions
8781
+ */
8782
+ 403: unknown;
8783
+ };
8784
+ };
8785
+ delete: {
8786
+ req: PropertyControllerDeleteData;
8787
+ res: {
8788
+ /**
8789
+ * Property deleted successfully
8790
+ */
8791
+ 204: void;
8792
+ /**
8793
+ * Unauthorized
8794
+ */
8795
+ 401: unknown;
8796
+ /**
8797
+ * Forbidden - insufficient permissions
8798
+ */
8799
+ 403: unknown;
8800
+ /**
8801
+ * Property not found
8802
+ */
8803
+ 404: unknown;
8804
+ };
8805
+ };
8806
+ };
8807
+ '/api/v1/{region}/bean/events': {
8808
+ post: {
8809
+ req: EventControllerCreateData;
8810
+ res: {
8811
+ /**
8812
+ * Life event created successfully
8813
+ */
8814
+ 201: EventResponseDto;
8815
+ /**
8816
+ * Life event already exists for this (userId, type, date) combination
8817
+ */
8818
+ 409: unknown;
8819
+ };
8820
+ };
8821
+ get: {
8822
+ req: EventControllerFindAllData;
8823
+ res: {
8824
+ /**
8825
+ * Life events retrieved successfully
8826
+ */
8827
+ 200: EventListResponseDto;
8828
+ };
8829
+ };
8830
+ };
8831
+ '/api/v1/{region}/bean/events/{id}': {
8832
+ get: {
8833
+ req: EventControllerFindOneData;
8834
+ res: {
8835
+ /**
8836
+ * Life event retrieved successfully
8837
+ */
8838
+ 200: EventResponseDto;
8839
+ /**
8840
+ * Life event not found
8841
+ */
8842
+ 404: unknown;
8843
+ };
8844
+ };
8845
+ put: {
8846
+ req: EventControllerUpdateData;
8847
+ res: {
8848
+ /**
8849
+ * Life event updated successfully
8850
+ */
8851
+ 200: EventResponseDto;
8852
+ /**
8853
+ * If-Match header is not a valid ISO 8601 date
8854
+ */
8855
+ 400: unknown;
8856
+ /**
8857
+ * Life event not found
8858
+ */
8859
+ 404: unknown;
8860
+ /**
8861
+ * Updated event conflicts with an existing (userId, type, date) combination
8862
+ */
8863
+ 409: unknown;
8864
+ /**
8865
+ * If-Match precondition failed (updatedAt mismatch)
8866
+ */
8867
+ 412: unknown;
8868
+ };
8869
+ };
8870
+ delete: {
8871
+ req: EventControllerDeleteData;
8872
+ res: {
8873
+ /**
8874
+ * Life event deleted successfully
8875
+ */
8876
+ 204: void;
8877
+ /**
8878
+ * Life event not found
8879
+ */
8880
+ 404: unknown;
8881
+ };
8882
+ };
8883
+ };
8884
+ '/api/v1/{region}/bean/events/{id}/slice': {
8885
+ get: {
8886
+ req: EventControllerGetSliceData;
8887
+ res: {
8888
+ /**
8889
+ * Time-series sliced by the life event range
8890
+ */
8891
+ 200: unknown;
8892
+ /**
8893
+ * accountPattern query param is empty
8894
+ */
8895
+ 400: unknown;
8896
+ /**
8897
+ * Life event not found
8898
+ */
8899
+ 404: unknown;
8900
+ };
8901
+ };
8902
+ };
8903
+ '/api/v1/{region}/bean/onboarding': {
8904
+ post: {
8905
+ req: OnboardingControllerBootstrapData;
8906
+ res: {
8907
+ /**
8908
+ * Onboarding bootstrap result.
8909
+ */
8910
+ 201: unknown;
8911
+ /**
8912
+ * Invalid region/account path/duplicate paths.
8913
+ */
8914
+ 422: unknown;
8915
+ };
8916
+ };
8917
+ };
8918
+ '/api/v1/{region}/bean/reconciliations': {
8919
+ post: {
8920
+ req: ReconciliationControllerComputeData;
8921
+ res: {
8922
+ /**
8923
+ * Reconciliation preview
8924
+ */
8925
+ 200: ReconciliationComputeResultDto;
8926
+ /**
8927
+ * Account not found
8928
+ */
8929
+ 404: unknown;
8930
+ };
8931
+ };
8932
+ };
8933
+ '/api/v1/{region}/bean/reconciliations/assert': {
8934
+ post: {
8935
+ req: ReconciliationControllerAssertData;
8936
+ res: {
8937
+ /**
8938
+ * Balance assertion recorded
7324
8939
  */
7325
- 403: unknown;
8940
+ 201: ReconciliationRecordDto;
7326
8941
  /**
7327
- * Property not found
8942
+ * Account not found
7328
8943
  */
7329
8944
  404: unknown;
7330
8945
  };
7331
8946
  };
7332
- put: {
7333
- req: PropertyControllerUpdateData;
8947
+ };
8948
+ '/api/v1/{region}/bean/reconciliations/pad': {
8949
+ post: {
8950
+ req: ReconciliationControllerPadData;
7334
8951
  res: {
7335
8952
  /**
7336
- * Property updated successfully
8953
+ * Pad adjusting entry generated
7337
8954
  */
7338
- 200: unknown;
8955
+ 201: PadResultDto;
7339
8956
  /**
7340
- * Unauthorized
8957
+ * Book already within tolerance — no pad needed
7341
8958
  */
7342
- 401: unknown;
8959
+ 400: unknown;
7343
8960
  /**
7344
- * Forbidden - insufficient permissions
8961
+ * Account not found
7345
8962
  */
7346
- 403: unknown;
8963
+ 404: unknown;
7347
8964
  };
7348
8965
  };
7349
- delete: {
7350
- req: PropertyControllerDeleteData;
8966
+ };
8967
+ '/api/v1/{region}/bean/accounts/{accountId}/reconciliations': {
8968
+ get: {
8969
+ req: ReconciliationControllerHistoryData;
7351
8970
  res: {
7352
8971
  /**
7353
- * Property deleted successfully
7354
- */
7355
- 204: void;
7356
- /**
7357
- * Unauthorized
7358
- */
7359
- 401: unknown;
7360
- /**
7361
- * Forbidden - insufficient permissions
8972
+ * Reconciliation history
7362
8973
  */
7363
- 403: unknown;
8974
+ 200: Array<ReconciliationRecordDto>;
7364
8975
  /**
7365
- * Property not found
8976
+ * Account not found
7366
8977
  */
7367
8978
  404: unknown;
7368
8979
  };
@@ -7518,143 +9129,145 @@ export type $OpenApiTs = {
7518
9129
  };
7519
9130
  };
7520
9131
  };
7521
- '/api/v1/bean/platforms': {
7522
- get: {
9132
+ '/api/v1/{region}/bean/import/provider/{providerName}/sync': {
9133
+ post: {
9134
+ req: ProviderSyncControllerSyncData;
7523
9135
  res: {
7524
9136
  /**
7525
- * List of platforms with binding and account counts
9137
+ * Sync completed successfully
7526
9138
  */
7527
- 200: unknown;
7528
- };
7529
- };
7530
- post: {
7531
- req: PlatformControllerCreateData;
7532
- res: {
9139
+ 200: ProviderSyncResponseDto;
7533
9140
  /**
7534
- * Platform created successfully
9141
+ * Invalid request data
7535
9142
  */
7536
- 201: unknown;
9143
+ 400: unknown;
7537
9144
  /**
7538
- * Platform already exists
9145
+ * Missing or invalid authentication
7539
9146
  */
7540
- 409: unknown;
9147
+ 401: unknown;
9148
+ /**
9149
+ * Provider not supported
9150
+ */
9151
+ 404: unknown;
7541
9152
  };
7542
9153
  };
7543
9154
  };
7544
- '/api/v1/bean/platforms/list': {
9155
+ '/api/v1/{region}/bean/import/provider/supported': {
7545
9156
  get: {
9157
+ req: ProviderSyncControllerGetSupportedProvidersData;
7546
9158
  res: {
7547
9159
  /**
7548
- * List of platforms with user binding status
9160
+ * List of supported providers
7549
9161
  */
7550
- 200: unknown;
9162
+ 200: SupportedProvidersResponseDto;
9163
+ /**
9164
+ * Missing or invalid authentication
9165
+ */
9166
+ 401: unknown;
7551
9167
  };
7552
9168
  };
7553
9169
  };
7554
- '/api/v1/bean/platforms/match': {
9170
+ '/api/v1/{region}/bean/import/provider/{providerName}/supported': {
7555
9171
  get: {
7556
- req: PlatformControllerMatchPlatformsData;
9172
+ req: ProviderSyncControllerIsProviderSupportedData;
7557
9173
  res: {
7558
9174
  /**
7559
- * List of matching platforms with suggested segment names
9175
+ * Provider support status
7560
9176
  */
7561
9177
  200: unknown;
9178
+ /**
9179
+ * Missing or invalid authentication
9180
+ */
9181
+ 401: unknown;
7562
9182
  };
7563
9183
  };
7564
9184
  };
7565
- '/api/v1/bean/platforms/{id}': {
7566
- put: {
7567
- req: PlatformControllerUpdateData;
9185
+ '/api/v1/{region}/bean/external-account-links': {
9186
+ post: {
9187
+ req: ExternalAccountLinkControllerCreateData;
7568
9188
  res: {
7569
9189
  /**
7570
- * Platform updated successfully
9190
+ * Link created.
7571
9191
  */
7572
- 200: unknown;
9192
+ 201: ExternalAccountLinkResponseDto;
7573
9193
  /**
7574
- * Platform not found
9194
+ * beanAccountId not owned, or an active link already exists.
7575
9195
  */
7576
- 404: unknown;
9196
+ 422: unknown;
7577
9197
  };
7578
9198
  };
7579
- delete: {
7580
- req: PlatformControllerDeleteData;
9199
+ get: {
9200
+ req: ExternalAccountLinkControllerFindAllData;
7581
9201
  res: {
7582
9202
  /**
7583
- * Platform deleted successfully
7584
- */
7585
- 204: void;
7586
- /**
7587
- * Platform not found
9203
+ * Links retrieved.
7588
9204
  */
7589
- 404: unknown;
9205
+ 200: ExternalAccountLinkListResponseDto;
7590
9206
  };
7591
9207
  };
7592
9208
  };
7593
- '/api/v1/{region}/bean/import/provider/{providerName}/sync': {
7594
- post: {
7595
- req: ProviderSyncControllerSyncData;
9209
+ '/api/v1/{region}/bean/external-account-links/{id}': {
9210
+ get: {
9211
+ req: ExternalAccountLinkControllerFindOneData;
7596
9212
  res: {
7597
9213
  /**
7598
- * Sync completed successfully
7599
- */
7600
- 200: ProviderSyncResponseDto;
7601
- /**
7602
- * Invalid request data
9214
+ * Link retrieved.
7603
9215
  */
7604
- 400: unknown;
9216
+ 200: ExternalAccountLinkResponseDto;
7605
9217
  /**
7606
- * Missing or invalid authentication
9218
+ * Link not found or not owned by the user.
7607
9219
  */
7608
- 401: unknown;
9220
+ 422: unknown;
9221
+ };
9222
+ };
9223
+ delete: {
9224
+ req: ExternalAccountLinkControllerRemoveData;
9225
+ res: {
7609
9226
  /**
7610
- * Provider not supported
9227
+ * Link soft-deleted; historical transactions are unaffected.
7611
9228
  */
7612
- 404: unknown;
9229
+ 204: void;
7613
9230
  };
7614
9231
  };
7615
9232
  };
7616
- '/api/v1/{region}/bean/import/provider/supported': {
7617
- get: {
7618
- req: ProviderSyncControllerGetSupportedProvidersData;
9233
+ '/api/v1/{region}/bean/import/parser-telemetry': {
9234
+ post: {
9235
+ req: TelemetryControllerReportTelemetryData;
7619
9236
  res: {
7620
9237
  /**
7621
- * List of supported providers
9238
+ * Telemetry report received
7622
9239
  */
7623
- 200: SupportedProvidersResponseDto;
9240
+ 200: unknown;
7624
9241
  /**
7625
- * Missing or invalid authentication
9242
+ * Unauthorized
7626
9243
  */
7627
9244
  401: unknown;
7628
9245
  };
7629
9246
  };
7630
9247
  };
7631
- '/api/v1/{region}/bean/import/provider/{providerName}/supported': {
7632
- get: {
7633
- req: ProviderSyncControllerIsProviderSupportedData;
9248
+ '/api/v1/{region}/bean/import/parser-coverage-miss': {
9249
+ post: {
9250
+ req: TelemetryControllerReportCoverageMissData;
7634
9251
  res: {
7635
9252
  /**
7636
- * Provider support status
9253
+ * Coverage miss report received
7637
9254
  */
7638
9255
  200: unknown;
7639
9256
  /**
7640
- * Missing or invalid authentication
9257
+ * Unauthorized
7641
9258
  */
7642
9259
  401: unknown;
7643
9260
  };
7644
9261
  };
7645
9262
  };
7646
- '/api/v1/{region}/bean/import/parser-telemetry': {
7647
- post: {
7648
- req: TelemetryControllerReportTelemetryData;
9263
+ '/api/v1/{region}/bean/import/parser-coverage-metrics': {
9264
+ get: {
9265
+ req: TelemetryControllerGetCoverageMetricsData;
7649
9266
  res: {
7650
9267
  /**
7651
- * Telemetry report received
9268
+ * Coverage metrics
7652
9269
  */
7653
9270
  200: unknown;
7654
- /**
7655
- * Unauthorized
7656
- */
7657
- 401: unknown;
7658
9271
  };
7659
9272
  };
7660
9273
  };
@@ -7705,6 +9318,78 @@ export type $OpenApiTs = {
7705
9318
  };
7706
9319
  };
7707
9320
  };
9321
+ '/api/v1/bean/platforms': {
9322
+ get: {
9323
+ res: {
9324
+ /**
9325
+ * List of platforms with binding and account counts
9326
+ */
9327
+ 200: unknown;
9328
+ };
9329
+ };
9330
+ post: {
9331
+ req: PlatformControllerCreateData;
9332
+ res: {
9333
+ /**
9334
+ * Platform created successfully
9335
+ */
9336
+ 201: unknown;
9337
+ /**
9338
+ * Platform already exists
9339
+ */
9340
+ 409: unknown;
9341
+ };
9342
+ };
9343
+ };
9344
+ '/api/v1/bean/platforms/list': {
9345
+ get: {
9346
+ res: {
9347
+ /**
9348
+ * List of platforms with user binding status
9349
+ */
9350
+ 200: unknown;
9351
+ };
9352
+ };
9353
+ };
9354
+ '/api/v1/bean/platforms/match': {
9355
+ get: {
9356
+ req: PlatformControllerMatchPlatformsData;
9357
+ res: {
9358
+ /**
9359
+ * List of matching platforms with suggested segment names
9360
+ */
9361
+ 200: unknown;
9362
+ };
9363
+ };
9364
+ };
9365
+ '/api/v1/bean/platforms/{id}': {
9366
+ put: {
9367
+ req: PlatformControllerUpdateData;
9368
+ res: {
9369
+ /**
9370
+ * Platform updated successfully
9371
+ */
9372
+ 200: unknown;
9373
+ /**
9374
+ * Platform not found
9375
+ */
9376
+ 404: unknown;
9377
+ };
9378
+ };
9379
+ delete: {
9380
+ req: PlatformControllerDeleteData;
9381
+ res: {
9382
+ /**
9383
+ * Platform deleted successfully
9384
+ */
9385
+ 204: void;
9386
+ /**
9387
+ * Platform not found
9388
+ */
9389
+ 404: unknown;
9390
+ };
9391
+ };
9392
+ };
7708
9393
  '/api/v1/{region}/dashboard/net-worth': {
7709
9394
  get: {
7710
9395
  req: DashboardControllerGetNetWorthData;
@@ -7727,7 +9412,10 @@ export type $OpenApiTs = {
7727
9412
  /**
7728
9413
  * Accounts retrieved successfully. Response type depends on groupBy parameter.
7729
9414
  */
7730
- 200: AccountsResponseDto | AssetClassAccountsResponseDto;
9415
+ 200:
9416
+ | AccountsResponseDto
9417
+ | AssetClassAccountsResponseDto
9418
+ | HoldingAssetClassCrossAccountResponseDto;
7731
9419
  /**
7732
9420
  * User not authenticated
7733
9421
  */
@@ -7754,6 +9442,44 @@ export type $OpenApiTs = {
7754
9442
  };
7755
9443
  };
7756
9444
  };
9445
+ '/api/v1/{region}/dashboard/expenses': {
9446
+ get: {
9447
+ req: DashboardControllerGetExpensesData;
9448
+ res: {
9449
+ /**
9450
+ * Expenses retrieved successfully
9451
+ */
9452
+ 200: ExpensesByCategoryResponseDto;
9453
+ /**
9454
+ * Invalid groupBy or period
9455
+ */
9456
+ 400: unknown;
9457
+ /**
9458
+ * User not authenticated
9459
+ */
9460
+ 401: unknown;
9461
+ };
9462
+ };
9463
+ };
9464
+ '/api/v1/{region}/investment/holdings/pnl': {
9465
+ get: {
9466
+ req: HoldingPnlControllerGetHoldingPnlData;
9467
+ res: {
9468
+ /**
9469
+ * Holding P&L retrieved successfully
9470
+ */
9471
+ 200: HoldingPnlResponseDto;
9472
+ /**
9473
+ * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
9474
+ */
9475
+ 400: unknown;
9476
+ /**
9477
+ * User not authenticated
9478
+ */
9479
+ 401: unknown;
9480
+ };
9481
+ };
9482
+ };
7757
9483
  '/api/v1/{region}/reporting/portfolio/trends': {
7758
9484
  get: {
7759
9485
  req: ReportingControllerGetPortfolioTrendsData;
@@ -7769,6 +9495,21 @@ export type $OpenApiTs = {
7769
9495
  };
7770
9496
  };
7771
9497
  };
9498
+ '/api/v1/{region}/reporting/cash-flow/trends': {
9499
+ get: {
9500
+ req: ReportingControllerGetCashFlowTrendsData;
9501
+ res: {
9502
+ /**
9503
+ * Cash-flow trends retrieved successfully
9504
+ */
9505
+ 200: CashFlowTrendsResponseDto;
9506
+ /**
9507
+ * User not authenticated
9508
+ */
9509
+ 401: unknown;
9510
+ };
9511
+ };
9512
+ };
7772
9513
  '/api/v1/{region}/reporting/snapshots/generate': {
7773
9514
  post: {
7774
9515
  req: ReportingControllerGenerateSnapshotData;