@firela/api-types 0.0.0-canary.2b7765ff → 0.0.0-canary.2d71872c

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
  */
@@ -442,6 +436,25 @@ export type CreateTransactionDto = {
442
436
  */
443
437
  export type flag = '*' | '!';
444
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
+
445
458
  export type PostingResponseDto = {
446
459
  /**
447
460
  * Account name
@@ -455,6 +468,10 @@ export type PostingResponseDto = {
455
468
  * Currency
456
469
  */
457
470
  currency?: string;
471
+ /**
472
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
473
+ */
474
+ cost?: CostDetailDto;
458
475
  };
459
476
 
460
477
  export type RecurringSuggestionDto = {
@@ -698,6 +715,10 @@ export type PostingDetailDto = {
698
715
  * Cost date
699
716
  */
700
717
  costDate?: string;
718
+ /**
719
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
720
+ */
721
+ cost?: CostDetailDto;
701
722
  /**
702
723
  * Price amount
703
724
  */
@@ -821,6 +842,51 @@ export type flag2 =
821
842
  */
822
843
  export type status2 = 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
823
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
+
824
890
  export type TransactionListResponseDto = {
825
891
  /**
826
892
  * List of transactions
@@ -838,6 +904,10 @@ export type TransactionListResponseDto = {
838
904
  * Number of items skipped
839
905
  */
840
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;
841
911
  };
842
912
 
843
913
  export type TagSuggestionDto = {
@@ -1297,17 +1367,17 @@ export type ResolveResultDto = {
1297
1367
  [key: string]: string;
1298
1368
  };
1299
1369
  /**
1300
- * Resolution ID for undo
1370
+ * Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).
1301
1371
  */
1302
- resolutionId: string;
1372
+ resolutionId?: string;
1303
1373
  /**
1304
1374
  * Whether this decision can be undone
1305
1375
  */
1306
- canUndo: boolean;
1376
+ canUndo?: boolean;
1307
1377
  /**
1308
1378
  * Deadline for undo (24h from resolution)
1309
1379
  */
1310
- undoDeadline: string;
1380
+ undoDeadline?: string;
1311
1381
  /**
1312
1382
  * Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.
1313
1383
  */
@@ -1890,6 +1960,108 @@ export type UpdateCommodityDto = {
1890
1960
  };
1891
1961
  };
1892
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
+
1893
2065
  export type CreateRecurringRuleDto = {
1894
2066
  /**
1895
2067
  * Rule name (unique per user)
@@ -3002,63 +3174,307 @@ export type UpdatePropertyDto = {
3002
3174
  value: string;
3003
3175
  };
3004
3176
 
3005
- export type FileImportDto = {
3177
+ export type CreateBeanEventDto = {
3006
3178
  /**
3007
- * Bill file to import (CSV, PDF, OFX, etc.)
3179
+ * Life event date (ISO 8601)
3008
3180
  */
3009
- file: Blob | File;
3010
- };
3011
-
3012
- export type ImportErrorDto = {
3181
+ date: string;
3013
3182
  /**
3014
- * 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
3015
3184
  */
3016
- index: number;
3185
+ type: string;
3017
3186
  /**
3018
- * Error message
3187
+ * Life event description. Empty string is a VALID value (distinct from absence).
3019
3188
  */
3020
- 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
+ };
3021
3196
  };
3022
3197
 
3023
- export type ReviewItemPreviewDto = {
3198
+ export type EventResponseDto = {
3024
3199
  /**
3025
- * Index in the import batch (for tracking)
3200
+ * Unique identifier
3026
3201
  */
3027
- index: number;
3202
+ id: string;
3028
3203
  /**
3029
- * Transaction date (ISO format)
3204
+ * User ID (owner of the life event)
3205
+ */
3206
+ userId: string;
3207
+ /**
3208
+ * Life event date (ISO 8601 format)
3030
3209
  */
3031
3210
  date: string;
3032
3211
  /**
3033
- * Transaction amount (absolute value)
3212
+ * Life event type (user-defined, e.g., "employer", "location")
3034
3213
  */
3035
- amount?: number;
3214
+ type: string;
3036
3215
  /**
3037
- * Currency code
3216
+ * Life event description. May be an empty string (a valid value distinct from absence).
3038
3217
  */
3039
- currency?: string;
3218
+ description: string;
3040
3219
  /**
3041
- * Transaction narration/description
3220
+ * Product-side metadata (free-form JSON)
3042
3221
  */
3043
- narration: string;
3222
+ meta: {
3223
+ [key: string]: unknown;
3224
+ };
3044
3225
  /**
3045
- * Payee name
3226
+ * Creation timestamp
3046
3227
  */
3047
- payee?: string;
3228
+ createdAt: string;
3048
3229
  /**
3049
- * Inferred category from rule matching
3230
+ * Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.
3050
3231
  */
3051
- category?: string;
3232
+ updatedAt: string;
3233
+ };
3234
+
3235
+ export type EventListResponseDto = {
3052
3236
  /**
3053
- * Confidence score for the match (0-1)
3237
+ * List of life events
3054
3238
  */
3055
- confidence?: number;
3239
+ items: Array<EventResponseDto>;
3056
3240
  /**
3057
- * Type of branch requiring review
3241
+ * Total number of life events matching the query
3058
3242
  */
3059
- branchType?:
3060
- | 'DUPLICATE'
3061
- | 'PAYEE_MATCH'
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;
3472
+ /**
3473
+ * Type of branch requiring review
3474
+ */
3475
+ branchType?:
3476
+ | 'DUPLICATE'
3477
+ | 'PAYEE_MATCH'
3062
3478
  | 'RULE_MATCH'
3063
3479
  | 'ACCOUNT_VALIDATION'
3064
3480
  | 'PIPELINE_ERROR';
@@ -3300,168 +3716,139 @@ export type UpdateImporterConfigDto = {
3300
3716
  data?: UpdateConfigDataDto;
3301
3717
  };
3302
3718
 
3303
- export type CreatePlatformDto = {
3304
- /**
3305
- * Platform name
3306
- */
3307
- name: string;
3719
+ export type ProviderSyncConfigDto = {
3308
3720
  /**
3309
- * Platform canonical identifier (lowercase, kebab-case)
3721
+ * Source account for the first posting
3310
3722
  */
3311
- canonical: string;
3723
+ sourceAccount: string;
3312
3724
  /**
3313
- * Platform aliases (multi-language names for lookup)
3725
+ * Default currency for transactions
3314
3726
  */
3315
- aliases: Array<string>;
3727
+ defaultCurrency: string;
3316
3728
  /**
3317
- * Platform URL
3729
+ * Default expense account for the second posting
3318
3730
  */
3319
- url: string;
3731
+ defaultExpenseAccount: string;
3320
3732
  /**
3321
- * Platform type
3733
+ * Default income account for the second posting
3322
3734
  */
3323
- type:
3324
- | 'BANK'
3325
- | 'BROKERAGE'
3326
- | 'CRYPTO_EXCHANGE'
3327
- | 'PAYMENT'
3328
- | 'INVESTMENT'
3329
- | 'INSURANCE'
3330
- | 'OTHER';
3735
+ defaultIncomeAccount: string;
3331
3736
  /**
3332
- * Platform logo URL
3737
+ * Filter pending transactions
3333
3738
  */
3334
- logoUrl?: string;
3739
+ filterPending?: boolean;
3335
3740
  /**
3336
- * Whether the platform is active
3741
+ * External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.
3337
3742
  */
3338
- isActive?: boolean;
3743
+ externalAccountId?: string;
3339
3744
  };
3340
3745
 
3341
- /**
3342
- * Platform type
3343
- */
3344
- export type type3 =
3345
- | 'BANK'
3346
- | 'BROKERAGE'
3347
- | 'CRYPTO_EXCHANGE'
3348
- | 'PAYMENT'
3349
- | 'INVESTMENT'
3350
- | 'INSURANCE'
3351
- | 'OTHER';
3352
-
3353
- export type UpdatePlatformDto = {
3746
+ export type ProviderSyncDto = {
3354
3747
  /**
3355
- * Platform name
3748
+ * Provider name (already in URL path, optional here for reference)
3356
3749
  */
3357
- name?: string;
3750
+ provider?: string;
3358
3751
  /**
3359
- * Platform canonical identifier (lowercase, kebab-case)
3752
+ * Unique sync identifier for idempotency
3360
3753
  */
3361
- canonical?: string;
3754
+ syncId?: string;
3362
3755
  /**
3363
- * Platform aliases (multi-language names for lookup)
3756
+ * Provider sync configuration
3364
3757
  */
3365
- aliases?: Array<string>;
3758
+ config: ProviderSyncConfigDto;
3366
3759
  /**
3367
- * Platform URL
3760
+ * Raw transactions from provider
3368
3761
  */
3369
- url?: string;
3762
+ transactions: unknown[];
3763
+ };
3764
+
3765
+ export type ProviderSyncResponseDto = {
3370
3766
  /**
3371
- * Platform type
3767
+ * Number of transactions successfully imported
3372
3768
  */
3373
- type?:
3374
- | 'BANK'
3375
- | 'BROKERAGE'
3376
- | 'CRYPTO_EXCHANGE'
3377
- | 'PAYMENT'
3378
- | 'INVESTMENT'
3379
- | 'INSURANCE'
3380
- | 'OTHER';
3769
+ imported: number;
3381
3770
  /**
3382
- * Platform logo URL
3771
+ * Number of transactions skipped (duplicates)
3383
3772
  */
3384
- logoUrl?: string;
3773
+ skipped: number;
3385
3774
  /**
3386
- * Whether the platform is active
3387
- */
3388
- isActive?: boolean;
3389
- };
3390
-
3391
- export type ProviderSyncConfigDto = {
3392
- /**
3393
- * Source account for the first posting
3394
- */
3395
- sourceAccount: string;
3396
- /**
3397
- * Default currency for transactions
3775
+ * Number of transactions pending review
3398
3776
  */
3399
- defaultCurrency: string;
3777
+ pendingReview: number;
3400
3778
  /**
3401
- * Default expense account for the second posting
3779
+ * Number of transactions that failed to import
3402
3780
  */
3403
- defaultExpenseAccount: string;
3781
+ failed: number;
3404
3782
  /**
3405
- * Default income account for the second posting
3783
+ * IDs of successfully imported transactions
3406
3784
  */
3407
- defaultIncomeAccount: string;
3785
+ importedTransactionIds?: Array<string>;
3408
3786
  /**
3409
- * Filter pending transactions
3787
+ * IDs of review items created for branched transactions
3410
3788
  */
3411
- filterPending?: boolean;
3789
+ reviewItemIds?: Array<string>;
3412
3790
  };
3413
3791
 
3414
- export type ProviderSyncDto = {
3415
- /**
3416
- * Provider name (already in URL path, optional here for reference)
3417
- */
3418
- provider?: string;
3419
- /**
3420
- * Unique sync identifier for idempotency
3421
- */
3422
- syncId?: string;
3423
- /**
3424
- * Provider sync configuration
3425
- */
3426
- config: ProviderSyncConfigDto;
3792
+ export type SupportedProvidersResponseDto = {
3427
3793
  /**
3428
- * Raw transactions from provider
3794
+ * List of supported provider names
3429
3795
  */
3430
- transactions: unknown[];
3796
+ providers: Array<string>;
3431
3797
  };
3432
3798
 
3433
- export type ProviderSyncResponseDto = {
3434
- /**
3435
- * Number of transactions successfully imported
3436
- */
3437
- imported: number;
3438
- /**
3439
- * Number of transactions skipped (duplicates)
3440
- */
3441
- skipped: number;
3442
- /**
3443
- * Number of transactions pending review
3444
- */
3445
- pendingReview: number;
3799
+ export type CreateExternalAccountLinkDto = {
3446
3800
  /**
3447
- * Number of transactions that failed to import
3801
+ * Open Banking provider (whitelist)
3448
3802
  */
3449
- failed: number;
3803
+ provider:
3804
+ | 'plaid'
3805
+ | 'teller'
3806
+ | 'truelayer'
3807
+ | 'gocardless'
3808
+ | 'simplefin'
3809
+ | 'yodlee'
3810
+ | 'beancount-direct'
3811
+ | 'parsed-bill';
3450
3812
  /**
3451
- * IDs of successfully imported transactions
3813
+ * External account ID from the provider
3452
3814
  */
3453
- importedTransactionIds?: Array<string>;
3815
+ externalAccountId: string;
3454
3816
  /**
3455
- * IDs of review items created for branched transactions
3817
+ * Target BeanAccount ID (must belong to the JWT user)
3456
3818
  */
3457
- reviewItemIds?: Array<string>;
3819
+ beanAccountId: string;
3458
3820
  };
3459
3821
 
3460
- 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;
3461
3848
  /**
3462
- * List of supported provider names
3849
+ * Filter by provider (query param)
3463
3850
  */
3464
- providers: Array<string>;
3851
+ provider?: string;
3465
3852
  };
3466
3853
 
3467
3854
  export type ParserTelemetryReportDto = unknown;
@@ -4043,15 +4430,134 @@ export type liabilitySubType = 'borrow' | 'repay';
4043
4430
  */
4044
4431
  export type equitySubType = 'opening' | 'adjustment';
4045
4432
 
4046
- export type BalanceByCurrencyDto = {
4433
+ export type PlatformListItemDto = {
4047
4434
  /**
4048
- * ISO 4217 currency code
4435
+ * Global platform ID
4049
4436
  */
4050
- currency: string;
4437
+ id: string;
4051
4438
  /**
4052
- * Balance amount
4439
+ * Platform name
4053
4440
  */
4054
- balance: string;
4441
+ name: string;
4442
+ /**
4443
+ * Platform URL
4444
+ */
4445
+ url: string;
4446
+ /**
4447
+ * Platform type
4448
+ */
4449
+ type:
4450
+ | 'BANK'
4451
+ | 'BROKERAGE'
4452
+ | 'CRYPTO_EXCHANGE'
4453
+ | 'PAYMENT'
4454
+ | 'INVESTMENT'
4455
+ | 'INSURANCE'
4456
+ | 'OTHER';
4457
+ /**
4458
+ * Canonical identifier in ACCOUNT_RE format (e.g., "icbc")
4459
+ */
4460
+ canonical: string;
4461
+ /**
4462
+ * Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)
4463
+ */
4464
+ suggestedSegment: string;
4465
+ /**
4466
+ * Logo URL
4467
+ */
4468
+ logoUrl: string | null;
4469
+ /**
4470
+ * Whether user has accounts using this platform
4471
+ */
4472
+ isBound: boolean;
4473
+ };
4474
+
4475
+ /**
4476
+ * Platform type
4477
+ */
4478
+ export type type3 =
4479
+ | 'BANK'
4480
+ | 'BROKERAGE'
4481
+ | 'CRYPTO_EXCHANGE'
4482
+ | 'PAYMENT'
4483
+ | 'INVESTMENT'
4484
+ | 'INSURANCE'
4485
+ | 'OTHER';
4486
+
4487
+ export type CreatePlatformDto = {
4488
+ /**
4489
+ * Platform name
4490
+ */
4491
+ name: string;
4492
+ /**
4493
+ * Platform canonical identifier (lowercase, kebab-case)
4494
+ */
4495
+ canonical: string;
4496
+ /**
4497
+ * Platform aliases (multi-language names for lookup)
4498
+ */
4499
+ aliases: Array<string>;
4500
+ /**
4501
+ * Platform URL
4502
+ */
4503
+ url: string;
4504
+ /**
4505
+ * Platform type
4506
+ */
4507
+ type:
4508
+ | 'BANK'
4509
+ | 'BROKERAGE'
4510
+ | 'CRYPTO_EXCHANGE'
4511
+ | 'PAYMENT'
4512
+ | 'INVESTMENT'
4513
+ | 'INSURANCE'
4514
+ | 'OTHER';
4515
+ /**
4516
+ * Platform logo URL
4517
+ */
4518
+ logoUrl?: string;
4519
+ /**
4520
+ * Whether the platform is active
4521
+ */
4522
+ isActive?: boolean;
4523
+ };
4524
+
4525
+ export type UpdatePlatformDto = {
4526
+ /**
4527
+ * Platform name
4528
+ */
4529
+ name?: string;
4530
+ /**
4531
+ * Platform canonical identifier (lowercase, kebab-case)
4532
+ */
4533
+ canonical?: string;
4534
+ /**
4535
+ * Platform aliases (multi-language names for lookup)
4536
+ */
4537
+ aliases?: Array<string>;
4538
+ /**
4539
+ * Platform URL
4540
+ */
4541
+ url?: string;
4542
+ /**
4543
+ * Platform type
4544
+ */
4545
+ type?:
4546
+ | 'BANK'
4547
+ | 'BROKERAGE'
4548
+ | 'CRYPTO_EXCHANGE'
4549
+ | 'PAYMENT'
4550
+ | 'INVESTMENT'
4551
+ | 'INSURANCE'
4552
+ | 'OTHER';
4553
+ /**
4554
+ * Platform logo URL
4555
+ */
4556
+ logoUrl?: string;
4557
+ /**
4558
+ * Whether the platform is active
4559
+ */
4560
+ isActive?: boolean;
4055
4561
  };
4056
4562
 
4057
4563
  export type NetWorthByCurrencyDto = {
@@ -4094,21 +4600,6 @@ export type ConvertedNetWorthDto = {
4094
4600
  };
4095
4601
  };
4096
4602
 
4097
- export type ExchangeRateWarningDto = {
4098
- /**
4099
- * Warning type
4100
- */
4101
- type: string;
4102
- /**
4103
- * Currency without exchange rate
4104
- */
4105
- currency: string;
4106
- /**
4107
- * Total amount affected
4108
- */
4109
- totalAmount: string;
4110
- };
4111
-
4112
4603
  export type NetWorthResponseDto = {
4113
4604
  /**
4114
4605
  * Total net worth (assets - liabilities, converted to base currency)
@@ -4173,6 +4664,10 @@ export type AccountItemDto = {
4173
4664
  * Currency code
4174
4665
  */
4175
4666
  currency: string;
4667
+ /**
4668
+ * FX-converted balance in base currency; omitted when not convertible
4669
+ */
4670
+ convertedBalance?: string;
4176
4671
  };
4177
4672
 
4178
4673
  export type PlatformGroupDto = {
@@ -4189,46 +4684,85 @@ export type PlatformGroupDto = {
4189
4684
  */
4190
4685
  accounts: Array<AccountItemDto>;
4191
4686
  /**
4192
- * Total balance across all accounts in platform
4687
+ * FX-converted total balance in base currency
4193
4688
  */
4194
4689
  totalBalance: string;
4195
- };
4196
-
4197
- export type AccountsSummaryDto = {
4198
- /**
4199
- * Total number of accounts
4200
- */
4201
- totalAccounts: number;
4202
4690
  /**
4203
- * Total number of platforms
4691
+ * Raw (unconverted) balances grouped by currency
4204
4692
  */
4205
- totalPlatforms: number;
4206
- };
4207
-
4208
- export type AccountsResponseDto = {
4693
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
4209
4694
  /**
4210
- * Account groups by platform
4695
+ * Converted balance in base currency (omitted when no currency is convertible)
4211
4696
  */
4212
- groups: Array<PlatformGroupDto>;
4697
+ convertedBalance?: string;
4213
4698
  /**
4214
- * Summary statistics
4699
+ * Share of the grand converted total (0-100); 0 when grand total is 0
4215
4700
  */
4216
- summary: AccountsSummaryDto;
4701
+ sharePct: number;
4217
4702
  };
4218
4703
 
4219
- export type AccountItemWithAssetClassDto = {
4704
+ export type AccountExchangeRateWarningDto = {
4220
4705
  /**
4221
- * Account ID
4706
+ * Warning type
4222
4707
  */
4223
- id: string;
4708
+ type: string;
4224
4709
  /**
4225
- * Full account name
4710
+ * Currency without exchange rate
4226
4711
  */
4227
- name: string;
4712
+ currency: string;
4228
4713
  /**
4229
- * Display name (last part of account path)
4714
+ * Affected account paths
4230
4715
  */
4231
- displayName: string;
4716
+ accounts: Array<string>;
4717
+ /**
4718
+ * Total amount in this currency
4719
+ */
4720
+ totalAmount: string;
4721
+ };
4722
+
4723
+ export type AccountsSummaryDto = {
4724
+ /**
4725
+ * Total number of accounts
4726
+ */
4727
+ totalAccounts: number;
4728
+ /**
4729
+ * Total number of platforms
4730
+ */
4731
+ totalPlatforms: number;
4732
+ /**
4733
+ * Base currency for conversion
4734
+ */
4735
+ baseCurrency: string;
4736
+ /**
4737
+ * Per-account exchange rate warnings
4738
+ */
4739
+ warnings?: Array<AccountExchangeRateWarningDto>;
4740
+ };
4741
+
4742
+ export type AccountsResponseDto = {
4743
+ /**
4744
+ * Account groups by platform
4745
+ */
4746
+ groups: Array<PlatformGroupDto>;
4747
+ /**
4748
+ * Summary statistics
4749
+ */
4750
+ summary: AccountsSummaryDto;
4751
+ };
4752
+
4753
+ export type AccountItemWithAssetClassDto = {
4754
+ /**
4755
+ * Account ID
4756
+ */
4757
+ id: string;
4758
+ /**
4759
+ * Full account name
4760
+ */
4761
+ name: string;
4762
+ /**
4763
+ * Display name (last part of account path)
4764
+ */
4765
+ displayName: string;
4232
4766
  /**
4233
4767
  * Account balance
4234
4768
  */
@@ -4237,6 +4771,10 @@ export type AccountItemWithAssetClassDto = {
4237
4771
  * Currency code
4238
4772
  */
4239
4773
  currency: string;
4774
+ /**
4775
+ * FX-converted balance in base currency; omitted when not convertible
4776
+ */
4777
+ convertedBalance?: string;
4240
4778
  /**
4241
4779
  * Asset class
4242
4780
  */
@@ -4318,25 +4856,6 @@ export type assetClass =
4318
4856
  | 'REAL_ESTATE'
4319
4857
  | 'INDEX';
4320
4858
 
4321
- export type AccountExchangeRateWarningDto = {
4322
- /**
4323
- * Warning type
4324
- */
4325
- type: string;
4326
- /**
4327
- * Currency without exchange rate
4328
- */
4329
- currency: string;
4330
- /**
4331
- * Affected account paths
4332
- */
4333
- accounts: Array<string>;
4334
- /**
4335
- * Total amount in this currency
4336
- */
4337
- totalAmount: string;
4338
- };
4339
-
4340
4859
  export type AssetClassSummaryDto = {
4341
4860
  /**
4342
4861
  * Total number of accounts
@@ -4502,6 +5021,63 @@ export type CashFlowResponseDto = {
4502
5021
  warnings?: Array<ExchangeRateWarningDto>;
4503
5022
  };
4504
5023
 
5024
+ export type CategoryGroupDto = {
5025
+ /**
5026
+ * Functional category (account-path Group segment); regional and universal account paths merge under it
5027
+ */
5028
+ category: string;
5029
+ /**
5030
+ * Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)
5031
+ */
5032
+ totalExpense: string;
5033
+ /**
5034
+ * Share of grand total (0-100); 0 when grand total is 0
5035
+ */
5036
+ sharePct: number;
5037
+ /**
5038
+ * Raw (unconverted) expense per currency
5039
+ */
5040
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
5041
+ /**
5042
+ * Converted total in base currency (omitted when FX missing for all currencies in this category)
5043
+ */
5044
+ convertedBalance?: string;
5045
+ };
5046
+
5047
+ export type ExpensesByCategorySummaryDto = {
5048
+ /**
5049
+ * Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income
5050
+ */
5051
+ totalExpense: string;
5052
+ /**
5053
+ * Number of categories
5054
+ */
5055
+ categoryCount: number;
5056
+ };
5057
+
5058
+ export type ExpensesByCategoryResponseDto = {
5059
+ /**
5060
+ * Period requested
5061
+ */
5062
+ period: string;
5063
+ /**
5064
+ * Base currency for converted values
5065
+ */
5066
+ baseCurrency: string;
5067
+ /**
5068
+ * Expense groups by functional category, sorted by converted total desc
5069
+ */
5070
+ groups: Array<CategoryGroupDto>;
5071
+ /**
5072
+ * Summary statistics
5073
+ */
5074
+ summary: ExpensesByCategorySummaryDto;
5075
+ /**
5076
+ * Exchange rate warnings (e.g. missing rate for a currency)
5077
+ */
5078
+ warnings?: Array<ExchangeRateWarningDto>;
5079
+ };
5080
+
4505
5081
  export type MonetaryDto = {
4506
5082
  /**
4507
5083
  * Amount (Decimal string)
@@ -4697,108 +5273,6 @@ export type HoldingPnlResponseDto = {
4697
5273
  */
4698
5274
  export type method = 'average' | 'FIFO';
4699
5275
 
4700
- export type CreateBeanPriceDto = {
4701
- /**
4702
- * Currency being priced (e.g., USD, AAPL, BTC)
4703
- */
4704
- currency: string;
4705
- /**
4706
- * Quote currency (pricing currency, e.g., CNY, EUR)
4707
- */
4708
- quoteCurrency: string;
4709
- /**
4710
- * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
4711
- */
4712
- amount: number;
4713
- /**
4714
- * Price date (ISO 8601 format)
4715
- */
4716
- date: string;
4717
- /**
4718
- * Metadata (validated by Zod schema, max field lengths enforced)
4719
- */
4720
- metadata?: {
4721
- [key: string]: unknown;
4722
- };
4723
- };
4724
-
4725
- export type PriceResponseDto = {
4726
- /**
4727
- * Unique identifier
4728
- */
4729
- id: string;
4730
- /**
4731
- * User ID (owner of the price)
4732
- */
4733
- userId: string;
4734
- /**
4735
- * Currency being priced (e.g., USD, AAPL, BTC)
4736
- */
4737
- currency: string;
4738
- /**
4739
- * Quote currency (pricing currency, e.g., USD, CNY)
4740
- */
4741
- quoteCurrency: string;
4742
- /**
4743
- * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
4744
- */
4745
- amount: number;
4746
- /**
4747
- * Price date (ISO 8601 format). Represents the date this price was valid.
4748
- */
4749
- date: string;
4750
- /**
4751
- * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
4752
- */
4753
- meta: {
4754
- [key: string]: unknown;
4755
- };
4756
- /**
4757
- * Creation timestamp
4758
- */
4759
- createdAt: string;
4760
- /**
4761
- * Last update timestamp
4762
- */
4763
- updatedAt: string;
4764
- };
4765
-
4766
- export type PriceListResponseDto = {
4767
- /**
4768
- * List of prices
4769
- */
4770
- items: Array<PriceResponseDto>;
4771
- /**
4772
- * Total number of prices
4773
- */
4774
- total: number;
4775
- };
4776
-
4777
- export type UpdateBeanPriceDto = {
4778
- /**
4779
- * Currency being priced
4780
- */
4781
- currency?: string;
4782
- /**
4783
- * Quote currency (pricing currency)
4784
- */
4785
- quoteCurrency?: string;
4786
- /**
4787
- * Price amount (MUST be >= 0 per Beancount spec)
4788
- */
4789
- amount?: number;
4790
- /**
4791
- * Price date (ISO 8601 format)
4792
- */
4793
- date?: string;
4794
- /**
4795
- * Metadata
4796
- */
4797
- metadata?: {
4798
- [key: string]: unknown;
4799
- };
4800
- };
4801
-
4802
5276
  export type CurrencyBalanceDto = {
4803
5277
  /**
4804
5278
  * ISO 4217 currency code
@@ -4825,6 +5299,14 @@ export type TimeSeriesPointDto = {
4825
5299
  change?: {
4826
5300
  [key: string]: unknown;
4827
5301
  };
5302
+ /**
5303
+ * Total assets at this date (in base currency)
5304
+ */
5305
+ assets?: string;
5306
+ /**
5307
+ * Total liabilities at this date (in base currency)
5308
+ */
5309
+ liabilities?: string;
4828
5310
  /**
4829
5311
  * Multi-currency breakdown for this point
4830
5312
  */
@@ -4892,58 +5374,123 @@ export type PortfolioTrendsResponseDto = {
4892
5374
  warnings?: Array<ExchangeRateWarningDto>;
4893
5375
  };
4894
5376
 
4895
- export type GenerateSnapshotBody = unknown;
4896
-
4897
- export type GenerateSnapshotResponse = unknown;
4898
-
4899
- export type BackfillSnapshotsBody = unknown;
4900
-
4901
- export type BackfillSnapshotsResponse = unknown;
4902
-
4903
- export type AnonymousLoginDto = {
5377
+ export type CashFlowPointDto = {
4904
5378
  /**
4905
- * Access token for anonymous login
5379
+ * Month key (YYYY-MM)
4906
5380
  */
4907
- accessToken: string;
4908
- };
4909
-
4910
- export type AccountControllerCreateData = {
5381
+ month: string;
4911
5382
  /**
4912
- * Region code for tenant context
5383
+ * Income in base currency (absolute, converted)
4913
5384
  */
4914
- region: 'cn' | 'us' | 'de' | 'gb';
4915
- requestBody: CreateAccountDto;
5385
+ income: string;
5386
+ /**
5387
+ * Expense in base currency (absolute, converted)
5388
+ */
5389
+ expense: string;
5390
+ /**
5391
+ * netSavings = income − expense (savings positive)
5392
+ */
5393
+ netSavings: string;
4916
5394
  };
4917
5395
 
4918
- export type AccountControllerCreateResponse = AccountResponseDto;
4919
-
4920
- export type AccountControllerFindAllData = {
5396
+ export type CashFlowTrendSummaryDto = {
4921
5397
  /**
4922
- * Filter by custom (user-created) accounts only
5398
+ * Total income across the period
4923
5399
  */
4924
- isCustom?: boolean;
5400
+ totalIncome: string;
4925
5401
  /**
4926
- * Maximum number of results
5402
+ * Total expense across the period
4927
5403
  */
4928
- limit?: number;
5404
+ totalExpense: string;
4929
5405
  /**
4930
- * Number of results to skip
5406
+ * income − expense across the period
4931
5407
  */
4932
- offset?: number;
5408
+ totalNetSavings: string;
4933
5409
  /**
4934
- * Region code for tenant context
5410
+ * totalNetSavings divided by the window length (N months, incl. zero-filled)
4935
5411
  */
4936
- region: 'cn' | 'us' | 'de' | 'gb';
5412
+ averageMonthlyNetSavings: string;
5413
+ };
5414
+
5415
+ export type CashFlowTrendsResponseDto = {
4937
5416
  /**
4938
- * Search term for path or i18nKey
5417
+ * Monthly cash-flow series (fixed N-month window, zero-filled)
4939
5418
  */
4940
- search?: string;
5419
+ series: Array<CashFlowPointDto>;
4941
5420
  /**
4942
- * Filter by status
5421
+ * Period totals
4943
5422
  */
4944
- status?: 'OPEN' | 'CLOSED' | 'SUSPENDED';
5423
+ summary: CashFlowTrendSummaryDto;
4945
5424
  /**
4946
- * Filter by account type
5425
+ * Period requested
5426
+ */
5427
+ period: string;
5428
+ /**
5429
+ * Data granularity (v1 returns month buckets)
5430
+ */
5431
+ granularity: string;
5432
+ /**
5433
+ * Base currency for converted values
5434
+ */
5435
+ currency: string;
5436
+ /**
5437
+ * Exchange rate warnings (e.g. missing rate for a currency)
5438
+ */
5439
+ warnings?: Array<ExchangeRateWarningDto>;
5440
+ };
5441
+
5442
+ export type GenerateSnapshotBody = unknown;
5443
+
5444
+ export type GenerateSnapshotResponse = unknown;
5445
+
5446
+ export type BackfillSnapshotsBody = unknown;
5447
+
5448
+ export type BackfillSnapshotsResponse = unknown;
5449
+
5450
+ export type AnonymousLoginDto = {
5451
+ /**
5452
+ * Access token for anonymous login
5453
+ */
5454
+ accessToken: string;
5455
+ };
5456
+
5457
+ export type AccountControllerCreateData = {
5458
+ /**
5459
+ * Region code for tenant context
5460
+ */
5461
+ region: 'cn' | 'us' | 'de' | 'gb';
5462
+ requestBody: CreateAccountDto;
5463
+ };
5464
+
5465
+ export type AccountControllerCreateResponse = AccountResponseDto;
5466
+
5467
+ export type AccountControllerFindAllData = {
5468
+ /**
5469
+ * Filter by custom (user-created) accounts only
5470
+ */
5471
+ isCustom?: boolean;
5472
+ /**
5473
+ * Maximum number of results
5474
+ */
5475
+ limit?: number;
5476
+ /**
5477
+ * Number of results to skip
5478
+ */
5479
+ offset?: number;
5480
+ /**
5481
+ * Region code for tenant context
5482
+ */
5483
+ region: 'cn' | 'us' | 'de' | 'gb';
5484
+ /**
5485
+ * Search term for account path
5486
+ */
5487
+ search?: string;
5488
+ /**
5489
+ * Filter by status
5490
+ */
5491
+ status?: 'OPEN' | 'CLOSED' | 'SUSPENDED';
5492
+ /**
5493
+ * Filter by account type
4947
5494
  */
4948
5495
  type?: 'Assets' | 'Liabilities' | 'Income' | 'Expenses' | 'Equity';
4949
5496
  };
@@ -5018,6 +5565,21 @@ export type AccountControllerReopenData = {
5018
5565
 
5019
5566
  export type AccountControllerReopenResponse = AccountResponseDto;
5020
5567
 
5568
+ export type AccountControllerAddOpeningBalanceData = {
5569
+ /**
5570
+ * Account UUID
5571
+ */
5572
+ id: string;
5573
+ /**
5574
+ * Region code for tenant context
5575
+ */
5576
+ region: 'cn' | 'us' | 'de' | 'gb';
5577
+ requestBody: CreateOpeningBalanceDto;
5578
+ };
5579
+
5580
+ export type AccountControllerAddOpeningBalanceResponse =
5581
+ OpeningBalanceResultDto;
5582
+
5021
5583
  export type AccountStandardsControllerGetTemplatesData = {
5022
5584
  /**
5023
5585
  * Region code (cn, us, de)
@@ -5078,6 +5640,10 @@ export type TransactionControllerListData = {
5078
5640
  * Filter by account ID (transactions with postings to this account)
5079
5641
  */
5080
5642
  accountId?: string;
5643
+ /**
5644
+ * Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
5645
+ */
5646
+ category?: string;
5081
5647
  /**
5082
5648
  * Filter by start date (inclusive), format: YYYY-MM-DD
5083
5649
  */
@@ -5202,7 +5768,7 @@ export type TransactionControllerDeleteResponse = void;
5202
5768
 
5203
5769
  export type BalanceControllerGetBalanceData = {
5204
5770
  /**
5205
- * Account name (e.g., "Assets:Bank:Checking")
5771
+ * Account name (e.g., "Assets:Checking")
5206
5772
  */
5207
5773
  account: string;
5208
5774
  /**
@@ -5604,6 +6170,103 @@ export type CommodityControllerBulkCreateData = {
5604
6170
 
5605
6171
  export type CommodityControllerBulkCreateResponse = Array<CommodityResponseDto>;
5606
6172
 
6173
+ export type PriceControllerCreateData = {
6174
+ /**
6175
+ * Region code for tenant context
6176
+ */
6177
+ region: 'cn' | 'us' | 'de' | 'gb';
6178
+ requestBody: CreateBeanPriceDto;
6179
+ };
6180
+
6181
+ export type PriceControllerCreateResponse = PriceResponseDto;
6182
+
6183
+ export type PriceControllerFindAllData = {
6184
+ /**
6185
+ * Filter by currency (e.g., BTC, AAPL, USD)
6186
+ */
6187
+ currency?: string;
6188
+ /**
6189
+ * Filter prices from this date (ISO 8601 format)
6190
+ */
6191
+ dateFrom?: string;
6192
+ /**
6193
+ * Filter prices to this date (ISO 8601 format)
6194
+ */
6195
+ dateTo?: string;
6196
+ /**
6197
+ * Number of items per page (default: 20, max: 100)
6198
+ */
6199
+ limit?: number;
6200
+ /**
6201
+ * Page number for pagination (default: 1)
6202
+ */
6203
+ page?: number;
6204
+ /**
6205
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6206
+ */
6207
+ quoteCurrency?: string;
6208
+ /**
6209
+ * Region code for tenant context
6210
+ */
6211
+ region: 'cn' | 'us' | 'de' | 'gb';
6212
+ /**
6213
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6214
+ */
6215
+ search?: string;
6216
+ };
6217
+
6218
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6219
+
6220
+ export type PriceControllerFindOneData = {
6221
+ /**
6222
+ * Price ID
6223
+ */
6224
+ id: string;
6225
+ /**
6226
+ * Region code for tenant context
6227
+ */
6228
+ region: 'cn' | 'us' | 'de' | 'gb';
6229
+ };
6230
+
6231
+ export type PriceControllerFindOneResponse = PriceResponseDto;
6232
+
6233
+ export type PriceControllerUpdateData = {
6234
+ /**
6235
+ * Price ID
6236
+ */
6237
+ id: string;
6238
+ /**
6239
+ * Region code for tenant context
6240
+ */
6241
+ region: 'cn' | 'us' | 'de' | 'gb';
6242
+ requestBody: UpdateBeanPriceDto;
6243
+ };
6244
+
6245
+ export type PriceControllerUpdateResponse = PriceResponseDto;
6246
+
6247
+ export type PriceControllerDeleteData = {
6248
+ /**
6249
+ * Price ID
6250
+ */
6251
+ id: string;
6252
+ /**
6253
+ * Region code for tenant context
6254
+ */
6255
+ region: 'cn' | 'us' | 'de' | 'gb';
6256
+ };
6257
+
6258
+ export type PriceControllerDeleteResponse = void;
6259
+
6260
+ export type PriceControllerBulkCreateData = {
6261
+ /**
6262
+ * Region code for tenant context
6263
+ */
6264
+ region: 'cn' | 'us' | 'de' | 'gb';
6265
+ requestBody: Array<string>;
6266
+ };
6267
+
6268
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
6269
+
5607
6270
  export type RecurringRuleControllerCreateData = {
5608
6271
  /**
5609
6272
  * Region code for tenant context
@@ -6069,139 +6732,250 @@ export type PropertyControllerDeleteData = {
6069
6732
 
6070
6733
  export type PropertyControllerDeleteResponse = void;
6071
6734
 
6072
- export type ExportControllerExportBeancountResponse = unknown;
6735
+ export type EventControllerCreateData = {
6736
+ /**
6737
+ * Region code for tenant context (decorative for life events)
6738
+ */
6739
+ region: 'cn' | 'us' | 'de' | 'gb';
6740
+ requestBody: CreateBeanEventDto;
6741
+ };
6073
6742
 
6074
- export type FileImportControllerImportFileData = {
6743
+ export type EventControllerCreateResponse = EventResponseDto;
6744
+
6745
+ export type EventControllerFindAllData = {
6075
6746
  /**
6076
- * Bill file to import
6747
+ * Filter life events from this date (ISO 8601 format)
6077
6748
  */
6078
- formData: FileImportDto;
6749
+ from?: string;
6079
6750
  /**
6080
- * Region code for tenant context
6751
+ * Number of items per page (default: 20, max: 100)
6752
+ */
6753
+ limit?: number;
6754
+ /**
6755
+ * Page number for pagination (default: 1)
6756
+ */
6757
+ page?: number;
6758
+ /**
6759
+ * Search term for description (case-insensitive partial match)
6760
+ */
6761
+ q?: string;
6762
+ /**
6763
+ * Region code for tenant context (decorative for life events)
6081
6764
  */
6082
6765
  region: 'cn' | 'us' | 'de' | 'gb';
6766
+ /**
6767
+ * Filter life events to this date (ISO 8601 format)
6768
+ */
6769
+ to?: string;
6770
+ /**
6771
+ * Filter by life event type (exact match)
6772
+ */
6773
+ type?: string;
6083
6774
  };
6084
6775
 
6085
- export type FileImportControllerImportFileResponse = ImportResultDto;
6776
+ export type EventControllerFindAllResponse = EventListResponseDto;
6086
6777
 
6087
- export type FileImportControllerIdentifyFileData = {
6778
+ export type EventControllerFindOneData = {
6088
6779
  /**
6089
- * File to identify
6780
+ * Life event ID
6090
6781
  */
6091
- formData: FileImportDto;
6782
+ id: string;
6092
6783
  /**
6093
- * Region code for tenant context
6784
+ * Region code for tenant context (decorative for life events)
6094
6785
  */
6095
6786
  region: 'cn' | 'us' | 'de' | 'gb';
6096
6787
  };
6097
6788
 
6098
- export type FileImportControllerIdentifyFileResponse = IdentifyResultDto;
6789
+ export type EventControllerFindOneResponse = EventResponseDto;
6099
6790
 
6100
- export type FileImportControllerImportBeancountData = {
6791
+ export type EventControllerUpdateData = {
6101
6792
  /**
6102
- * Beancount file to import
6793
+ * Life event ID
6103
6794
  */
6104
- formData: FileImportDto;
6795
+ id: string;
6105
6796
  /**
6106
- * Region code for tenant context
6797
+ * Region code for tenant context (decorative for life events)
6107
6798
  */
6108
6799
  region: 'cn' | 'us' | 'de' | 'gb';
6800
+ requestBody: UpdateBeanEventDto;
6109
6801
  };
6110
6802
 
6111
- export type FileImportControllerImportBeancountResponse = {
6112
- imported?: number;
6113
- skipped?: number;
6114
- failed?: number;
6115
- accountsCreated?: number;
6116
- errors?: Array<{
6117
- [key: string]: unknown;
6118
- }>;
6119
- };
6803
+ export type EventControllerUpdateResponse = EventResponseDto;
6120
6804
 
6121
- export type ImporterConfigControllerGetConfigData = {
6805
+ export type EventControllerDeleteData = {
6122
6806
  /**
6123
- * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6807
+ * Life event ID
6124
6808
  */
6125
- importerId: string;
6809
+ id: string;
6126
6810
  /**
6127
- * Region code for tenant context
6811
+ * Region code for tenant context (decorative for life events)
6128
6812
  */
6129
6813
  region: 'cn' | 'us' | 'de' | 'gb';
6130
6814
  };
6131
6815
 
6132
- export type ImporterConfigControllerGetConfigResponse = ImporterConfigDto;
6816
+ export type EventControllerDeleteResponse = void;
6133
6817
 
6134
- export type ImporterConfigControllerUpdateConfigData = {
6818
+ export type EventControllerGetSliceData = {
6819
+ accountPattern: string;
6820
+ granularity: string;
6135
6821
  /**
6136
- * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6822
+ * Life event ID
6137
6823
  */
6138
- importerId: string;
6824
+ id: string;
6139
6825
  /**
6140
- * Region code for tenant context
6826
+ * Region code for tenant context (decorative for life events)
6141
6827
  */
6142
6828
  region: 'cn' | 'us' | 'de' | 'gb';
6143
- /**
6144
- * Partial configuration update. Only provided fields will be updated.
6145
- */
6146
- requestBody: UpdateImporterConfigDto;
6147
6829
  };
6148
6830
 
6149
- export type ImporterConfigControllerUpdateConfigResponse = ImporterConfigDto;
6831
+ export type EventControllerGetSliceResponse = unknown;
6150
6832
 
6151
- export type ImporterConfigControllerResetConfigData = {
6152
- /**
6153
- * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6154
- */
6155
- importerId: string;
6833
+ export type OnboardingControllerBootstrapData = {
6156
6834
  /**
6157
6835
  * Region code for tenant context
6158
6836
  */
6159
6837
  region: 'cn' | 'us' | 'de' | 'gb';
6838
+ requestBody: OnboardingDto;
6160
6839
  };
6161
6840
 
6162
- export type ImporterConfigControllerResetConfigResponse = ImporterConfigDto;
6163
-
6164
- export type PlatformControllerFindAllResponse = unknown;
6841
+ export type OnboardingControllerBootstrapResponse = unknown;
6165
6842
 
6166
- export type PlatformControllerCreateData = {
6167
- requestBody: CreatePlatformDto;
6843
+ export type ReconciliationControllerComputeData = {
6844
+ /**
6845
+ * Region code for tenant context (decorative for reconciliation)
6846
+ */
6847
+ region: 'cn' | 'us' | 'de' | 'gb';
6848
+ requestBody: ComputeReconciliationDto;
6168
6849
  };
6169
6850
 
6170
- export type PlatformControllerCreateResponse = unknown;
6171
-
6172
- export type PlatformControllerGetPlatformListResponse = unknown;
6851
+ export type ReconciliationControllerComputeResponse =
6852
+ ReconciliationComputeResultDto;
6173
6853
 
6174
- export type PlatformControllerMatchPlatformsData = {
6854
+ export type ReconciliationControllerAssertData = {
6175
6855
  /**
6176
- * Search query — Chinese name, English name, or abbreviation
6856
+ * Region code for tenant context (decorative for reconciliation)
6177
6857
  */
6178
- q: string;
6858
+ region: 'cn' | 'us' | 'de' | 'gb';
6859
+ requestBody: AssertReconciliationDto;
6860
+ };
6861
+
6862
+ export type ReconciliationControllerAssertResponse = ReconciliationRecordDto;
6863
+
6864
+ export type ReconciliationControllerPadData = {
6179
6865
  /**
6180
- * Region code for category override lookup
6866
+ * Region code for tenant context (decorative for reconciliation)
6181
6867
  */
6182
- region?: string;
6868
+ region: 'cn' | 'us' | 'de' | 'gb';
6869
+ requestBody: PadReconciliationDto;
6183
6870
  };
6184
6871
 
6185
- export type PlatformControllerMatchPlatformsResponse = unknown;
6872
+ export type ReconciliationControllerPadResponse = PadResultDto;
6186
6873
 
6187
- export type PlatformControllerUpdateData = {
6874
+ export type ReconciliationControllerHistoryData = {
6188
6875
  /**
6189
- * Platform ID
6876
+ * BeanAccount id
6190
6877
  */
6191
- id: string;
6192
- requestBody: UpdatePlatformDto;
6878
+ accountId: string;
6879
+ /**
6880
+ * Region code for tenant context (decorative for reconciliation)
6881
+ */
6882
+ region: 'cn' | 'us' | 'de' | 'gb';
6193
6883
  };
6194
6884
 
6195
- export type PlatformControllerUpdateResponse = unknown;
6885
+ export type ReconciliationControllerHistoryResponse =
6886
+ Array<ReconciliationRecordDto>;
6196
6887
 
6197
- export type PlatformControllerDeleteData = {
6888
+ export type ExportControllerExportBeancountResponse = unknown;
6889
+
6890
+ export type FileImportControllerImportFileData = {
6198
6891
  /**
6199
- * Platform ID
6892
+ * Bill file to import
6200
6893
  */
6201
- id: string;
6894
+ formData: FileImportDto;
6895
+ /**
6896
+ * Region code for tenant context
6897
+ */
6898
+ region: 'cn' | 'us' | 'de' | 'gb';
6202
6899
  };
6203
6900
 
6204
- export type PlatformControllerDeleteResponse = void;
6901
+ export type FileImportControllerImportFileResponse = ImportResultDto;
6902
+
6903
+ export type FileImportControllerIdentifyFileData = {
6904
+ /**
6905
+ * File to identify
6906
+ */
6907
+ formData: FileImportDto;
6908
+ /**
6909
+ * Region code for tenant context
6910
+ */
6911
+ region: 'cn' | 'us' | 'de' | 'gb';
6912
+ };
6913
+
6914
+ export type FileImportControllerIdentifyFileResponse = IdentifyResultDto;
6915
+
6916
+ export type FileImportControllerImportBeancountData = {
6917
+ /**
6918
+ * Beancount file to import
6919
+ */
6920
+ formData: FileImportDto;
6921
+ /**
6922
+ * Region code for tenant context
6923
+ */
6924
+ region: 'cn' | 'us' | 'de' | 'gb';
6925
+ };
6926
+
6927
+ export type FileImportControllerImportBeancountResponse = {
6928
+ imported?: number;
6929
+ skipped?: number;
6930
+ failed?: number;
6931
+ accountsCreated?: number;
6932
+ errors?: Array<{
6933
+ [key: string]: unknown;
6934
+ }>;
6935
+ };
6936
+
6937
+ export type ImporterConfigControllerGetConfigData = {
6938
+ /**
6939
+ * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6940
+ */
6941
+ importerId: string;
6942
+ /**
6943
+ * Region code for tenant context
6944
+ */
6945
+ region: 'cn' | 'us' | 'de' | 'gb';
6946
+ };
6947
+
6948
+ export type ImporterConfigControllerGetConfigResponse = ImporterConfigDto;
6949
+
6950
+ export type ImporterConfigControllerUpdateConfigData = {
6951
+ /**
6952
+ * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6953
+ */
6954
+ importerId: string;
6955
+ /**
6956
+ * Region code for tenant context
6957
+ */
6958
+ region: 'cn' | 'us' | 'de' | 'gb';
6959
+ /**
6960
+ * Partial configuration update. Only provided fields will be updated.
6961
+ */
6962
+ requestBody: UpdateImporterConfigDto;
6963
+ };
6964
+
6965
+ export type ImporterConfigControllerUpdateConfigResponse = ImporterConfigDto;
6966
+
6967
+ export type ImporterConfigControllerResetConfigData = {
6968
+ /**
6969
+ * Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
6970
+ */
6971
+ importerId: string;
6972
+ /**
6973
+ * Region code for tenant context
6974
+ */
6975
+ region: 'cn' | 'us' | 'de' | 'gb';
6976
+ };
6977
+
6978
+ export type ImporterConfigControllerResetConfigResponse = ImporterConfigDto;
6205
6979
 
6206
6980
  export type ProviderSyncControllerSyncData = {
6207
6981
  /**
@@ -6248,6 +7022,49 @@ export type ProviderSyncControllerIsProviderSupportedData = {
6248
7022
 
6249
7023
  export type ProviderSyncControllerIsProviderSupportedResponse = unknown;
6250
7024
 
7025
+ export type ExternalAccountLinkControllerCreateData = {
7026
+ /**
7027
+ * Region code for tenant context
7028
+ */
7029
+ region: 'cn' | 'us' | 'de' | 'gb';
7030
+ requestBody: CreateExternalAccountLinkDto;
7031
+ };
7032
+
7033
+ export type ExternalAccountLinkControllerCreateResponse =
7034
+ ExternalAccountLinkResponseDto;
7035
+
7036
+ export type ExternalAccountLinkControllerFindAllData = {
7037
+ provider: string;
7038
+ /**
7039
+ * Region code for tenant context
7040
+ */
7041
+ region: 'cn' | 'us' | 'de' | 'gb';
7042
+ };
7043
+
7044
+ export type ExternalAccountLinkControllerFindAllResponse =
7045
+ ExternalAccountLinkListResponseDto;
7046
+
7047
+ export type ExternalAccountLinkControllerFindOneData = {
7048
+ id: string;
7049
+ /**
7050
+ * Region code for tenant context
7051
+ */
7052
+ region: 'cn' | 'us' | 'de' | 'gb';
7053
+ };
7054
+
7055
+ export type ExternalAccountLinkControllerFindOneResponse =
7056
+ ExternalAccountLinkResponseDto;
7057
+
7058
+ export type ExternalAccountLinkControllerRemoveData = {
7059
+ id: string;
7060
+ /**
7061
+ * Region code for tenant context
7062
+ */
7063
+ region: 'cn' | 'us' | 'de' | 'gb';
7064
+ };
7065
+
7066
+ export type ExternalAccountLinkControllerRemoveResponse = void;
7067
+
6251
7068
  export type TelemetryControllerReportTelemetryData = {
6252
7069
  /**
6253
7070
  * Region code for tenant context
@@ -6320,6 +7137,49 @@ export type NlpControllerGetSessionData = {
6320
7137
 
6321
7138
  export type NlpControllerGetSessionResponse = unknown;
6322
7139
 
7140
+ export type PlatformControllerFindAllResponse = unknown;
7141
+
7142
+ export type PlatformControllerCreateData = {
7143
+ requestBody: CreatePlatformDto;
7144
+ };
7145
+
7146
+ export type PlatformControllerCreateResponse = unknown;
7147
+
7148
+ export type PlatformControllerGetPlatformListResponse =
7149
+ Array<PlatformListItemDto>;
7150
+
7151
+ export type PlatformControllerMatchPlatformsData = {
7152
+ /**
7153
+ * Search query — Chinese name, English name, or abbreviation
7154
+ */
7155
+ q: string;
7156
+ /**
7157
+ * Region code for category override lookup
7158
+ */
7159
+ region?: string;
7160
+ };
7161
+
7162
+ export type PlatformControllerMatchPlatformsResponse = unknown;
7163
+
7164
+ export type PlatformControllerUpdateData = {
7165
+ /**
7166
+ * Platform ID
7167
+ */
7168
+ id: string;
7169
+ requestBody: UpdatePlatformDto;
7170
+ };
7171
+
7172
+ export type PlatformControllerUpdateResponse = unknown;
7173
+
7174
+ export type PlatformControllerDeleteData = {
7175
+ /**
7176
+ * Platform ID
7177
+ */
7178
+ id: string;
7179
+ };
7180
+
7181
+ export type PlatformControllerDeleteResponse = void;
7182
+
6323
7183
  export type DashboardControllerGetNetWorthData = {
6324
7184
  /**
6325
7185
  * Date for balance calculation (ISO 8601 format)
@@ -6374,127 +7234,70 @@ export type DashboardControllerGetCashFlowData = {
6374
7234
 
6375
7235
  export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6376
7236
 
6377
- export type HoldingPnlControllerGetHoldingPnlData = {
6378
- /**
6379
- * Scope to a single account
6380
- */
6381
- accountId?: string;
6382
- /**
6383
- * As-of date (ISO 8601), defaults to today
6384
- */
6385
- asOf?: string;
6386
- /**
6387
- * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6388
- */
6389
- method?: 'FIFO' | 'average';
6390
- /**
6391
- * Region code for tenant context
6392
- */
6393
- region: 'cn' | 'us' | 'de' | 'gb';
6394
- };
6395
-
6396
- export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6397
-
6398
- export type PriceControllerCreateData = {
7237
+ export type DashboardControllerGetExpensesData = {
6399
7238
  /**
6400
- * Region code for tenant context
7239
+ * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
6401
7240
  */
6402
- region: 'cn' | 'us' | 'de' | 'gb';
6403
- requestBody: CreateBeanPriceDto;
6404
- };
6405
-
6406
- export type PriceControllerCreateResponse = PriceResponseDto;
6407
-
6408
- export type PriceControllerFindAllData = {
6409
- /**
6410
- * Filter by currency (e.g., BTC, AAPL, USD)
6411
- */
6412
- currency?: string;
7241
+ flow?: 'expense' | 'income';
6413
7242
  /**
6414
- * Filter prices from this date (ISO 8601 format)
6415
- */
6416
- dateFrom?: string;
6417
- /**
6418
- * Filter prices to this date (ISO 8601 format)
6419
- */
6420
- dateTo?: string;
6421
- /**
6422
- * Number of items per page (default: 20, max: 100)
6423
- */
6424
- limit?: number;
6425
- /**
6426
- * Page number for pagination (default: 1)
7243
+ * Grouping strategy
6427
7244
  */
6428
- page?: number;
7245
+ groupBy?: 'category';
6429
7246
  /**
6430
- * Filter by quote currency (pricing currency, e.g., USD, CNY)
7247
+ * Time window (1m = current calendar month)
6431
7248
  */
6432
- quoteCurrency?: string;
7249
+ period?: '1m' | '3m' | '6m' | '1y';
6433
7250
  /**
6434
7251
  * Region code for tenant context
6435
7252
  */
6436
7253
  region: 'cn' | 'us' | 'de' | 'gb';
6437
- /**
6438
- * Search term for currency or quoteCurrency (case-insensitive partial match)
6439
- */
6440
- search?: string;
6441
7254
  };
6442
7255
 
6443
- export type PriceControllerFindAllResponse = PriceListResponseDto;
7256
+ export type DashboardControllerGetExpensesResponse =
7257
+ ExpensesByCategoryResponseDto;
6444
7258
 
6445
- export type PriceControllerFindOneData = {
7259
+ export type HoldingPnlControllerGetHoldingPnlData = {
6446
7260
  /**
6447
- * Price ID
7261
+ * Scope to a single account
6448
7262
  */
6449
- id: string;
7263
+ accountId?: string;
6450
7264
  /**
6451
- * Region code for tenant context
7265
+ * As-of date (ISO 8601), defaults to today
6452
7266
  */
6453
- region: 'cn' | 'us' | 'de' | 'gb';
6454
- };
6455
-
6456
- export type PriceControllerFindOneResponse = PriceResponseDto;
6457
-
6458
- export type PriceControllerUpdateData = {
7267
+ asOf?: string;
6459
7268
  /**
6460
- * Price ID
7269
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6461
7270
  */
6462
- id: string;
7271
+ method?: 'FIFO' | 'average';
6463
7272
  /**
6464
7273
  * Region code for tenant context
6465
7274
  */
6466
7275
  region: 'cn' | 'us' | 'de' | 'gb';
6467
- requestBody: UpdateBeanPriceDto;
6468
7276
  };
6469
7277
 
6470
- export type PriceControllerUpdateResponse = PriceResponseDto;
7278
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6471
7279
 
6472
- export type PriceControllerDeleteData = {
7280
+ export type ReportingControllerGetPortfolioTrendsData = {
6473
7281
  /**
6474
- * Price ID
7282
+ * Data granularity
6475
7283
  */
6476
- id: string;
7284
+ granularity?: 'day' | 'week' | 'month';
6477
7285
  /**
6478
- * Region code for tenant context
7286
+ * Time period
6479
7287
  */
6480
- region: 'cn' | 'us' | 'de' | 'gb';
6481
- };
6482
-
6483
- export type PriceControllerDeleteResponse = void;
6484
-
6485
- export type PriceControllerBulkCreateData = {
7288
+ period?: '1m' | '3m' | '6m' | '1y';
6486
7289
  /**
6487
7290
  * Region code for tenant context
6488
7291
  */
6489
7292
  region: 'cn' | 'us' | 'de' | 'gb';
6490
- requestBody: Array<string>;
6491
7293
  };
6492
7294
 
6493
- export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
7295
+ export type ReportingControllerGetPortfolioTrendsResponse =
7296
+ PortfolioTrendsResponseDto;
6494
7297
 
6495
- export type ReportingControllerGetPortfolioTrendsData = {
7298
+ export type ReportingControllerGetCashFlowTrendsData = {
6496
7299
  /**
6497
- * Data granularity
7300
+ * Data granularity (accepted for API symmetry; v1 returns month buckets)
6498
7301
  */
6499
7302
  granularity?: 'day' | 'week' | 'month';
6500
7303
  /**
@@ -6507,8 +7310,8 @@ export type ReportingControllerGetPortfolioTrendsData = {
6507
7310
  region: 'cn' | 'us' | 'de' | 'gb';
6508
7311
  };
6509
7312
 
6510
- export type ReportingControllerGetPortfolioTrendsResponse =
6511
- PortfolioTrendsResponseDto;
7313
+ export type ReportingControllerGetCashFlowTrendsResponse =
7314
+ CashFlowTrendsResponseDto;
6512
7315
 
6513
7316
  export type ReportingControllerGenerateSnapshotData = {
6514
7317
  /**
@@ -6689,6 +7492,25 @@ export type $OpenApiTs = {
6689
7492
  };
6690
7493
  };
6691
7494
  };
7495
+ '/api/v1/{region}/bean/accounts/{id}/opening-balance': {
7496
+ post: {
7497
+ req: AccountControllerAddOpeningBalanceData;
7498
+ res: {
7499
+ /**
7500
+ * Opening-balance transaction created
7501
+ */
7502
+ 201: OpeningBalanceResultDto;
7503
+ /**
7504
+ * Account not found
7505
+ */
7506
+ 404: unknown;
7507
+ /**
7508
+ * An opening balance already exists for this account
7509
+ */
7510
+ 409: unknown;
7511
+ };
7512
+ };
7513
+ };
6692
7514
  '/api/v1/{region}/bean/account-standards': {
6693
7515
  get: {
6694
7516
  req: AccountStandardsControllerGetTemplatesData;
@@ -7235,65 +8057,149 @@ export type $OpenApiTs = {
7235
8057
  req: CommodityControllerFindOneData;
7236
8058
  res: {
7237
8059
  /**
7238
- * Commodity retrieved successfully
8060
+ * Commodity retrieved successfully
8061
+ */
8062
+ 200: CommodityResponseDto;
8063
+ /**
8064
+ * Commodity not found
8065
+ */
8066
+ 404: ApiProblemResponseDto;
8067
+ };
8068
+ };
8069
+ put: {
8070
+ req: CommodityControllerUpdateData;
8071
+ res: {
8072
+ /**
8073
+ * Commodity updated successfully
8074
+ */
8075
+ 200: CommodityResponseDto;
8076
+ /**
8077
+ * Invalid input data
8078
+ */
8079
+ 400: ApiProblemResponseDto;
8080
+ /**
8081
+ * Commodity not found
8082
+ */
8083
+ 404: ApiProblemResponseDto;
8084
+ };
8085
+ };
8086
+ delete: {
8087
+ req: CommodityControllerDeleteData;
8088
+ res: {
8089
+ /**
8090
+ * Commodity deleted successfully
8091
+ */
8092
+ 204: void;
8093
+ /**
8094
+ * Commodity not found
8095
+ */
8096
+ 404: ApiProblemResponseDto;
8097
+ };
8098
+ };
8099
+ };
8100
+ '/api/v1/{region}/bean/commodities/{symbol}/ensure': {
8101
+ post: {
8102
+ req: CommodityControllerGetOrCreateData;
8103
+ res: {
8104
+ /**
8105
+ * Commodity retrieved or created
8106
+ */
8107
+ 200: CommodityResponseDto;
8108
+ };
8109
+ };
8110
+ };
8111
+ '/api/v1/{region}/bean/commodities/bulk': {
8112
+ post: {
8113
+ req: CommodityControllerBulkCreateData;
8114
+ res: {
8115
+ /**
8116
+ * Commodities created successfully
8117
+ */
8118
+ 201: Array<CommodityResponseDto>;
8119
+ };
8120
+ };
8121
+ };
8122
+ '/api/v1/{region}/bean/prices': {
8123
+ post: {
8124
+ req: PriceControllerCreateData;
8125
+ res: {
8126
+ /**
8127
+ * Price created successfully
8128
+ */
8129
+ 201: PriceResponseDto;
8130
+ /**
8131
+ * Currency or quoteCurrency commodity not found
8132
+ */
8133
+ 404: unknown;
8134
+ /**
8135
+ * Price already exists for this currency pair and date
8136
+ */
8137
+ 409: unknown;
8138
+ };
8139
+ };
8140
+ get: {
8141
+ req: PriceControllerFindAllData;
8142
+ res: {
8143
+ /**
8144
+ * Prices retrieved successfully
8145
+ */
8146
+ 200: PriceListResponseDto;
8147
+ };
8148
+ };
8149
+ };
8150
+ '/api/v1/{region}/bean/prices/{id}': {
8151
+ get: {
8152
+ req: PriceControllerFindOneData;
8153
+ res: {
8154
+ /**
8155
+ * Price retrieved successfully
7239
8156
  */
7240
- 200: CommodityResponseDto;
8157
+ 200: PriceResponseDto;
7241
8158
  /**
7242
- * Commodity not found
8159
+ * Price not found
7243
8160
  */
7244
- 404: ApiProblemResponseDto;
8161
+ 404: unknown;
7245
8162
  };
7246
8163
  };
7247
8164
  put: {
7248
- req: CommodityControllerUpdateData;
8165
+ req: PriceControllerUpdateData;
7249
8166
  res: {
7250
8167
  /**
7251
- * Commodity updated successfully
8168
+ * Price updated successfully
7252
8169
  */
7253
- 200: CommodityResponseDto;
8170
+ 200: PriceResponseDto;
7254
8171
  /**
7255
- * Invalid input data
8172
+ * Price not found
7256
8173
  */
7257
- 400: ApiProblemResponseDto;
8174
+ 404: unknown;
7258
8175
  /**
7259
- * Commodity not found
8176
+ * Updated price conflicts with existing price
7260
8177
  */
7261
- 404: ApiProblemResponseDto;
8178
+ 409: unknown;
7262
8179
  };
7263
8180
  };
7264
8181
  delete: {
7265
- req: CommodityControllerDeleteData;
8182
+ req: PriceControllerDeleteData;
7266
8183
  res: {
7267
8184
  /**
7268
- * Commodity deleted successfully
8185
+ * Price deleted successfully
7269
8186
  */
7270
8187
  204: void;
7271
8188
  /**
7272
- * Commodity not found
7273
- */
7274
- 404: ApiProblemResponseDto;
7275
- };
7276
- };
7277
- };
7278
- '/api/v1/{region}/bean/commodities/{symbol}/ensure': {
7279
- post: {
7280
- req: CommodityControllerGetOrCreateData;
7281
- res: {
7282
- /**
7283
- * Commodity retrieved or created
8189
+ * Price not found
7284
8190
  */
7285
- 200: CommodityResponseDto;
8191
+ 404: unknown;
7286
8192
  };
7287
8193
  };
7288
8194
  };
7289
- '/api/v1/{region}/bean/commodities/bulk': {
8195
+ '/api/v1/{region}/bean/prices/bulk': {
7290
8196
  post: {
7291
- req: CommodityControllerBulkCreateData;
8197
+ req: PriceControllerBulkCreateData;
7292
8198
  res: {
7293
8199
  /**
7294
- * Commodities created successfully
8200
+ * Prices created successfully
7295
8201
  */
7296
- 201: Array<CommodityResponseDto>;
8202
+ 201: Array<PriceResponseDto>;
7297
8203
  };
7298
8204
  };
7299
8205
  };
@@ -7941,6 +8847,181 @@ export type $OpenApiTs = {
7941
8847
  };
7942
8848
  };
7943
8849
  };
8850
+ '/api/v1/{region}/bean/events': {
8851
+ post: {
8852
+ req: EventControllerCreateData;
8853
+ res: {
8854
+ /**
8855
+ * Life event created successfully
8856
+ */
8857
+ 201: EventResponseDto;
8858
+ /**
8859
+ * Life event already exists for this (userId, type, date) combination
8860
+ */
8861
+ 409: unknown;
8862
+ };
8863
+ };
8864
+ get: {
8865
+ req: EventControllerFindAllData;
8866
+ res: {
8867
+ /**
8868
+ * Life events retrieved successfully
8869
+ */
8870
+ 200: EventListResponseDto;
8871
+ };
8872
+ };
8873
+ };
8874
+ '/api/v1/{region}/bean/events/{id}': {
8875
+ get: {
8876
+ req: EventControllerFindOneData;
8877
+ res: {
8878
+ /**
8879
+ * Life event retrieved successfully
8880
+ */
8881
+ 200: EventResponseDto;
8882
+ /**
8883
+ * Life event not found
8884
+ */
8885
+ 404: unknown;
8886
+ };
8887
+ };
8888
+ put: {
8889
+ req: EventControllerUpdateData;
8890
+ res: {
8891
+ /**
8892
+ * Life event updated successfully
8893
+ */
8894
+ 200: EventResponseDto;
8895
+ /**
8896
+ * If-Match header is not a valid ISO 8601 date
8897
+ */
8898
+ 400: unknown;
8899
+ /**
8900
+ * Life event not found
8901
+ */
8902
+ 404: unknown;
8903
+ /**
8904
+ * Updated event conflicts with an existing (userId, type, date) combination
8905
+ */
8906
+ 409: unknown;
8907
+ /**
8908
+ * If-Match precondition failed (updatedAt mismatch)
8909
+ */
8910
+ 412: unknown;
8911
+ };
8912
+ };
8913
+ delete: {
8914
+ req: EventControllerDeleteData;
8915
+ res: {
8916
+ /**
8917
+ * Life event deleted successfully
8918
+ */
8919
+ 204: void;
8920
+ /**
8921
+ * Life event not found
8922
+ */
8923
+ 404: unknown;
8924
+ };
8925
+ };
8926
+ };
8927
+ '/api/v1/{region}/bean/events/{id}/slice': {
8928
+ get: {
8929
+ req: EventControllerGetSliceData;
8930
+ res: {
8931
+ /**
8932
+ * Time-series sliced by the life event range
8933
+ */
8934
+ 200: unknown;
8935
+ /**
8936
+ * accountPattern query param is empty
8937
+ */
8938
+ 400: unknown;
8939
+ /**
8940
+ * Life event not found
8941
+ */
8942
+ 404: unknown;
8943
+ };
8944
+ };
8945
+ };
8946
+ '/api/v1/{region}/bean/onboarding': {
8947
+ post: {
8948
+ req: OnboardingControllerBootstrapData;
8949
+ res: {
8950
+ /**
8951
+ * Onboarding bootstrap result.
8952
+ */
8953
+ 201: unknown;
8954
+ /**
8955
+ * Invalid region/account path/duplicate paths.
8956
+ */
8957
+ 422: unknown;
8958
+ };
8959
+ };
8960
+ };
8961
+ '/api/v1/{region}/bean/reconciliations': {
8962
+ post: {
8963
+ req: ReconciliationControllerComputeData;
8964
+ res: {
8965
+ /**
8966
+ * Reconciliation preview
8967
+ */
8968
+ 200: ReconciliationComputeResultDto;
8969
+ /**
8970
+ * Account not found
8971
+ */
8972
+ 404: unknown;
8973
+ };
8974
+ };
8975
+ };
8976
+ '/api/v1/{region}/bean/reconciliations/assert': {
8977
+ post: {
8978
+ req: ReconciliationControllerAssertData;
8979
+ res: {
8980
+ /**
8981
+ * Balance assertion recorded
8982
+ */
8983
+ 201: ReconciliationRecordDto;
8984
+ /**
8985
+ * Account not found
8986
+ */
8987
+ 404: unknown;
8988
+ };
8989
+ };
8990
+ };
8991
+ '/api/v1/{region}/bean/reconciliations/pad': {
8992
+ post: {
8993
+ req: ReconciliationControllerPadData;
8994
+ res: {
8995
+ /**
8996
+ * Pad adjusting entry generated
8997
+ */
8998
+ 201: PadResultDto;
8999
+ /**
9000
+ * Book already within tolerance — no pad needed
9001
+ */
9002
+ 400: unknown;
9003
+ /**
9004
+ * Account not found
9005
+ */
9006
+ 404: unknown;
9007
+ };
9008
+ };
9009
+ };
9010
+ '/api/v1/{region}/bean/accounts/{accountId}/reconciliations': {
9011
+ get: {
9012
+ req: ReconciliationControllerHistoryData;
9013
+ res: {
9014
+ /**
9015
+ * Reconciliation history
9016
+ */
9017
+ 200: Array<ReconciliationRecordDto>;
9018
+ /**
9019
+ * Account not found
9020
+ */
9021
+ 404: unknown;
9022
+ };
9023
+ };
9024
+ };
7944
9025
  '/api/v1/{region}/bean/export/beancount': {
7945
9026
  get: {
7946
9027
  res: {
@@ -8024,142 +9105,70 @@ export type $OpenApiTs = {
8024
9105
  /**
8025
9106
  * Beancount file imported successfully
8026
9107
  */
8027
- 200: {
8028
- imported?: number;
8029
- skipped?: number;
8030
- failed?: number;
8031
- accountsCreated?: number;
8032
- errors?: Array<{
8033
- [key: string]: unknown;
8034
- }>;
8035
- };
8036
- /**
8037
- * Bad request - invalid file or no file uploaded
8038
- */
8039
- 400: ApiProblemResponseDto;
8040
- };
8041
- };
8042
- };
8043
- '/api/v1/{region}/bean/import/config/{importerId}': {
8044
- get: {
8045
- req: ImporterConfigControllerGetConfigData;
8046
- res: {
8047
- /**
8048
- * Configuration retrieved successfully
8049
- */
8050
- 200: ImporterConfigDto;
8051
- /**
8052
- * Invalid input - Unsupported importer
8053
- */
8054
- 400: ApiProblemResponseDto;
8055
- /**
8056
- * Unauthorized - Authentication required
8057
- */
8058
- 401: ApiProblemResponseDto;
8059
- };
8060
- };
8061
- put: {
8062
- req: ImporterConfigControllerUpdateConfigData;
8063
- res: {
8064
- /**
8065
- * Configuration updated successfully
8066
- */
8067
- 200: ImporterConfigDto;
8068
- /**
8069
- * Invalid input - Validation failed
8070
- */
8071
- 400: ApiProblemResponseDto;
8072
- /**
8073
- * Configuration not found
8074
- */
8075
- 404: ApiProblemResponseDto;
8076
- };
8077
- };
8078
- };
8079
- '/api/v1/{region}/bean/import/config/{importerId}/reset': {
8080
- post: {
8081
- req: ImporterConfigControllerResetConfigData;
8082
- res: {
8083
- /**
8084
- * Configuration reset successfully
8085
- */
8086
- 200: ImporterConfigDto;
8087
- /**
8088
- * Invalid input - Unsupported importer
8089
- */
8090
- 400: ApiProblemResponseDto;
8091
- };
8092
- };
8093
- };
8094
- '/api/v1/bean/platforms': {
8095
- get: {
8096
- res: {
8097
- /**
8098
- * List of platforms with binding and account counts
8099
- */
8100
- 200: unknown;
8101
- };
8102
- };
8103
- post: {
8104
- req: PlatformControllerCreateData;
8105
- res: {
8106
- /**
8107
- * Platform created successfully
8108
- */
8109
- 201: unknown;
9108
+ 200: {
9109
+ imported?: number;
9110
+ skipped?: number;
9111
+ failed?: number;
9112
+ accountsCreated?: number;
9113
+ errors?: Array<{
9114
+ [key: string]: unknown;
9115
+ }>;
9116
+ };
8110
9117
  /**
8111
- * Platform already exists
9118
+ * Bad request - invalid file or no file uploaded
8112
9119
  */
8113
- 409: unknown;
9120
+ 400: ApiProblemResponseDto;
8114
9121
  };
8115
9122
  };
8116
9123
  };
8117
- '/api/v1/bean/platforms/list': {
9124
+ '/api/v1/{region}/bean/import/config/{importerId}': {
8118
9125
  get: {
9126
+ req: ImporterConfigControllerGetConfigData;
8119
9127
  res: {
8120
9128
  /**
8121
- * List of platforms with user binding status
9129
+ * Configuration retrieved successfully
8122
9130
  */
8123
- 200: unknown;
8124
- };
8125
- };
8126
- };
8127
- '/api/v1/bean/platforms/match': {
8128
- get: {
8129
- req: PlatformControllerMatchPlatformsData;
8130
- res: {
9131
+ 200: ImporterConfigDto;
8131
9132
  /**
8132
- * List of matching platforms with suggested segment names
9133
+ * Invalid input - Unsupported importer
8133
9134
  */
8134
- 200: unknown;
9135
+ 400: ApiProblemResponseDto;
9136
+ /**
9137
+ * Unauthorized - Authentication required
9138
+ */
9139
+ 401: ApiProblemResponseDto;
8135
9140
  };
8136
9141
  };
8137
- };
8138
- '/api/v1/bean/platforms/{id}': {
8139
9142
  put: {
8140
- req: PlatformControllerUpdateData;
9143
+ req: ImporterConfigControllerUpdateConfigData;
8141
9144
  res: {
8142
9145
  /**
8143
- * Platform updated successfully
9146
+ * Configuration updated successfully
8144
9147
  */
8145
- 200: unknown;
9148
+ 200: ImporterConfigDto;
8146
9149
  /**
8147
- * Platform not found
9150
+ * Invalid input - Validation failed
8148
9151
  */
8149
- 404: unknown;
9152
+ 400: ApiProblemResponseDto;
9153
+ /**
9154
+ * Configuration not found
9155
+ */
9156
+ 404: ApiProblemResponseDto;
8150
9157
  };
8151
9158
  };
8152
- delete: {
8153
- req: PlatformControllerDeleteData;
9159
+ };
9160
+ '/api/v1/{region}/bean/import/config/{importerId}/reset': {
9161
+ post: {
9162
+ req: ImporterConfigControllerResetConfigData;
8154
9163
  res: {
8155
9164
  /**
8156
- * Platform deleted successfully
9165
+ * Configuration reset successfully
8157
9166
  */
8158
- 204: void;
9167
+ 200: ImporterConfigDto;
8159
9168
  /**
8160
- * Platform not found
9169
+ * Invalid input - Unsupported importer
8161
9170
  */
8162
- 404: unknown;
9171
+ 400: ApiProblemResponseDto;
8163
9172
  };
8164
9173
  };
8165
9174
  };
@@ -8216,6 +9225,54 @@ export type $OpenApiTs = {
8216
9225
  };
8217
9226
  };
8218
9227
  };
9228
+ '/api/v1/{region}/bean/external-account-links': {
9229
+ post: {
9230
+ req: ExternalAccountLinkControllerCreateData;
9231
+ res: {
9232
+ /**
9233
+ * Link created.
9234
+ */
9235
+ 201: ExternalAccountLinkResponseDto;
9236
+ /**
9237
+ * beanAccountId not owned, or an active link already exists.
9238
+ */
9239
+ 422: unknown;
9240
+ };
9241
+ };
9242
+ get: {
9243
+ req: ExternalAccountLinkControllerFindAllData;
9244
+ res: {
9245
+ /**
9246
+ * Links retrieved.
9247
+ */
9248
+ 200: ExternalAccountLinkListResponseDto;
9249
+ };
9250
+ };
9251
+ };
9252
+ '/api/v1/{region}/bean/external-account-links/{id}': {
9253
+ get: {
9254
+ req: ExternalAccountLinkControllerFindOneData;
9255
+ res: {
9256
+ /**
9257
+ * Link retrieved.
9258
+ */
9259
+ 200: ExternalAccountLinkResponseDto;
9260
+ /**
9261
+ * Link not found or not owned by the user.
9262
+ */
9263
+ 422: unknown;
9264
+ };
9265
+ };
9266
+ delete: {
9267
+ req: ExternalAccountLinkControllerRemoveData;
9268
+ res: {
9269
+ /**
9270
+ * Link soft-deleted; historical transactions are unaffected.
9271
+ */
9272
+ 204: void;
9273
+ };
9274
+ };
9275
+ };
8219
9276
  '/api/v1/{region}/bean/import/parser-telemetry': {
8220
9277
  post: {
8221
9278
  req: TelemetryControllerReportTelemetryData;
@@ -8304,6 +9361,78 @@ export type $OpenApiTs = {
8304
9361
  };
8305
9362
  };
8306
9363
  };
9364
+ '/api/v1/bean/platforms': {
9365
+ get: {
9366
+ res: {
9367
+ /**
9368
+ * List of platforms with binding and account counts
9369
+ */
9370
+ 200: unknown;
9371
+ };
9372
+ };
9373
+ post: {
9374
+ req: PlatformControllerCreateData;
9375
+ res: {
9376
+ /**
9377
+ * Platform created successfully
9378
+ */
9379
+ 201: unknown;
9380
+ /**
9381
+ * Platform already exists
9382
+ */
9383
+ 409: unknown;
9384
+ };
9385
+ };
9386
+ };
9387
+ '/api/v1/bean/platforms/list': {
9388
+ get: {
9389
+ res: {
9390
+ /**
9391
+ * List of platforms with user binding status
9392
+ */
9393
+ 200: Array<PlatformListItemDto>;
9394
+ };
9395
+ };
9396
+ };
9397
+ '/api/v1/bean/platforms/match': {
9398
+ get: {
9399
+ req: PlatformControllerMatchPlatformsData;
9400
+ res: {
9401
+ /**
9402
+ * List of matching platforms with suggested segment names
9403
+ */
9404
+ 200: unknown;
9405
+ };
9406
+ };
9407
+ };
9408
+ '/api/v1/bean/platforms/{id}': {
9409
+ put: {
9410
+ req: PlatformControllerUpdateData;
9411
+ res: {
9412
+ /**
9413
+ * Platform updated successfully
9414
+ */
9415
+ 200: unknown;
9416
+ /**
9417
+ * Platform not found
9418
+ */
9419
+ 404: unknown;
9420
+ };
9421
+ };
9422
+ delete: {
9423
+ req: PlatformControllerDeleteData;
9424
+ res: {
9425
+ /**
9426
+ * Platform deleted successfully
9427
+ */
9428
+ 204: void;
9429
+ /**
9430
+ * Platform not found
9431
+ */
9432
+ 404: unknown;
9433
+ };
9434
+ };
9435
+ };
8307
9436
  '/api/v1/{region}/dashboard/net-worth': {
8308
9437
  get: {
8309
9438
  req: DashboardControllerGetNetWorthData;
@@ -8356,16 +9485,16 @@ export type $OpenApiTs = {
8356
9485
  };
8357
9486
  };
8358
9487
  };
8359
- '/api/v1/{region}/investment/holdings/pnl': {
9488
+ '/api/v1/{region}/dashboard/expenses': {
8360
9489
  get: {
8361
- req: HoldingPnlControllerGetHoldingPnlData;
9490
+ req: DashboardControllerGetExpensesData;
8362
9491
  res: {
8363
9492
  /**
8364
- * Holding P&L retrieved successfully
9493
+ * Expenses retrieved successfully
8365
9494
  */
8366
- 200: HoldingPnlResponseDto;
9495
+ 200: ExpensesByCategoryResponseDto;
8367
9496
  /**
8368
- * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
9497
+ * Invalid groupBy or period
8369
9498
  */
8370
9499
  400: unknown;
8371
9500
  /**
@@ -8375,98 +9504,48 @@ export type $OpenApiTs = {
8375
9504
  };
8376
9505
  };
8377
9506
  };
8378
- '/api/v1/{region}/bean/prices': {
8379
- post: {
8380
- req: PriceControllerCreateData;
9507
+ '/api/v1/{region}/investment/holdings/pnl': {
9508
+ get: {
9509
+ req: HoldingPnlControllerGetHoldingPnlData;
8381
9510
  res: {
8382
9511
  /**
8383
- * Price created successfully
8384
- */
8385
- 201: PriceResponseDto;
8386
- /**
8387
- * Currency or quoteCurrency commodity not found
9512
+ * Holding P&L retrieved successfully
8388
9513
  */
8389
- 404: unknown;
9514
+ 200: HoldingPnlResponseDto;
8390
9515
  /**
8391
- * Price already exists for this currency pair and date
9516
+ * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
8392
9517
  */
8393
- 409: unknown;
8394
- };
8395
- };
8396
- get: {
8397
- req: PriceControllerFindAllData;
8398
- res: {
9518
+ 400: unknown;
8399
9519
  /**
8400
- * Prices retrieved successfully
9520
+ * User not authenticated
8401
9521
  */
8402
- 200: PriceListResponseDto;
9522
+ 401: unknown;
8403
9523
  };
8404
9524
  };
8405
9525
  };
8406
- '/api/v1/{region}/bean/prices/{id}': {
9526
+ '/api/v1/{region}/reporting/portfolio/trends': {
8407
9527
  get: {
8408
- req: PriceControllerFindOneData;
8409
- res: {
8410
- /**
8411
- * Price retrieved successfully
8412
- */
8413
- 200: PriceResponseDto;
8414
- /**
8415
- * Price not found
8416
- */
8417
- 404: unknown;
8418
- };
8419
- };
8420
- put: {
8421
- req: PriceControllerUpdateData;
8422
- res: {
8423
- /**
8424
- * Price updated successfully
8425
- */
8426
- 200: PriceResponseDto;
8427
- /**
8428
- * Price not found
8429
- */
8430
- 404: unknown;
8431
- /**
8432
- * Updated price conflicts with existing price
8433
- */
8434
- 409: unknown;
8435
- };
8436
- };
8437
- delete: {
8438
- req: PriceControllerDeleteData;
9528
+ req: ReportingControllerGetPortfolioTrendsData;
8439
9529
  res: {
8440
9530
  /**
8441
- * Price deleted successfully
8442
- */
8443
- 204: void;
8444
- /**
8445
- * Price not found
9531
+ * Trends retrieved successfully
8446
9532
  */
8447
- 404: unknown;
8448
- };
8449
- };
8450
- };
8451
- '/api/v1/{region}/bean/prices/bulk': {
8452
- post: {
8453
- req: PriceControllerBulkCreateData;
8454
- res: {
9533
+ 200: PortfolioTrendsResponseDto;
8455
9534
  /**
8456
- * Prices created successfully
9535
+ * User not authenticated
8457
9536
  */
8458
- 201: Array<PriceResponseDto>;
9537
+ 401: unknown;
8459
9538
  };
8460
9539
  };
8461
9540
  };
8462
- '/api/v1/{region}/reporting/portfolio/trends': {
9541
+ '/api/v1/{region}/reporting/cash-flow/trends': {
8463
9542
  get: {
8464
- req: ReportingControllerGetPortfolioTrendsData;
9543
+ req: ReportingControllerGetCashFlowTrendsData;
8465
9544
  res: {
8466
9545
  /**
8467
- * Trends retrieved successfully
9546
+ * Cash-flow trends retrieved successfully
8468
9547
  */
8469
- 200: PortfolioTrendsResponseDto;
9548
+ 200: CashFlowTrendsResponseDto;
8470
9549
  /**
8471
9550
  * User not authenticated
8472
9551
  */