@firela/api-types 0.0.0-canary.c5520a90 → 0.0.0-canary.ce7c9749

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,14 +69,47 @@ 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
  */
87
75
  type: 'Assets' | 'Liabilities' | 'Income' | 'Expenses' | 'Equity';
76
+ /**
77
+ * Account-level asset sub-class (product type, e.g. STOCK/DEPOSIT/CREDIT_CARD/PERSONAL_LOAN). Computed from the account path via the asset-classifier (ADR-0077). Null for non-asset accounts (Income/Expenses/Equity) or unmatched paths.
78
+ */
79
+ assetSubClass?:
80
+ | 'DEPOSIT'
81
+ | 'CASH'
82
+ | 'MONEY_MARKET_FUND'
83
+ | 'STOCK'
84
+ | 'ETF'
85
+ | 'MUTUAL_FUND'
86
+ | 'EQUITY_COMPENSATION'
87
+ | 'GOVERNMENT_BOND'
88
+ | 'CORPORATE_BOND'
89
+ | 'BOND_FUND'
90
+ | 'PRIMARY_RESIDENCE'
91
+ | 'INVESTMENT_PROPERTY'
92
+ | 'REIT'
93
+ | 'GOLD'
94
+ | 'SILVER'
95
+ | 'PRECIOUS_METAL'
96
+ | 'PRECIOUS_METAL_FUND'
97
+ | 'COMMODITY'
98
+ | 'COMMODITY_FUND'
99
+ | 'CRYPTOCURRENCY'
100
+ | 'RETIREMENT_ACCOUNT'
101
+ | 'HEALTH_ACCOUNT'
102
+ | 'EDUCATION_ACCOUNT'
103
+ | 'INSURANCE'
104
+ | 'PRIVATE_EQUITY'
105
+ | 'HEDGE_FUND'
106
+ | 'COLLECTIBLES'
107
+ | 'MORTGAGE'
108
+ | 'STUDENT_LOAN'
109
+ | 'CREDIT_CARD'
110
+ | 'PERSONAL_LOAN'
111
+ | 'OTHER'
112
+ | null;
88
113
  /**
89
114
  * Account status
90
115
  */
@@ -121,17 +146,17 @@ export type AccountResponseDto = {
121
146
  */
122
147
  isCustom: boolean;
123
148
  /**
124
- * i18n key for display name
149
+ * Localized display name (ADR-0114, read-time projection)
125
150
  */
126
- i18nKey?: string;
151
+ displayName?: string;
127
152
  /**
128
153
  * Icon identifier
129
154
  */
130
155
  icon?: string;
131
156
  /**
132
- * Account metadata
157
+ * Open directive metadata (ADR-0115 Decision 9)
133
158
  */
134
- openMeta?: {
159
+ openDirectiveMeta?: {
135
160
  [key: string]: unknown;
136
161
  };
137
162
  /**
@@ -161,6 +186,43 @@ export type AccountResponseDto = {
161
186
  */
162
187
  export type type = 'Assets' | 'Liabilities' | 'Income' | 'Expenses' | 'Equity';
163
188
 
189
+ /**
190
+ * Account-level asset sub-class (product type, e.g. STOCK/DEPOSIT/CREDIT_CARD/PERSONAL_LOAN). Computed from the account path via the asset-classifier (ADR-0077). Null for non-asset accounts (Income/Expenses/Equity) or unmatched paths.
191
+ */
192
+ export type assetSubClass =
193
+ | 'DEPOSIT'
194
+ | 'CASH'
195
+ | 'MONEY_MARKET_FUND'
196
+ | 'STOCK'
197
+ | 'ETF'
198
+ | 'MUTUAL_FUND'
199
+ | 'EQUITY_COMPENSATION'
200
+ | 'GOVERNMENT_BOND'
201
+ | 'CORPORATE_BOND'
202
+ | 'BOND_FUND'
203
+ | 'PRIMARY_RESIDENCE'
204
+ | 'INVESTMENT_PROPERTY'
205
+ | 'REIT'
206
+ | 'GOLD'
207
+ | 'SILVER'
208
+ | 'PRECIOUS_METAL'
209
+ | 'PRECIOUS_METAL_FUND'
210
+ | 'COMMODITY'
211
+ | 'COMMODITY_FUND'
212
+ | 'CRYPTOCURRENCY'
213
+ | 'RETIREMENT_ACCOUNT'
214
+ | 'HEALTH_ACCOUNT'
215
+ | 'EDUCATION_ACCOUNT'
216
+ | 'INSURANCE'
217
+ | 'PRIVATE_EQUITY'
218
+ | 'HEDGE_FUND'
219
+ | 'COLLECTIBLES'
220
+ | 'MORTGAGE'
221
+ | 'STUDENT_LOAN'
222
+ | 'CREDIT_CARD'
223
+ | 'PERSONAL_LOAN'
224
+ | 'OTHER';
225
+
164
226
  /**
165
227
  * Account status
166
228
  */
@@ -178,10 +240,6 @@ export type AccountListResponseDto = {
178
240
  };
179
241
 
180
242
  export type UpdateAccountDto = {
181
- /**
182
- * Display name to distinguish accounts at the same path
183
- */
184
- displayName?: string;
185
243
  /**
186
244
  * Allowed currencies (null = no restriction)
187
245
  */
@@ -197,18 +255,14 @@ export type UpdateAccountDto = {
197
255
  | 'STRICT'
198
256
  | 'STRICT_WITH_SIZE'
199
257
  | 'NONE';
200
- /**
201
- * i18n key for display name
202
- */
203
- i18nKey?: string;
204
258
  /**
205
259
  * Icon identifier
206
260
  */
207
261
  icon?: string;
208
262
  /**
209
- * Additional metadata (merged with existing)
263
+ * Open directive metadata (merged with existing; NOT an opening-balance amount)
210
264
  */
211
- openMeta?: {
265
+ openDirectiveMeta?: {
212
266
  [key: string]: unknown;
213
267
  };
214
268
  /**
@@ -237,6 +291,28 @@ export type ReopenAccountDto = {
237
291
  reopenDate?: string;
238
292
  };
239
293
 
294
+ export type CreateOpeningBalanceDto = {
295
+ /**
296
+ * Opening balance amount (non-negative)
297
+ */
298
+ amount: number;
299
+ /**
300
+ * Currency code
301
+ */
302
+ currency: string;
303
+ /**
304
+ * Opening-balance date (defaults to now)
305
+ */
306
+ date?: string;
307
+ };
308
+
309
+ export type OpeningBalanceResultDto = {
310
+ /**
311
+ * Created opening-balance transaction id.
312
+ */
313
+ transactionId: string;
314
+ };
315
+
240
316
  export type AccountStandardResponseDto = {
241
317
  /**
242
318
  * Account path (hierarchical, colon-separated)
@@ -246,10 +322,6 @@ export type AccountStandardResponseDto = {
246
322
  * Account type in Beancount hierarchy
247
323
  */
248
324
  type: 'Assets' | 'Liabilities' | 'Income' | 'Expenses' | 'Equity';
249
- /**
250
- * i18n key for localized display name
251
- */
252
- i18nKey: string;
253
325
  /**
254
326
  * Short localized display name
255
327
  */
@@ -284,10 +356,6 @@ export type AccountStandardListResponseDto = {
284
356
  };
285
357
 
286
358
  export type TemplateMetadataDto = {
287
- /**
288
- * Whether this path can be extended
289
- */
290
- extendable: boolean;
291
359
  /**
292
360
  * Root account type
293
361
  */
@@ -848,6 +916,51 @@ export type flag2 =
848
916
  */
849
917
  export type status2 = 'ACTIVE' | 'VOIDED' | 'SUPERSEDED';
850
918
 
919
+ export type BalanceByCurrencyDto = {
920
+ /**
921
+ * ISO 4217 currency code
922
+ */
923
+ currency: string;
924
+ /**
925
+ * Balance amount
926
+ */
927
+ balance: string;
928
+ };
929
+
930
+ export type ExchangeRateWarningDto = {
931
+ /**
932
+ * Warning type
933
+ */
934
+ type: string;
935
+ /**
936
+ * Currency without exchange rate
937
+ */
938
+ currency: string;
939
+ /**
940
+ * Total amount affected
941
+ */
942
+ totalAmount: string;
943
+ };
944
+
945
+ export type TransactionListSummaryDto = {
946
+ /**
947
+ * 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.
948
+ */
949
+ totalAmount: string;
950
+ /**
951
+ * Base currency (ISO 4217)
952
+ */
953
+ currency: string;
954
+ /**
955
+ * Raw (unconverted) balance per currency
956
+ */
957
+ balanceByCurrency: Array<BalanceByCurrencyDto>;
958
+ /**
959
+ * Currencies missing an FX rate (omitted when empty)
960
+ */
961
+ warnings?: Array<ExchangeRateWarningDto>;
962
+ };
963
+
851
964
  export type TransactionListResponseDto = {
852
965
  /**
853
966
  * List of transactions
@@ -865,6 +978,10 @@ export type TransactionListResponseDto = {
865
978
  * Number of items skipped
866
979
  */
867
980
  offset: number;
981
+ /**
982
+ * 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.
983
+ */
984
+ summary?: TransactionListSummaryDto;
868
985
  };
869
986
 
870
987
  export type TagSuggestionDto = {
@@ -1917,6 +2034,108 @@ export type UpdateCommodityDto = {
1917
2034
  };
1918
2035
  };
1919
2036
 
2037
+ export type CreateBeanPriceDto = {
2038
+ /**
2039
+ * Currency being priced (e.g., USD, AAPL, BTC)
2040
+ */
2041
+ currency: string;
2042
+ /**
2043
+ * Quote currency (pricing currency, e.g., CNY, EUR)
2044
+ */
2045
+ quoteCurrency: string;
2046
+ /**
2047
+ * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
2048
+ */
2049
+ amount: number;
2050
+ /**
2051
+ * Price date (ISO 8601 format)
2052
+ */
2053
+ date: string;
2054
+ /**
2055
+ * Metadata (validated by Zod schema, max field lengths enforced)
2056
+ */
2057
+ metadata?: {
2058
+ [key: string]: unknown;
2059
+ };
2060
+ };
2061
+
2062
+ export type PriceResponseDto = {
2063
+ /**
2064
+ * Unique identifier
2065
+ */
2066
+ id: string;
2067
+ /**
2068
+ * User ID (owner of the price)
2069
+ */
2070
+ userId: string;
2071
+ /**
2072
+ * Currency being priced (e.g., USD, AAPL, BTC)
2073
+ */
2074
+ currency: string;
2075
+ /**
2076
+ * Quote currency (pricing currency, e.g., USD, CNY)
2077
+ */
2078
+ quoteCurrency: string;
2079
+ /**
2080
+ * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
2081
+ */
2082
+ amount: number;
2083
+ /**
2084
+ * Price date (ISO 8601 format). Represents the date this price was valid.
2085
+ */
2086
+ date: string;
2087
+ /**
2088
+ * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
2089
+ */
2090
+ meta: {
2091
+ [key: string]: unknown;
2092
+ };
2093
+ /**
2094
+ * Creation timestamp
2095
+ */
2096
+ createdAt: string;
2097
+ /**
2098
+ * Last update timestamp
2099
+ */
2100
+ updatedAt: string;
2101
+ };
2102
+
2103
+ export type PriceListResponseDto = {
2104
+ /**
2105
+ * List of prices
2106
+ */
2107
+ items: Array<PriceResponseDto>;
2108
+ /**
2109
+ * Total number of prices
2110
+ */
2111
+ total: number;
2112
+ };
2113
+
2114
+ export type UpdateBeanPriceDto = {
2115
+ /**
2116
+ * Currency being priced
2117
+ */
2118
+ currency?: string;
2119
+ /**
2120
+ * Quote currency (pricing currency)
2121
+ */
2122
+ quoteCurrency?: string;
2123
+ /**
2124
+ * Price amount (MUST be >= 0 per Beancount spec)
2125
+ */
2126
+ amount?: number;
2127
+ /**
2128
+ * Price date (ISO 8601 format)
2129
+ */
2130
+ date?: string;
2131
+ /**
2132
+ * Metadata
2133
+ */
2134
+ metadata?: {
2135
+ [key: string]: unknown;
2136
+ };
2137
+ };
2138
+
1920
2139
  export type CreateRecurringRuleDto = {
1921
2140
  /**
1922
2141
  * Rule name (unique per user)
@@ -2556,511 +2775,705 @@ export type ForecastResponseDto = {
2556
2775
  periodEnd: string;
2557
2776
  };
2558
2777
 
2559
- export type CreateTransactionRuleDto = {
2560
- name: string;
2561
- description?: string;
2562
- narrationKeywords?: Array<unknown[]>;
2563
- payeeKeywords?: Array<unknown[]>;
2564
- categoryKeywords?: Array<unknown[]>;
2778
+ export type CurrencyBalanceDto = {
2565
2779
  /**
2566
- * Payment method keywords (e.g., HuaBei, YuEBao)
2780
+ * ISO 4217 currency code
2567
2781
  */
2568
- methodKeywords?: Array<unknown[]>;
2782
+ currency: string;
2569
2783
  /**
2570
- * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
2784
+ * Balance amount
2571
2785
  */
2572
- categoryAccount?: string;
2573
- matchLogic: 'OR' | 'AND';
2786
+ balance: string;
2787
+ };
2788
+
2789
+ export type TimeSeriesPointDto = {
2574
2790
  /**
2575
- * Minimum transaction amount (inclusive)
2791
+ * Date in YYYY-MM-DD format
2576
2792
  */
2577
- amountMin?: number;
2793
+ date: string;
2578
2794
  /**
2579
- * Maximum transaction amount (inclusive)
2795
+ * Value at this date (in base currency)
2580
2796
  */
2581
- amountMax?: number;
2582
- priority: number;
2583
- additionalTags?: Array<unknown[]>;
2584
- additionalMetadata?: {
2797
+ value: string;
2798
+ /**
2799
+ * Change from previous point
2800
+ */
2801
+ change?: {
2585
2802
  [key: string]: unknown;
2586
2803
  };
2587
2804
  /**
2588
- * If true, update existing rule with matching payeeKeywords[0] instead of creating new rule
2805
+ * Total assets at this date (in base currency)
2589
2806
  */
2590
- upsertByPayee?: boolean;
2591
- };
2592
-
2593
- export type matchLogic = 'OR' | 'AND';
2594
-
2595
- export type AmountRangeDto = {
2807
+ assets?: string;
2596
2808
  /**
2597
- * Minimum amount
2809
+ * Total liabilities at this date (in base currency)
2598
2810
  */
2599
- min?: number;
2811
+ liabilities?: string;
2600
2812
  /**
2601
- * Maximum amount
2813
+ * Multi-currency breakdown for this point
2602
2814
  */
2603
- max?: number;
2815
+ byCurrency?: Array<CurrencyBalanceDto>;
2604
2816
  };
2605
2817
 
2606
- export type TransactionRuleResponseDto = {
2818
+ export type TrendSummaryDto = {
2607
2819
  /**
2608
- * Rule ID
2820
+ * Value at start of period
2609
2821
  */
2610
- id: string;
2822
+ startValue: string;
2611
2823
  /**
2612
- * Rule name
2824
+ * Value at end of period
2613
2825
  */
2614
- name: string;
2826
+ endValue: string;
2615
2827
  /**
2616
- * Rule description
2617
- */
2618
- description?: string;
2619
- /**
2620
- * Keywords to match in transaction narration
2621
- */
2622
- narrationKeywords: Array<string>;
2623
- /**
2624
- * Keywords to match in payee name
2828
+ * Total change over period
2625
2829
  */
2626
- payeeKeywords: Array<string>;
2830
+ totalChange: string;
2627
2831
  /**
2628
- * Keywords to match in category
2832
+ * Total change percentage
2629
2833
  */
2630
- categoryKeywords: Array<string>;
2834
+ totalChangePercentage: string;
2835
+ };
2836
+
2837
+ export type MultiCurrencyPointDto = {
2631
2838
  /**
2632
- * Keywords to match in payment method
2839
+ * Date in YYYY-MM-DD format
2633
2840
  */
2634
- methodKeywords: Array<string>;
2841
+ date: string;
2635
2842
  /**
2636
- * Destination account for categorization
2843
+ * Balances by currency
2637
2844
  */
2638
- categoryAccount?: string;
2845
+ byCurrency: Array<CurrencyBalanceDto>;
2846
+ };
2847
+
2848
+ export type PortfolioTrendsResponseDto = {
2639
2849
  /**
2640
- * Keyword matching logic
2850
+ * Time series data points
2641
2851
  */
2642
- matchLogic: 'OR' | 'AND';
2852
+ series: Array<TimeSeriesPointDto>;
2643
2853
  /**
2644
- * Amount range for matching
2854
+ * Period summary
2645
2855
  */
2646
- amountRange?: AmountRangeDto;
2856
+ summary: TrendSummaryDto;
2647
2857
  /**
2648
- * Rule priority (0-1000, higher = first match)
2858
+ * Period requested
2649
2859
  */
2650
- priority: number;
2860
+ period: string;
2651
2861
  /**
2652
- * Whether the rule is enabled
2862
+ * Data granularity
2653
2863
  */
2654
- enabled: boolean;
2864
+ granularity: string;
2655
2865
  /**
2656
- * Learning source: NLP, REVIEW_CENTER, or null for manual
2866
+ * Base currency for converted values
2657
2867
  */
2658
- learningSource?: 'NLP' | 'REVIEW_CENTER' | null;
2868
+ currency: string;
2659
2869
  /**
2660
- * Whether auto-apply is enabled for this rule
2870
+ * Multi-currency time series (each point has currency breakdown)
2661
2871
  */
2662
- autoApplyEnabled: boolean;
2872
+ byCurrency?: Array<MultiCurrencyPointDto>;
2663
2873
  /**
2664
- * Number of confirmations for NLP-learned rules
2874
+ * Exchange rate warnings
2665
2875
  */
2666
- confirmationCount: number;
2876
+ warnings?: Array<ExchangeRateWarningDto>;
2877
+ };
2878
+
2879
+ export type CashFlowPointDto = {
2667
2880
  /**
2668
- * Additional tags
2881
+ * Month key (YYYY-MM)
2669
2882
  */
2670
- additionalTags: Array<string>;
2883
+ month: string;
2671
2884
  /**
2672
- * Additional metadata
2885
+ * Income in base currency (absolute, converted)
2673
2886
  */
2674
- additionalMetadata?: {
2675
- [key: string]: string;
2676
- };
2887
+ income: string;
2677
2888
  /**
2678
- * Created timestamp
2889
+ * Expense in base currency (absolute, converted)
2679
2890
  */
2680
- createdAt: string;
2891
+ expense: string;
2681
2892
  /**
2682
- * Updated timestamp
2893
+ * netSavings = income − expense (savings positive)
2683
2894
  */
2684
- updatedAt: string;
2895
+ netSavings: string;
2685
2896
  };
2686
2897
 
2687
- /**
2688
- * Learning source: NLP, REVIEW_CENTER, or null for manual
2689
- */
2690
- export type learningSource = 'NLP' | 'REVIEW_CENTER';
2691
-
2692
- export type TransactionRuleListResponseDto = {
2693
- data: Array<TransactionRuleResponseDto>;
2898
+ export type CashFlowTrendSummaryDto = {
2694
2899
  /**
2695
- * Total count of rules
2900
+ * Total income across the period
2696
2901
  */
2697
- total: number;
2902
+ totalIncome: string;
2698
2903
  /**
2699
- * Results per page
2904
+ * Total expense across the period
2700
2905
  */
2701
- limit: number;
2906
+ totalExpense: string;
2702
2907
  /**
2703
- * Pagination offset
2908
+ * income − expense across the period
2704
2909
  */
2705
- offset: number;
2910
+ totalNetSavings: string;
2911
+ /**
2912
+ * totalNetSavings divided by the window length (N months, incl. zero-filled)
2913
+ */
2914
+ averageMonthlyNetSavings: string;
2706
2915
  };
2707
2916
 
2708
- export type ValidateRuleDto = {
2709
- name: string;
2710
- description?: string;
2711
- narrationKeywords?: Array<unknown[]>;
2712
- payeeKeywords?: Array<unknown[]>;
2713
- categoryKeywords?: Array<unknown[]>;
2917
+ export type CashFlowTrendsResponseDto = {
2714
2918
  /**
2715
- * Payment method keywords (e.g., HuaBei, YuEBao)
2919
+ * Monthly cash-flow series (fixed N-month window, zero-filled)
2716
2920
  */
2717
- methodKeywords?: Array<unknown[]>;
2921
+ series: Array<CashFlowPointDto>;
2718
2922
  /**
2719
- * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
2923
+ * Period totals
2720
2924
  */
2721
- categoryAccount?: string;
2722
- matchLogic: 'OR' | 'AND';
2925
+ summary: CashFlowTrendSummaryDto;
2723
2926
  /**
2724
- * Minimum transaction amount (inclusive)
2927
+ * Period requested
2725
2928
  */
2726
- amountMin?: number;
2929
+ period: string;
2727
2930
  /**
2728
- * Maximum transaction amount (inclusive)
2931
+ * Data granularity (v1 returns month buckets)
2729
2932
  */
2730
- amountMax?: number;
2731
- priority: number;
2732
- additionalTags?: Array<unknown[]>;
2733
- additionalMetadata?: {
2734
- [key: string]: unknown;
2735
- };
2933
+ granularity: string;
2736
2934
  /**
2737
- * If true, update existing rule with matching payeeKeywords[0] instead of creating new rule
2935
+ * Base currency for converted values
2738
2936
  */
2739
- upsertByPayee?: boolean;
2740
- };
2741
-
2742
- export type ValidateRuleResponseDto = {
2937
+ currency: string;
2743
2938
  /**
2744
- * Whether the rule configuration is valid
2939
+ * Exchange rate warnings (e.g. missing rate for a currency)
2745
2940
  */
2746
- valid: boolean;
2941
+ warnings?: Array<ExchangeRateWarningDto>;
2942
+ };
2943
+
2944
+ export type GenerateSnapshotBody = unknown;
2945
+
2946
+ export type GenerateSnapshotResponse = unknown;
2947
+
2948
+ export type BackfillSnapshotsBody = unknown;
2949
+
2950
+ export type BackfillSnapshotsResponse = unknown;
2951
+
2952
+ export type DeleteOwnUserDto = {
2747
2953
  /**
2748
- * List of validation errors (empty if valid)
2954
+ * Access token for user verification
2749
2955
  */
2750
- errors: Array<unknown[]>;
2956
+ accessToken: string;
2957
+ };
2958
+
2959
+ export type SignupDto = {
2751
2960
  /**
2752
- * List of validation warnings (non-blocking issues)
2961
+ * Cloudflare Turnstile verification token (optional when Turnstile disabled)
2753
2962
  */
2754
- warnings: Array<unknown[]>;
2963
+ turnstileToken?: string;
2755
2964
  };
2756
2965
 
2757
- export type BulkCreateRulesDto = {
2966
+ export type SignupResponseDto = {
2758
2967
  /**
2759
- * Array of rules to import
2968
+ * JWT auth token
2760
2969
  */
2761
- rules: Array<unknown[]>;
2970
+ authToken: string;
2762
2971
  /**
2763
- * Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule
2972
+ * Auto-generated access token
2764
2973
  */
2765
- conflictStrategy: 'replace' | 'skip';
2974
+ accessToken: string;
2975
+ /**
2976
+ * Assigned user role
2977
+ */
2978
+ role: 'USER' | 'ADMIN' | 'DEMO' | 'INACTIVE' | 'PAID' | 'OPS';
2766
2979
  };
2767
2980
 
2768
2981
  /**
2769
- * Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule
2982
+ * Assigned user role
2770
2983
  */
2771
- export type conflictStrategy = 'replace' | 'skip';
2984
+ export type role = 'USER' | 'ADMIN' | 'DEMO' | 'INACTIVE' | 'PAID' | 'OPS';
2772
2985
 
2773
- export type BulkCreateRulesResponseDto = {
2986
+ export type UpdateUserSettingDto = {
2774
2987
  /**
2775
- * Number of successfully created rules
2988
+ * Security ID
2776
2989
  */
2777
- successCount: number;
2990
+ secId?: number;
2778
2991
  /**
2779
- * Number of failed rules
2992
+ * Annual interest rate
2780
2993
  */
2781
- failureCount: number;
2994
+ annualInterestRate?: number;
2782
2995
  /**
2783
- * Error details for failed rules
2996
+ * Currency code
2784
2997
  */
2785
- errors: Array<{
2786
- index?: number;
2787
- message?: string;
2788
- }>;
2998
+ currency?: string;
2789
2999
  /**
2790
- * IDs of successfully created rules
3000
+ * Base currency code
2791
3001
  */
2792
- createdRuleIds: Array<string>;
2793
- };
2794
-
2795
- export type ExportRulesResponseDto = {
3002
+ baseCurrency?: string;
2796
3003
  /**
2797
- * Export timestamp
3004
+ * Benchmark symbol
2798
3005
  */
2799
- exportedAt: string;
3006
+ benchmark?: string;
2800
3007
  /**
2801
- * User ID
3008
+ * Color scheme
2802
3009
  */
2803
- userId: string;
3010
+ colorScheme?: 'DARK' | 'LIGHT';
2804
3011
  /**
2805
- * Number of exported rules
3012
+ * Date range filter
2806
3013
  */
2807
- ruleCount: number;
3014
+ dateRange?: string;
2808
3015
  /**
2809
- * Exported rules
3016
+ * Emergency fund amount
2810
3017
  */
2811
- rules: unknown[];
2812
- };
2813
-
2814
- export type RuleStatisticsResponseDto = {
3018
+ emergencyFund?: number;
2815
3019
  /**
2816
- * Statistics time period
3020
+ * Account filter IDs
2817
3021
  */
2818
- period: '7d' | '30d' | '90d';
3022
+ 'filters.accounts'?: Array<string>;
2819
3023
  /**
2820
- * Total number of rules
3024
+ * Asset class filters
2821
3025
  */
2822
- totalRules: number;
3026
+ 'filters.assetClasses'?: Array<string>;
2823
3027
  /**
2824
- * Number of rules with at least one match
3028
+ * Data source filter
2825
3029
  */
2826
- rulesWithMatches: number;
3030
+ 'filters.dataSource'?: string;
2827
3031
  /**
2828
- * Total number of matches across all rules
3032
+ * Symbol filter
2829
3033
  */
2830
- totalMatches: number;
3034
+ 'filters.symbol'?: string;
2831
3035
  /**
2832
- * Average confidence score across all matches
3036
+ * Tag filters
2833
3037
  */
2834
- averageConfidence: number;
3038
+ 'filters.tags'?: Array<string>;
2835
3039
  /**
2836
- * Per-rule statistics
3040
+ * Enable experimental features
2837
3041
  */
2838
- ruleStats: Array<{
2839
- ruleId?: string;
2840
- ruleName?: string;
2841
- matchCount?: number;
2842
- averageConfidence?: number;
2843
- }>;
2844
- };
2845
-
2846
- /**
2847
- * Statistics time period
2848
- */
2849
- export type period = '7d' | '30d' | '90d';
2850
-
2851
- export type UpdateTransactionRuleDto = {
2852
- name?: string;
2853
- description?: string;
2854
- narrationKeywords?: Array<unknown[]>;
2855
- payeeKeywords?: Array<unknown[]>;
2856
- categoryKeywords?: Array<unknown[]>;
3042
+ isExperimentalFeatures?: boolean;
2857
3043
  /**
2858
- * Payment method keywords (e.g., HuaBei, YuEBao)
3044
+ * Enable restricted view mode
2859
3045
  */
2860
- methodKeywords?: Array<unknown[]>;
3046
+ isRestrictedView?: boolean;
2861
3047
  /**
2862
- * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
3048
+ * Language code
2863
3049
  */
2864
- categoryAccount?: string;
2865
- matchLogic?: 'OR' | 'AND';
3050
+ language?: string;
2866
3051
  /**
2867
- * Minimum transaction amount (inclusive)
3052
+ * Locale code
2868
3053
  */
2869
- amountMin?: number;
3054
+ locale?: string;
2870
3055
  /**
2871
- * Maximum transaction amount (inclusive)
3056
+ * Projected total amount
2872
3057
  */
2873
- amountMax?: number;
2874
- priority?: number;
3058
+ projectedTotalAmount?: number;
2875
3059
  /**
2876
- * Enable or disable the rule
3060
+ * Retirement date in ISO 8601 format
2877
3061
  */
2878
- enabled?: boolean;
2879
- additionalTags?: Array<unknown[]>;
2880
- additionalMetadata?: {
2881
- [key: string]: unknown;
2882
- };
3062
+ retirementDate?: string;
3063
+ /**
3064
+ * Savings rate percentage
3065
+ */
3066
+ savingsRate?: number;
3067
+ /**
3068
+ * View mode
3069
+ */
3070
+ viewMode?: 'DEFAULT' | 'ZEN';
2883
3071
  };
2884
3072
 
2885
- export type TestRuleDto = {
2886
- narration: string;
2887
- payee?: string;
2888
- categoryAccount?: string;
2889
- amount?: number;
2890
- currency?: string;
3073
+ /**
3074
+ * Color scheme
3075
+ */
3076
+ export type colorScheme = 'DARK' | 'LIGHT';
3077
+
3078
+ /**
3079
+ * View mode
3080
+ */
3081
+ export type viewMode = 'DEFAULT' | 'ZEN';
3082
+
3083
+ export type UpdatePropertyDto = {
3084
+ /**
3085
+ * Property value
3086
+ */
3087
+ value: string;
2891
3088
  };
2892
3089
 
2893
- export type TestRuleResponseDto = {
3090
+ export type CreateTransactionRuleDto = {
3091
+ name: string;
3092
+ description?: string;
3093
+ narrationKeywords?: Array<unknown[]>;
3094
+ payeeKeywords?: Array<unknown[]>;
3095
+ categoryKeywords?: Array<unknown[]>;
2894
3096
  /**
2895
- * Rule ID that was tested
3097
+ * Payment method keywords (e.g., HuaBei, YuEBao)
2896
3098
  */
2897
- ruleId: string;
3099
+ methodKeywords?: Array<unknown[]>;
2898
3100
  /**
2899
- * Whether the rule matched the test data
3101
+ * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
2900
3102
  */
2901
- matches: boolean;
3103
+ categoryAccount?: string;
3104
+ matchLogic: 'OR' | 'AND';
2902
3105
  /**
2903
- * Match confidence score (0-1)
3106
+ * Minimum transaction amount (inclusive)
2904
3107
  */
2905
- confidence: number;
3108
+ amountMin?: number;
2906
3109
  /**
2907
- * Details of which fields matched
3110
+ * Maximum transaction amount (inclusive)
2908
3111
  */
2909
- matchDetails: {
3112
+ amountMax?: number;
3113
+ priority: number;
3114
+ additionalTags?: Array<unknown[]>;
3115
+ additionalMetadata?: {
2910
3116
  [key: string]: unknown;
2911
3117
  };
2912
- };
2913
-
2914
- export type DeleteOwnUserDto = {
2915
3118
  /**
2916
- * Access token for user verification
3119
+ * If true, update existing rule with matching payeeKeywords[0] instead of creating new rule
2917
3120
  */
2918
- accessToken: string;
3121
+ upsertByPayee?: boolean;
2919
3122
  };
2920
3123
 
2921
- export type SignupDto = {
2922
- /**
2923
- * Cloudflare Turnstile verification token (optional when Turnstile disabled)
2924
- */
2925
- turnstileToken?: string;
2926
- };
3124
+ export type matchLogic = 'OR' | 'AND';
2927
3125
 
2928
- export type UpdateUserSettingDto = {
3126
+ export type AmountRangeDto = {
2929
3127
  /**
2930
- * Security ID
3128
+ * Minimum amount
2931
3129
  */
2932
- secId?: number;
3130
+ min?: number;
2933
3131
  /**
2934
- * Annual interest rate
3132
+ * Maximum amount
2935
3133
  */
2936
- annualInterestRate?: number;
3134
+ max?: number;
3135
+ };
3136
+
3137
+ export type TransactionRuleResponseDto = {
2937
3138
  /**
2938
- * Currency code
3139
+ * Rule ID
2939
3140
  */
2940
- currency?: string;
3141
+ id: string;
2941
3142
  /**
2942
- * Base currency code
3143
+ * Rule name
2943
3144
  */
2944
- baseCurrency?: string;
3145
+ name: string;
2945
3146
  /**
2946
- * Benchmark symbol
3147
+ * Rule description
2947
3148
  */
2948
- benchmark?: string;
3149
+ description?: string;
2949
3150
  /**
2950
- * Color scheme
3151
+ * Keywords to match in transaction narration
2951
3152
  */
2952
- colorScheme?: 'DARK' | 'LIGHT';
3153
+ narrationKeywords: Array<string>;
2953
3154
  /**
2954
- * Date range filter
3155
+ * Keywords to match in payee name
2955
3156
  */
2956
- dateRange?: string;
3157
+ payeeKeywords: Array<string>;
2957
3158
  /**
2958
- * Emergency fund amount
3159
+ * Keywords to match in category
2959
3160
  */
2960
- emergencyFund?: number;
3161
+ categoryKeywords: Array<string>;
2961
3162
  /**
2962
- * Account filter IDs
3163
+ * Keywords to match in payment method
2963
3164
  */
2964
- 'filters.accounts'?: Array<string>;
3165
+ methodKeywords: Array<string>;
2965
3166
  /**
2966
- * Asset class filters
3167
+ * Destination account for categorization
2967
3168
  */
2968
- 'filters.assetClasses'?: Array<string>;
3169
+ categoryAccount?: string;
2969
3170
  /**
2970
- * Data source filter
3171
+ * Keyword matching logic
2971
3172
  */
2972
- 'filters.dataSource'?: string;
3173
+ matchLogic: 'OR' | 'AND';
2973
3174
  /**
2974
- * Symbol filter
3175
+ * Amount range for matching
2975
3176
  */
2976
- 'filters.symbol'?: string;
3177
+ amountRange?: AmountRangeDto;
2977
3178
  /**
2978
- * Tag filters
3179
+ * Rule priority (0-1000, higher = first match)
2979
3180
  */
2980
- 'filters.tags'?: Array<string>;
3181
+ priority: number;
2981
3182
  /**
2982
- * Enable experimental features
3183
+ * Whether the rule is enabled
2983
3184
  */
2984
- isExperimentalFeatures?: boolean;
3185
+ enabled: boolean;
2985
3186
  /**
2986
- * Enable restricted view mode
3187
+ * Learning source: NLP, REVIEW_CENTER, or null for manual
2987
3188
  */
2988
- isRestrictedView?: boolean;
3189
+ learningSource?: 'NLP' | 'REVIEW_CENTER' | null;
2989
3190
  /**
2990
- * Language code
3191
+ * Whether auto-apply is enabled for this rule
2991
3192
  */
2992
- language?: string;
3193
+ autoApplyEnabled: boolean;
2993
3194
  /**
2994
- * Locale code
3195
+ * Number of confirmations for NLP-learned rules
2995
3196
  */
2996
- locale?: string;
3197
+ confirmationCount: number;
2997
3198
  /**
2998
- * Projected total amount
3199
+ * Additional tags
2999
3200
  */
3000
- projectedTotalAmount?: number;
3201
+ additionalTags: Array<string>;
3001
3202
  /**
3002
- * Retirement date in ISO 8601 format
3203
+ * Additional metadata
3003
3204
  */
3004
- retirementDate?: string;
3205
+ additionalMetadata?: {
3206
+ [key: string]: string;
3207
+ };
3005
3208
  /**
3006
- * Savings rate percentage
3209
+ * Created timestamp
3007
3210
  */
3008
- savingsRate?: number;
3211
+ createdAt: string;
3009
3212
  /**
3010
- * View mode
3213
+ * Updated timestamp
3011
3214
  */
3012
- viewMode?: 'DEFAULT' | 'ZEN';
3215
+ updatedAt: string;
3013
3216
  };
3014
3217
 
3015
3218
  /**
3016
- * Color scheme
3017
- */
3018
- export type colorScheme = 'DARK' | 'LIGHT';
3019
-
3020
- /**
3021
- * View mode
3219
+ * Learning source: NLP, REVIEW_CENTER, or null for manual
3022
3220
  */
3023
- export type viewMode = 'DEFAULT' | 'ZEN';
3221
+ export type learningSource = 'NLP' | 'REVIEW_CENTER';
3024
3222
 
3025
- export type UpdatePropertyDto = {
3223
+ export type TransactionRuleListResponseDto = {
3224
+ data: Array<TransactionRuleResponseDto>;
3026
3225
  /**
3027
- * Property value
3226
+ * Total count of rules
3028
3227
  */
3029
- value: string;
3228
+ total: number;
3229
+ /**
3230
+ * Results per page
3231
+ */
3232
+ limit: number;
3233
+ /**
3234
+ * Pagination offset
3235
+ */
3236
+ offset: number;
3030
3237
  };
3031
3238
 
3032
- export type CreateBeanEventDto = {
3239
+ export type ValidateRuleDto = {
3240
+ name: string;
3241
+ description?: string;
3242
+ narrationKeywords?: Array<unknown[]>;
3243
+ payeeKeywords?: Array<unknown[]>;
3244
+ categoryKeywords?: Array<unknown[]>;
3033
3245
  /**
3034
- * Life event date (ISO 8601)
3246
+ * Payment method keywords (e.g., HuaBei, YuEBao)
3035
3247
  */
3036
- date: string;
3248
+ methodKeywords?: Array<unknown[]>;
3037
3249
  /**
3038
- * Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer
3250
+ * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
3039
3251
  */
3040
- type: string;
3252
+ categoryAccount?: string;
3253
+ matchLogic: 'OR' | 'AND';
3041
3254
  /**
3042
- * Life event description. Empty string is a VALID value (distinct from absence).
3255
+ * Minimum transaction amount (inclusive)
3043
3256
  */
3044
- description: string;
3257
+ amountMin?: number;
3045
3258
  /**
3046
- * Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)
3259
+ * Maximum transaction amount (inclusive)
3047
3260
  */
3048
- meta?: {
3261
+ amountMax?: number;
3262
+ priority: number;
3263
+ additionalTags?: Array<unknown[]>;
3264
+ additionalMetadata?: {
3049
3265
  [key: string]: unknown;
3050
3266
  };
3267
+ /**
3268
+ * If true, update existing rule with matching payeeKeywords[0] instead of creating new rule
3269
+ */
3270
+ upsertByPayee?: boolean;
3051
3271
  };
3052
3272
 
3053
- export type EventResponseDto = {
3273
+ export type ValidateRuleResponseDto = {
3054
3274
  /**
3055
- * Unique identifier
3275
+ * Whether the rule configuration is valid
3056
3276
  */
3057
- id: string;
3277
+ valid: boolean;
3058
3278
  /**
3059
- * User ID (owner of the life event)
3279
+ * List of validation errors (empty if valid)
3060
3280
  */
3061
- userId: string;
3281
+ errors: Array<unknown[]>;
3062
3282
  /**
3063
- * Life event date (ISO 8601 format)
3283
+ * List of validation warnings (non-blocking issues)
3284
+ */
3285
+ warnings: Array<unknown[]>;
3286
+ };
3287
+
3288
+ export type BulkCreateRulesDto = {
3289
+ /**
3290
+ * Array of rules to import
3291
+ */
3292
+ rules: Array<unknown[]>;
3293
+ /**
3294
+ * Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule
3295
+ */
3296
+ conflictStrategy: 'replace' | 'skip';
3297
+ };
3298
+
3299
+ /**
3300
+ * Conflict handling strategy: skip (default) ignores duplicates, replace soft-deletes existing rule
3301
+ */
3302
+ export type conflictStrategy = 'replace' | 'skip';
3303
+
3304
+ export type BulkCreateRulesResponseDto = {
3305
+ /**
3306
+ * Number of successfully created rules
3307
+ */
3308
+ successCount: number;
3309
+ /**
3310
+ * Number of failed rules
3311
+ */
3312
+ failureCount: number;
3313
+ /**
3314
+ * Error details for failed rules
3315
+ */
3316
+ errors: Array<{
3317
+ index?: number;
3318
+ message?: string;
3319
+ }>;
3320
+ /**
3321
+ * IDs of successfully created rules
3322
+ */
3323
+ createdRuleIds: Array<string>;
3324
+ };
3325
+
3326
+ export type ExportRulesResponseDto = {
3327
+ /**
3328
+ * Export timestamp
3329
+ */
3330
+ exportedAt: string;
3331
+ /**
3332
+ * User ID
3333
+ */
3334
+ userId: string;
3335
+ /**
3336
+ * Number of exported rules
3337
+ */
3338
+ ruleCount: number;
3339
+ /**
3340
+ * Exported rules
3341
+ */
3342
+ rules: unknown[];
3343
+ };
3344
+
3345
+ export type RuleStatisticsResponseDto = {
3346
+ /**
3347
+ * Statistics time period
3348
+ */
3349
+ period: '7d' | '30d' | '90d';
3350
+ /**
3351
+ * Total number of rules
3352
+ */
3353
+ totalRules: number;
3354
+ /**
3355
+ * Number of rules with at least one match
3356
+ */
3357
+ rulesWithMatches: number;
3358
+ /**
3359
+ * Total number of matches across all rules
3360
+ */
3361
+ totalMatches: number;
3362
+ /**
3363
+ * Average confidence score across all matches
3364
+ */
3365
+ averageConfidence: number;
3366
+ /**
3367
+ * Per-rule statistics
3368
+ */
3369
+ ruleStats: Array<{
3370
+ ruleId?: string;
3371
+ ruleName?: string;
3372
+ matchCount?: number;
3373
+ averageConfidence?: number;
3374
+ }>;
3375
+ };
3376
+
3377
+ /**
3378
+ * Statistics time period
3379
+ */
3380
+ export type period = '7d' | '30d' | '90d';
3381
+
3382
+ export type UpdateTransactionRuleDto = {
3383
+ name?: string;
3384
+ description?: string;
3385
+ narrationKeywords?: Array<unknown[]>;
3386
+ payeeKeywords?: Array<unknown[]>;
3387
+ categoryKeywords?: Array<unknown[]>;
3388
+ /**
3389
+ * Payment method keywords (e.g., HuaBei, YuEBao)
3390
+ */
3391
+ methodKeywords?: Array<unknown[]>;
3392
+ /**
3393
+ * Destination account for expenses/income (e.g., Expenses:Food:Coffee)
3394
+ */
3395
+ categoryAccount?: string;
3396
+ matchLogic?: 'OR' | 'AND';
3397
+ /**
3398
+ * Minimum transaction amount (inclusive)
3399
+ */
3400
+ amountMin?: number;
3401
+ /**
3402
+ * Maximum transaction amount (inclusive)
3403
+ */
3404
+ amountMax?: number;
3405
+ priority?: number;
3406
+ /**
3407
+ * Enable or disable the rule
3408
+ */
3409
+ enabled?: boolean;
3410
+ additionalTags?: Array<unknown[]>;
3411
+ additionalMetadata?: {
3412
+ [key: string]: unknown;
3413
+ };
3414
+ };
3415
+
3416
+ export type TestRuleDto = {
3417
+ narration: string;
3418
+ payee?: string;
3419
+ categoryAccount?: string;
3420
+ amount?: number;
3421
+ currency?: string;
3422
+ };
3423
+
3424
+ export type TestRuleResponseDto = {
3425
+ /**
3426
+ * Rule ID that was tested
3427
+ */
3428
+ ruleId: string;
3429
+ /**
3430
+ * Whether the rule matched the test data
3431
+ */
3432
+ matches: boolean;
3433
+ /**
3434
+ * Match confidence score (0-1)
3435
+ */
3436
+ confidence: number;
3437
+ /**
3438
+ * Details of which fields matched
3439
+ */
3440
+ matchDetails: {
3441
+ [key: string]: unknown;
3442
+ };
3443
+ };
3444
+
3445
+ export type CreateBeanEventDto = {
3446
+ /**
3447
+ * Life event date (ISO 8601)
3448
+ */
3449
+ date: string;
3450
+ /**
3451
+ * Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer
3452
+ */
3453
+ type: string;
3454
+ /**
3455
+ * Life event description. Empty string is a VALID value (distinct from absence).
3456
+ */
3457
+ description: string;
3458
+ /**
3459
+ * Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)
3460
+ */
3461
+ meta?: {
3462
+ [key: string]: unknown;
3463
+ };
3464
+ };
3465
+
3466
+ export type EventResponseDto = {
3467
+ /**
3468
+ * Unique identifier
3469
+ */
3470
+ id: string;
3471
+ /**
3472
+ * User ID (owner of the life event)
3473
+ */
3474
+ userId: string;
3475
+ /**
3476
+ * Life event date (ISO 8601 format)
3064
3477
  */
3065
3478
  date: string;
3066
3479
  /**
@@ -3119,81 +3532,235 @@ export type UpdateBeanEventDto = {
3119
3532
  };
3120
3533
  };
3121
3534
 
3122
- export type FileImportDto = {
3535
+ export type OnboardingAccountDto = {
3123
3536
  /**
3124
- * Bill file to import (CSV, PDF, OFX, etc.)
3537
+ * Account path (Assets/Liabilities only; format validated by the account service)
3125
3538
  */
3126
- file: Blob | File;
3539
+ path: string;
3540
+ /**
3541
+ * ISO 4217 currency code (3 letters)
3542
+ */
3543
+ currency: string;
3544
+ /**
3545
+ * Opening balance as a non-negative Decimal string (e.g. "1000.00")
3546
+ */
3547
+ openingBalance?: string;
3548
+ /**
3549
+ * Platform ID to bind the account to (references Platform.id); omit for unbound
3550
+ */
3551
+ platformId?: string;
3127
3552
  };
3128
3553
 
3129
- export type ImportErrorDto = {
3554
+ export type OnboardingDto = {
3130
3555
  /**
3131
- * Index of failed transaction in the file
3556
+ * Asset/Liability accounts to register with opening balances
3132
3557
  */
3133
- index: number;
3558
+ accounts?: Array<OnboardingAccountDto>;
3134
3559
  /**
3135
- * Error message
3560
+ * Skip asset registration; only bootstrap the core account set
3136
3561
  */
3137
- error: string;
3562
+ skipAssetRegistration?: boolean;
3138
3563
  };
3139
3564
 
3140
- export type ReviewItemPreviewDto = {
3565
+ export type ActualBalanceDto = {
3141
3566
  /**
3142
- * Index in the import batch (for tracking)
3567
+ * Actual balance amount as a decimal string (preserves precision for tolerance inference).
3143
3568
  */
3144
- index: number;
3569
+ amount: string;
3145
3570
  /**
3146
- * Transaction date (ISO format)
3571
+ * Currency code (ISO 4217 or commodity ticker).
3147
3572
  */
3148
- date: string;
3573
+ ccy: string;
3574
+ };
3575
+
3576
+ export type ComputeReconciliationDto = {
3149
3577
  /**
3150
- * Transaction amount (absolute value)
3578
+ * BeanAccount id to reconcile.
3151
3579
  */
3152
- amount?: number;
3580
+ accountId: string;
3153
3581
  /**
3154
- * Currency code
3582
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3155
3583
  */
3156
- currency?: string;
3584
+ asOfDate: string;
3157
3585
  /**
3158
- * Transaction narration/description
3586
+ * Actual balance from the external statement.
3159
3587
  */
3160
- narration: string;
3588
+ actualBalance: ActualBalanceDto;
3589
+ };
3590
+
3591
+ export type ReconciliationComputeResultDto = {
3592
+ accountId: string;
3593
+ asOfDate: string;
3161
3594
  /**
3162
- * Payee name
3595
+ * System-computed book balance (decimal string).
3163
3596
  */
3164
- payee?: string;
3597
+ bookBalance: string;
3165
3598
  /**
3166
- * Inferred category from rule matching
3599
+ * User-entered actual balance (decimal string).
3167
3600
  */
3168
- category?: string;
3601
+ actualBalance: string;
3602
+ currency: string;
3169
3603
  /**
3170
- * Confidence score for the match (0-1)
3604
+ * Diff = book − actual (decimal string).
3171
3605
  */
3172
- confidence?: number;
3606
+ diff: string;
3173
3607
  /**
3174
- * Type of branch requiring review
3608
+ * Applied tolerance (decimal string).
3175
3609
  */
3176
- branchType?:
3177
- | 'DUPLICATE'
3178
- | 'PAYEE_MATCH'
3179
- | 'RULE_MATCH'
3180
- | 'ACCOUNT_VALIDATION'
3181
- | 'PIPELINE_ERROR';
3610
+ tolerance: string;
3182
3611
  /**
3183
- * Human-readable reasons for requiring review
3612
+ * true when |diff| ≤ tolerance.
3184
3613
  */
3185
- reasons?: Array<string>;
3614
+ withinTolerance: boolean;
3615
+ /**
3616
+ * Suggested next action: assert when within tolerance, pad otherwise.
3617
+ */
3618
+ suggestedAction: 'assert' | 'pad';
3186
3619
  };
3187
3620
 
3188
3621
  /**
3189
- * Type of branch requiring review
3622
+ * Suggested next action: assert when within tolerance, pad otherwise.
3190
3623
  */
3191
- export type branchType =
3192
- | 'DUPLICATE'
3193
- | 'PAYEE_MATCH'
3194
- | 'RULE_MATCH'
3195
- | 'ACCOUNT_VALIDATION'
3196
- | 'PIPELINE_ERROR';
3624
+ export type suggestedAction = 'assert' | 'pad';
3625
+
3626
+ export type AssertReconciliationDto = {
3627
+ /**
3628
+ * BeanAccount id to reconcile.
3629
+ */
3630
+ accountId: string;
3631
+ /**
3632
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3633
+ */
3634
+ asOfDate: string;
3635
+ /**
3636
+ * Actual balance from the external statement.
3637
+ */
3638
+ actualBalance: ActualBalanceDto;
3639
+ /**
3640
+ * Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).
3641
+ */
3642
+ tolerance?: string;
3643
+ };
3644
+
3645
+ export type ReconciliationRecordDto = {
3646
+ id: string;
3647
+ accountId: string;
3648
+ date: string;
3649
+ /**
3650
+ * Asserted (actual) amount.
3651
+ */
3652
+ amount: string;
3653
+ currency: string;
3654
+ tolerance?: string;
3655
+ /**
3656
+ * book − actual.
3657
+ */
3658
+ diffAmount?: string;
3659
+ diffCurrency?: string;
3660
+ createdAt: string;
3661
+ };
3662
+
3663
+ export type PadReconciliationDto = {
3664
+ /**
3665
+ * BeanAccount id to reconcile.
3666
+ */
3667
+ accountId: string;
3668
+ /**
3669
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3670
+ */
3671
+ asOfDate: string;
3672
+ /**
3673
+ * Actual balance from the external statement.
3674
+ */
3675
+ actualBalance: ActualBalanceDto;
3676
+ /**
3677
+ * Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).
3678
+ */
3679
+ sourceAccount?: string;
3680
+ };
3681
+
3682
+ export type PadResultDto = {
3683
+ /**
3684
+ * Created pad adjusting transaction id.
3685
+ */
3686
+ transactionId: string;
3687
+ };
3688
+
3689
+ export type FileImportDto = {
3690
+ /**
3691
+ * Bill file to import (CSV, PDF, OFX, etc.)
3692
+ */
3693
+ file: Blob | File;
3694
+ };
3695
+
3696
+ export type ImportErrorDto = {
3697
+ /**
3698
+ * Index of failed transaction in the file
3699
+ */
3700
+ index: number;
3701
+ /**
3702
+ * Error message
3703
+ */
3704
+ error: string;
3705
+ };
3706
+
3707
+ export type ReviewItemPreviewDto = {
3708
+ /**
3709
+ * Index in the import batch (for tracking)
3710
+ */
3711
+ index: number;
3712
+ /**
3713
+ * Transaction date (ISO format)
3714
+ */
3715
+ date: string;
3716
+ /**
3717
+ * Transaction amount (absolute value)
3718
+ */
3719
+ amount?: number;
3720
+ /**
3721
+ * Currency code
3722
+ */
3723
+ currency?: string;
3724
+ /**
3725
+ * Transaction narration/description
3726
+ */
3727
+ narration: string;
3728
+ /**
3729
+ * Payee name
3730
+ */
3731
+ payee?: string;
3732
+ /**
3733
+ * Inferred category from rule matching
3734
+ */
3735
+ category?: string;
3736
+ /**
3737
+ * Confidence score for the match (0-1)
3738
+ */
3739
+ confidence?: number;
3740
+ /**
3741
+ * Type of branch requiring review
3742
+ */
3743
+ branchType?:
3744
+ | 'DUPLICATE'
3745
+ | 'PAYEE_MATCH'
3746
+ | 'RULE_MATCH'
3747
+ | 'ACCOUNT_VALIDATION'
3748
+ | 'PIPELINE_ERROR';
3749
+ /**
3750
+ * Human-readable reasons for requiring review
3751
+ */
3752
+ reasons?: Array<string>;
3753
+ };
3754
+
3755
+ /**
3756
+ * Type of branch requiring review
3757
+ */
3758
+ export type branchType =
3759
+ | 'DUPLICATE'
3760
+ | 'PAYEE_MATCH'
3761
+ | 'RULE_MATCH'
3762
+ | 'ACCOUNT_VALIDATION'
3763
+ | 'PIPELINE_ERROR';
3197
3764
 
3198
3765
  export type ImportResultDto = {
3199
3766
  /**
@@ -3417,94 +3984,6 @@ export type UpdateImporterConfigDto = {
3417
3984
  data?: UpdateConfigDataDto;
3418
3985
  };
3419
3986
 
3420
- export type CreatePlatformDto = {
3421
- /**
3422
- * Platform name
3423
- */
3424
- name: string;
3425
- /**
3426
- * Platform canonical identifier (lowercase, kebab-case)
3427
- */
3428
- canonical: string;
3429
- /**
3430
- * Platform aliases (multi-language names for lookup)
3431
- */
3432
- aliases: Array<string>;
3433
- /**
3434
- * Platform URL
3435
- */
3436
- url: string;
3437
- /**
3438
- * Platform type
3439
- */
3440
- type:
3441
- | 'BANK'
3442
- | 'BROKERAGE'
3443
- | 'CRYPTO_EXCHANGE'
3444
- | 'PAYMENT'
3445
- | 'INVESTMENT'
3446
- | 'INSURANCE'
3447
- | 'OTHER';
3448
- /**
3449
- * Platform logo URL
3450
- */
3451
- logoUrl?: string;
3452
- /**
3453
- * Whether the platform is active
3454
- */
3455
- isActive?: boolean;
3456
- };
3457
-
3458
- /**
3459
- * Platform type
3460
- */
3461
- export type type3 =
3462
- | 'BANK'
3463
- | 'BROKERAGE'
3464
- | 'CRYPTO_EXCHANGE'
3465
- | 'PAYMENT'
3466
- | 'INVESTMENT'
3467
- | 'INSURANCE'
3468
- | 'OTHER';
3469
-
3470
- export type UpdatePlatformDto = {
3471
- /**
3472
- * Platform name
3473
- */
3474
- name?: string;
3475
- /**
3476
- * Platform canonical identifier (lowercase, kebab-case)
3477
- */
3478
- canonical?: string;
3479
- /**
3480
- * Platform aliases (multi-language names for lookup)
3481
- */
3482
- aliases?: Array<string>;
3483
- /**
3484
- * Platform URL
3485
- */
3486
- url?: string;
3487
- /**
3488
- * Platform type
3489
- */
3490
- type?:
3491
- | 'BANK'
3492
- | 'BROKERAGE'
3493
- | 'CRYPTO_EXCHANGE'
3494
- | 'PAYMENT'
3495
- | 'INVESTMENT'
3496
- | 'INSURANCE'
3497
- | 'OTHER';
3498
- /**
3499
- * Platform logo URL
3500
- */
3501
- logoUrl?: string;
3502
- /**
3503
- * Whether the platform is active
3504
- */
3505
- isActive?: boolean;
3506
- };
3507
-
3508
3987
  export type ProviderSyncConfigDto = {
3509
3988
  /**
3510
3989
  * Source account for the first posting
@@ -3526,6 +4005,10 @@ export type ProviderSyncConfigDto = {
3526
4005
  * Filter pending transactions
3527
4006
  */
3528
4007
  filterPending?: boolean;
4008
+ /**
4009
+ * External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.
4010
+ */
4011
+ externalAccountId?: string;
3529
4012
  };
3530
4013
 
3531
4014
  export type ProviderSyncDto = {
@@ -3581,6 +4064,61 @@ export type SupportedProvidersResponseDto = {
3581
4064
  providers: Array<string>;
3582
4065
  };
3583
4066
 
4067
+ export type CreateExternalAccountLinkDto = {
4068
+ /**
4069
+ * Open Banking provider (whitelist)
4070
+ */
4071
+ provider:
4072
+ | 'plaid'
4073
+ | 'teller'
4074
+ | 'truelayer'
4075
+ | 'gocardless'
4076
+ | 'simplefin'
4077
+ | 'yodlee'
4078
+ | 'beancount-direct'
4079
+ | 'parsed-bill';
4080
+ /**
4081
+ * External account ID from the provider
4082
+ */
4083
+ externalAccountId: string;
4084
+ /**
4085
+ * Target BeanAccount ID (must belong to the JWT user)
4086
+ */
4087
+ beanAccountId: string;
4088
+ };
4089
+
4090
+ /**
4091
+ * Open Banking provider (whitelist)
4092
+ */
4093
+ export type provider =
4094
+ | 'plaid'
4095
+ | 'teller'
4096
+ | 'truelayer'
4097
+ | 'gocardless'
4098
+ | 'simplefin'
4099
+ | 'yodlee'
4100
+ | 'beancount-direct'
4101
+ | 'parsed-bill';
4102
+
4103
+ export type ExternalAccountLinkResponseDto = {
4104
+ id: string;
4105
+ provider: string;
4106
+ externalAccountId: string;
4107
+ beanAccountId: string;
4108
+ isActive: boolean;
4109
+ createdAt: string;
4110
+ updatedAt: string;
4111
+ };
4112
+
4113
+ export type ExternalAccountLinkListResponseDto = {
4114
+ items: Array<ExternalAccountLinkResponseDto>;
4115
+ total: number;
4116
+ /**
4117
+ * Filter by provider (query param)
4118
+ */
4119
+ provider?: string;
4120
+ };
4121
+
3584
4122
  export type ParserTelemetryReportDto = unknown;
3585
4123
 
3586
4124
  export type UncoveredFormatMissDto = unknown;
@@ -4024,7 +4562,8 @@ export type NlpResponseDto = {
4024
4562
  | 'confirm_rule'
4025
4563
  | 'confirm_account'
4026
4564
  | 'confirm_payee'
4027
- | 'cancel';
4565
+ | 'cancel'
4566
+ | 'aborted';
4028
4567
  /**
4029
4568
  * Transaction intent detected by EntityRouter (v6.0: 5 core intents). Frontend uses this to render scenario-specific form fields.
4030
4569
  */
@@ -4138,7 +4677,8 @@ export type action2 =
4138
4677
  | 'confirm_rule'
4139
4678
  | 'confirm_account'
4140
4679
  | 'confirm_payee'
4141
- | 'cancel';
4680
+ | 'cancel'
4681
+ | 'aborted';
4142
4682
 
4143
4683
  /**
4144
4684
  * Transaction intent detected by EntityRouter (v6.0: 5 core intents). Frontend uses this to render scenario-specific form fields.
@@ -4160,26 +4700,212 @@ export type liabilitySubType = 'borrow' | 'repay';
4160
4700
  */
4161
4701
  export type equitySubType = 'opening' | 'adjustment';
4162
4702
 
4163
- export type BalanceByCurrencyDto = {
4703
+ export type PlatformListItemDto = {
4164
4704
  /**
4165
- * ISO 4217 currency code
4705
+ * Global platform ID
4166
4706
  */
4167
- currency: string;
4707
+ id: string;
4168
4708
  /**
4169
- * Balance amount
4709
+ * Platform name
4170
4710
  */
4171
- balance: string;
4172
- };
4173
-
4174
- export type NetWorthByCurrencyDto = {
4711
+ name: string;
4175
4712
  /**
4176
- * Net worth by currency
4713
+ * Platform URL
4177
4714
  */
4178
- netWorth: Array<BalanceByCurrencyDto>;
4715
+ url: string;
4179
4716
  /**
4180
- * Assets by currency
4717
+ * Platform type
4181
4718
  */
4182
- assets: Array<BalanceByCurrencyDto>;
4719
+ type:
4720
+ | 'BANK'
4721
+ | 'BROKERAGE'
4722
+ | 'CRYPTO_EXCHANGE'
4723
+ | 'PAYMENT'
4724
+ | 'INVESTMENT'
4725
+ | 'INSURANCE'
4726
+ | 'OTHER';
4727
+ /**
4728
+ * Canonical identifier in ACCOUNT_RE format (e.g., "icbc")
4729
+ */
4730
+ canonical: string;
4731
+ /**
4732
+ * Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)
4733
+ */
4734
+ suggestedSegment: string;
4735
+ /**
4736
+ * Logo URL
4737
+ */
4738
+ logoUrl: string | null;
4739
+ /**
4740
+ * Whether user has accounts using this platform
4741
+ */
4742
+ isBound: boolean;
4743
+ };
4744
+
4745
+ /**
4746
+ * Platform type
4747
+ */
4748
+ export type type3 =
4749
+ | 'BANK'
4750
+ | 'BROKERAGE'
4751
+ | 'CRYPTO_EXCHANGE'
4752
+ | 'PAYMENT'
4753
+ | 'INVESTMENT'
4754
+ | 'INSURANCE'
4755
+ | 'OTHER';
4756
+
4757
+ export type PlatformMatchResultDto = {
4758
+ /**
4759
+ * Global platform ID
4760
+ */
4761
+ id: string;
4762
+ /**
4763
+ * Platform name (e.g., "ICBC")
4764
+ */
4765
+ name: string;
4766
+ /**
4767
+ * Canonical identifier in ACCOUNT_RE format (e.g., "icbc")
4768
+ */
4769
+ canonical: string;
4770
+ /**
4771
+ * Platform type
4772
+ */
4773
+ type:
4774
+ | 'BANK'
4775
+ | 'BROKERAGE'
4776
+ | 'CRYPTO_EXCHANGE'
4777
+ | 'PAYMENT'
4778
+ | 'INVESTMENT'
4779
+ | 'INSURANCE'
4780
+ | 'OTHER';
4781
+ /**
4782
+ * Suggested path segment — canonical, already in ACCOUNT_RE format
4783
+ */
4784
+ suggestedSegment: string;
4785
+ /**
4786
+ * Logo URL
4787
+ */
4788
+ logoUrl: string | null;
4789
+ /**
4790
+ * How this row matched: 'exact' > 'prefix' > 'substring'
4791
+ */
4792
+ matchType: 'exact' | 'prefix' | 'substring';
4793
+ };
4794
+
4795
+ /**
4796
+ * How this row matched: 'exact' > 'prefix' > 'substring'
4797
+ */
4798
+ export type matchType = 'exact' | 'prefix' | 'substring';
4799
+
4800
+ export type PlatformMatchResponseDto = {
4801
+ /**
4802
+ * Ranked matches, best tier first (at most 10 rows)
4803
+ */
4804
+ platforms: Array<PlatformMatchResultDto>;
4805
+ /**
4806
+ * Overall match quality — top row's tier, or 'none' when no hits
4807
+ */
4808
+ matchType: 'none' | 'exact' | 'prefix' | 'substring';
4809
+ /**
4810
+ * Total matches before LIMIT (truncation transparency)
4811
+ */
4812
+ total: number;
4813
+ /**
4814
+ * true when total > platforms.length (more matches exist)
4815
+ */
4816
+ hasMore: boolean;
4817
+ };
4818
+
4819
+ /**
4820
+ * Overall match quality — top row's tier, or 'none' when no hits
4821
+ */
4822
+ export type matchType2 = 'none' | 'exact' | 'prefix' | 'substring';
4823
+
4824
+ export type CreatePlatformDto = {
4825
+ /**
4826
+ * Platform name
4827
+ */
4828
+ name: string;
4829
+ /**
4830
+ * Platform canonical identifier (lowercase, kebab-case)
4831
+ */
4832
+ canonical: string;
4833
+ /**
4834
+ * Platform aliases (multi-language names for lookup)
4835
+ */
4836
+ aliases: Array<string>;
4837
+ /**
4838
+ * Platform URL
4839
+ */
4840
+ url: string;
4841
+ /**
4842
+ * Platform type
4843
+ */
4844
+ type:
4845
+ | 'BANK'
4846
+ | 'BROKERAGE'
4847
+ | 'CRYPTO_EXCHANGE'
4848
+ | 'PAYMENT'
4849
+ | 'INVESTMENT'
4850
+ | 'INSURANCE'
4851
+ | 'OTHER';
4852
+ /**
4853
+ * Platform logo URL
4854
+ */
4855
+ logoUrl?: string;
4856
+ /**
4857
+ * Whether the platform is active
4858
+ */
4859
+ isActive?: boolean;
4860
+ };
4861
+
4862
+ export type UpdatePlatformDto = {
4863
+ /**
4864
+ * Platform name
4865
+ */
4866
+ name?: string;
4867
+ /**
4868
+ * Platform canonical identifier (lowercase, kebab-case)
4869
+ */
4870
+ canonical?: string;
4871
+ /**
4872
+ * Platform aliases (multi-language names for lookup)
4873
+ */
4874
+ aliases?: Array<string>;
4875
+ /**
4876
+ * Platform URL
4877
+ */
4878
+ url?: string;
4879
+ /**
4880
+ * Platform type
4881
+ */
4882
+ type?:
4883
+ | 'BANK'
4884
+ | 'BROKERAGE'
4885
+ | 'CRYPTO_EXCHANGE'
4886
+ | 'PAYMENT'
4887
+ | 'INVESTMENT'
4888
+ | 'INSURANCE'
4889
+ | 'OTHER';
4890
+ /**
4891
+ * Platform logo URL
4892
+ */
4893
+ logoUrl?: string;
4894
+ /**
4895
+ * Whether the platform is active
4896
+ */
4897
+ isActive?: boolean;
4898
+ };
4899
+
4900
+ export type NetWorthByCurrencyDto = {
4901
+ /**
4902
+ * Net worth by currency
4903
+ */
4904
+ netWorth: Array<BalanceByCurrencyDto>;
4905
+ /**
4906
+ * Assets by currency
4907
+ */
4908
+ assets: Array<BalanceByCurrencyDto>;
4183
4909
  /**
4184
4910
  * Liabilities by currency
4185
4911
  */
@@ -4211,21 +4937,6 @@ export type ConvertedNetWorthDto = {
4211
4937
  };
4212
4938
  };
4213
4939
 
4214
- export type ExchangeRateWarningDto = {
4215
- /**
4216
- * Warning type
4217
- */
4218
- type: string;
4219
- /**
4220
- * Currency without exchange rate
4221
- */
4222
- currency: string;
4223
- /**
4224
- * Total amount affected
4225
- */
4226
- totalAmount: string;
4227
- };
4228
-
4229
4940
  export type NetWorthResponseDto = {
4230
4941
  /**
4231
4942
  * Total net worth (assets - liabilities, converted to base currency)
@@ -4290,6 +5001,10 @@ export type AccountItemDto = {
4290
5001
  * Currency code
4291
5002
  */
4292
5003
  currency: string;
5004
+ /**
5005
+ * FX-converted balance in base currency; omitted when not convertible
5006
+ */
5007
+ convertedBalance?: string;
4293
5008
  };
4294
5009
 
4295
5010
  export type PlatformGroupDto = {
@@ -4393,6 +5108,10 @@ export type AccountItemWithAssetClassDto = {
4393
5108
  * Currency code
4394
5109
  */
4395
5110
  currency: string;
5111
+ /**
5112
+ * FX-converted balance in base currency; omitted when not convertible
5113
+ */
5114
+ convertedBalance?: string;
4396
5115
  /**
4397
5116
  * Asset class
4398
5117
  */
@@ -4868,304 +5587,28 @@ export type HoldingPnlWarningDto = {
4868
5587
  */
4869
5588
  export type type4 =
4870
5589
  | 'MISSING_COST_FX_RATE'
4871
- | 'MISSING_MARKET_FX_RATE'
4872
- | 'MISSING_SALE_PRICE'
4873
- | 'MISSING_REALIZED_FX_RATE'
4874
- | 'OVERSOLD_LOTS'
4875
- | 'NO_PRICE'
4876
- | 'MIXED_COST_CURRENCY';
4877
-
4878
- export type HoldingPnlResponseDto = {
4879
- asOfDate: string;
4880
- baseCurrency: string;
4881
- /**
4882
- * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4883
- */
4884
- method: 'average' | 'FIFO';
4885
- rows: Array<HoldingPnlRowDto>;
4886
- warnings: Array<HoldingPnlWarningDto>;
4887
- };
4888
-
4889
- /**
4890
- * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
4891
- */
4892
- export type method = 'average' | 'FIFO';
4893
-
4894
- export type CreateBeanPriceDto = {
4895
- /**
4896
- * Currency being priced (e.g., USD, AAPL, BTC)
4897
- */
4898
- currency: string;
4899
- /**
4900
- * Quote currency (pricing currency, e.g., CNY, EUR)
4901
- */
4902
- quoteCurrency: string;
4903
- /**
4904
- * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
4905
- */
4906
- amount: number;
4907
- /**
4908
- * Price date (ISO 8601 format)
4909
- */
4910
- date: string;
4911
- /**
4912
- * Metadata (validated by Zod schema, max field lengths enforced)
4913
- */
4914
- metadata?: {
4915
- [key: string]: unknown;
4916
- };
4917
- };
4918
-
4919
- export type PriceResponseDto = {
4920
- /**
4921
- * Unique identifier
4922
- */
4923
- id: string;
4924
- /**
4925
- * User ID (owner of the price)
4926
- */
4927
- userId: string;
4928
- /**
4929
- * Currency being priced (e.g., USD, AAPL, BTC)
4930
- */
4931
- currency: string;
4932
- /**
4933
- * Quote currency (pricing currency, e.g., USD, CNY)
4934
- */
4935
- quoteCurrency: string;
4936
- /**
4937
- * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
4938
- */
4939
- amount: number;
4940
- /**
4941
- * Price date (ISO 8601 format). Represents the date this price was valid.
4942
- */
4943
- date: string;
4944
- /**
4945
- * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
4946
- */
4947
- meta: {
4948
- [key: string]: unknown;
4949
- };
4950
- /**
4951
- * Creation timestamp
4952
- */
4953
- createdAt: string;
4954
- /**
4955
- * Last update timestamp
4956
- */
4957
- updatedAt: string;
4958
- };
4959
-
4960
- export type PriceListResponseDto = {
4961
- /**
4962
- * List of prices
4963
- */
4964
- items: Array<PriceResponseDto>;
4965
- /**
4966
- * Total number of prices
4967
- */
4968
- total: number;
4969
- };
4970
-
4971
- export type UpdateBeanPriceDto = {
4972
- /**
4973
- * Currency being priced
4974
- */
4975
- currency?: string;
4976
- /**
4977
- * Quote currency (pricing currency)
4978
- */
4979
- quoteCurrency?: string;
4980
- /**
4981
- * Price amount (MUST be >= 0 per Beancount spec)
4982
- */
4983
- amount?: number;
4984
- /**
4985
- * Price date (ISO 8601 format)
4986
- */
4987
- date?: string;
4988
- /**
4989
- * Metadata
4990
- */
4991
- metadata?: {
4992
- [key: string]: unknown;
4993
- };
4994
- };
4995
-
4996
- export type CurrencyBalanceDto = {
4997
- /**
4998
- * ISO 4217 currency code
4999
- */
5000
- currency: string;
5001
- /**
5002
- * Balance amount
5003
- */
5004
- balance: string;
5005
- };
5006
-
5007
- export type TimeSeriesPointDto = {
5008
- /**
5009
- * Date in YYYY-MM-DD format
5010
- */
5011
- date: string;
5012
- /**
5013
- * Value at this date (in base currency)
5014
- */
5015
- value: string;
5016
- /**
5017
- * Change from previous point
5018
- */
5019
- change?: {
5020
- [key: string]: unknown;
5021
- };
5022
- /**
5023
- * Total assets at this date (in base currency)
5024
- */
5025
- assets?: string;
5026
- /**
5027
- * Total liabilities at this date (in base currency)
5028
- */
5029
- liabilities?: string;
5030
- /**
5031
- * Multi-currency breakdown for this point
5032
- */
5033
- byCurrency?: Array<CurrencyBalanceDto>;
5034
- };
5035
-
5036
- export type TrendSummaryDto = {
5037
- /**
5038
- * Value at start of period
5039
- */
5040
- startValue: string;
5041
- /**
5042
- * Value at end of period
5043
- */
5044
- endValue: string;
5045
- /**
5046
- * Total change over period
5047
- */
5048
- totalChange: string;
5049
- /**
5050
- * Total change percentage
5051
- */
5052
- totalChangePercentage: string;
5053
- };
5054
-
5055
- export type MultiCurrencyPointDto = {
5056
- /**
5057
- * Date in YYYY-MM-DD format
5058
- */
5059
- date: string;
5060
- /**
5061
- * Balances by currency
5062
- */
5063
- byCurrency: Array<CurrencyBalanceDto>;
5064
- };
5065
-
5066
- export type PortfolioTrendsResponseDto = {
5067
- /**
5068
- * Time series data points
5069
- */
5070
- series: Array<TimeSeriesPointDto>;
5071
- /**
5072
- * Period summary
5073
- */
5074
- summary: TrendSummaryDto;
5075
- /**
5076
- * Period requested
5077
- */
5078
- period: string;
5079
- /**
5080
- * Data granularity
5081
- */
5082
- granularity: string;
5083
- /**
5084
- * Base currency for converted values
5085
- */
5086
- currency: string;
5087
- /**
5088
- * Multi-currency time series (each point has currency breakdown)
5089
- */
5090
- byCurrency?: Array<MultiCurrencyPointDto>;
5091
- /**
5092
- * Exchange rate warnings
5093
- */
5094
- warnings?: Array<ExchangeRateWarningDto>;
5095
- };
5096
-
5097
- export type CashFlowPointDto = {
5098
- /**
5099
- * Month key (YYYY-MM)
5100
- */
5101
- month: string;
5102
- /**
5103
- * Income in base currency (absolute, converted)
5104
- */
5105
- income: string;
5106
- /**
5107
- * Expense in base currency (absolute, converted)
5108
- */
5109
- expense: string;
5110
- /**
5111
- * netSavings = income − expense (savings positive)
5112
- */
5113
- netSavings: string;
5114
- };
5115
-
5116
- export type CashFlowTrendSummaryDto = {
5117
- /**
5118
- * Total income across the period
5119
- */
5120
- totalIncome: string;
5121
- /**
5122
- * Total expense across the period
5123
- */
5124
- totalExpense: string;
5125
- /**
5126
- * income − expense across the period
5127
- */
5128
- totalNetSavings: string;
5129
- /**
5130
- * totalNetSavings divided by the window length (N months, incl. zero-filled)
5131
- */
5132
- averageMonthlyNetSavings: string;
5133
- };
5134
-
5135
- export type CashFlowTrendsResponseDto = {
5136
- /**
5137
- * Monthly cash-flow series (fixed N-month window, zero-filled)
5138
- */
5139
- series: Array<CashFlowPointDto>;
5140
- /**
5141
- * Period totals
5142
- */
5143
- summary: CashFlowTrendSummaryDto;
5144
- /**
5145
- * Period requested
5146
- */
5147
- period: string;
5148
- /**
5149
- * Data granularity (v1 returns month buckets)
5150
- */
5151
- granularity: string;
5152
- /**
5153
- * Base currency for converted values
5154
- */
5155
- currency: string;
5590
+ | 'MISSING_MARKET_FX_RATE'
5591
+ | 'MISSING_SALE_PRICE'
5592
+ | 'MISSING_REALIZED_FX_RATE'
5593
+ | 'OVERSOLD_LOTS'
5594
+ | 'NO_PRICE'
5595
+ | 'MIXED_COST_CURRENCY';
5596
+
5597
+ export type HoldingPnlResponseDto = {
5598
+ asOfDate: string;
5599
+ baseCurrency: string;
5156
5600
  /**
5157
- * Exchange rate warnings (e.g. missing rate for a currency)
5601
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
5158
5602
  */
5159
- warnings?: Array<ExchangeRateWarningDto>;
5603
+ method: 'average' | 'FIFO';
5604
+ rows: Array<HoldingPnlRowDto>;
5605
+ warnings: Array<HoldingPnlWarningDto>;
5160
5606
  };
5161
5607
 
5162
- export type GenerateSnapshotBody = unknown;
5163
-
5164
- export type GenerateSnapshotResponse = unknown;
5165
-
5166
- export type BackfillSnapshotsBody = unknown;
5167
-
5168
- export type BackfillSnapshotsResponse = unknown;
5608
+ /**
5609
+ * Realized-P&L lot-matching method (FIFO or average). Unrealized cost basis remains average regardless of this value (#473).
5610
+ */
5611
+ export type method = 'average' | 'FIFO';
5169
5612
 
5170
5613
  export type AnonymousLoginDto = {
5171
5614
  /**
@@ -5174,6 +5617,13 @@ export type AnonymousLoginDto = {
5174
5617
  accessToken: string;
5175
5618
  };
5176
5619
 
5620
+ export type AnonymousLoginResponseDto = {
5621
+ /**
5622
+ * JWT auth token
5623
+ */
5624
+ authToken: string;
5625
+ };
5626
+
5177
5627
  export type AccountControllerCreateData = {
5178
5628
  /**
5179
5629
  * Region code for tenant context
@@ -5202,7 +5652,7 @@ export type AccountControllerFindAllData = {
5202
5652
  */
5203
5653
  region: 'cn' | 'us' | 'de' | 'gb';
5204
5654
  /**
5205
- * Search term for path or i18nKey
5655
+ * Search term for account path
5206
5656
  */
5207
5657
  search?: string;
5208
5658
  /**
@@ -5285,6 +5735,21 @@ export type AccountControllerReopenData = {
5285
5735
 
5286
5736
  export type AccountControllerReopenResponse = AccountResponseDto;
5287
5737
 
5738
+ export type AccountControllerAddOpeningBalanceData = {
5739
+ /**
5740
+ * Account UUID
5741
+ */
5742
+ id: string;
5743
+ /**
5744
+ * Region code for tenant context
5745
+ */
5746
+ region: 'cn' | 'us' | 'de' | 'gb';
5747
+ requestBody: CreateOpeningBalanceDto;
5748
+ };
5749
+
5750
+ export type AccountControllerAddOpeningBalanceResponse =
5751
+ OpeningBalanceResultDto;
5752
+
5288
5753
  export type AccountStandardsControllerGetTemplatesData = {
5289
5754
  /**
5290
5755
  * Region code (cn, us, de)
@@ -5473,7 +5938,7 @@ export type TransactionControllerDeleteResponse = void;
5473
5938
 
5474
5939
  export type BalanceControllerGetBalanceData = {
5475
5940
  /**
5476
- * Account name (e.g., "Assets:Bank:Checking")
5941
+ * Account name (e.g., "Assets:Checking")
5477
5942
  */
5478
5943
  account: string;
5479
5944
  /**
@@ -5875,6 +6340,103 @@ export type CommodityControllerBulkCreateData = {
5875
6340
 
5876
6341
  export type CommodityControllerBulkCreateResponse = Array<CommodityResponseDto>;
5877
6342
 
6343
+ export type PriceControllerCreateData = {
6344
+ /**
6345
+ * Region code for tenant context
6346
+ */
6347
+ region: 'cn' | 'us' | 'de' | 'gb';
6348
+ requestBody: CreateBeanPriceDto;
6349
+ };
6350
+
6351
+ export type PriceControllerCreateResponse = PriceResponseDto;
6352
+
6353
+ export type PriceControllerFindAllData = {
6354
+ /**
6355
+ * Filter by currency (e.g., BTC, AAPL, USD)
6356
+ */
6357
+ currency?: string;
6358
+ /**
6359
+ * Filter prices from this date (ISO 8601 format)
6360
+ */
6361
+ dateFrom?: string;
6362
+ /**
6363
+ * Filter prices to this date (ISO 8601 format)
6364
+ */
6365
+ dateTo?: string;
6366
+ /**
6367
+ * Number of items per page (default: 20, max: 100)
6368
+ */
6369
+ limit?: number;
6370
+ /**
6371
+ * Page number for pagination (default: 1)
6372
+ */
6373
+ page?: number;
6374
+ /**
6375
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6376
+ */
6377
+ quoteCurrency?: string;
6378
+ /**
6379
+ * Region code for tenant context
6380
+ */
6381
+ region: 'cn' | 'us' | 'de' | 'gb';
6382
+ /**
6383
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6384
+ */
6385
+ search?: string;
6386
+ };
6387
+
6388
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6389
+
6390
+ export type PriceControllerFindOneData = {
6391
+ /**
6392
+ * Price ID
6393
+ */
6394
+ id: string;
6395
+ /**
6396
+ * Region code for tenant context
6397
+ */
6398
+ region: 'cn' | 'us' | 'de' | 'gb';
6399
+ };
6400
+
6401
+ export type PriceControllerFindOneResponse = PriceResponseDto;
6402
+
6403
+ export type PriceControllerUpdateData = {
6404
+ /**
6405
+ * Price ID
6406
+ */
6407
+ id: string;
6408
+ /**
6409
+ * Region code for tenant context
6410
+ */
6411
+ region: 'cn' | 'us' | 'de' | 'gb';
6412
+ requestBody: UpdateBeanPriceDto;
6413
+ };
6414
+
6415
+ export type PriceControllerUpdateResponse = PriceResponseDto;
6416
+
6417
+ export type PriceControllerDeleteData = {
6418
+ /**
6419
+ * Price ID
6420
+ */
6421
+ id: string;
6422
+ /**
6423
+ * Region code for tenant context
6424
+ */
6425
+ region: 'cn' | 'us' | 'de' | 'gb';
6426
+ };
6427
+
6428
+ export type PriceControllerDeleteResponse = void;
6429
+
6430
+ export type PriceControllerBulkCreateData = {
6431
+ /**
6432
+ * Region code for tenant context
6433
+ */
6434
+ region: 'cn' | 'us' | 'de' | 'gb';
6435
+ requestBody: Array<string>;
6436
+ };
6437
+
6438
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
6439
+
5878
6440
  export type RecurringRuleControllerCreateData = {
5879
6441
  /**
5880
6442
  * Region code for tenant context
@@ -6014,99 +6576,247 @@ export type ExpectedTransactionControllerFindOverdueResponse =
6014
6576
 
6015
6577
  export type ExpectedTransactionControllerFindOneData = {
6016
6578
  /**
6017
- * Expected transaction ID
6579
+ * Expected transaction ID
6580
+ */
6581
+ id: string;
6582
+ /**
6583
+ * Region code for tenant context
6584
+ */
6585
+ region: 'cn' | 'us' | 'de' | 'gb';
6586
+ };
6587
+
6588
+ export type ExpectedTransactionControllerFindOneResponse =
6589
+ ExpectedTransactionResponseDto;
6590
+
6591
+ export type ExpectedTransactionControllerSkipData = {
6592
+ /**
6593
+ * Expected transaction ID
6594
+ */
6595
+ id: string;
6596
+ /**
6597
+ * Region code for tenant context
6598
+ */
6599
+ region: 'cn' | 'us' | 'de' | 'gb';
6600
+ };
6601
+
6602
+ export type ExpectedTransactionControllerSkipResponse =
6603
+ ExpectedTransactionResponseDto;
6604
+
6605
+ export type ExpectedTransactionControllerUndoSkipData = {
6606
+ /**
6607
+ * Expected transaction ID
6608
+ */
6609
+ id: string;
6610
+ /**
6611
+ * Region code for tenant context
6612
+ */
6613
+ region: 'cn' | 'us' | 'de' | 'gb';
6614
+ };
6615
+
6616
+ export type ExpectedTransactionControllerUndoSkipResponse =
6617
+ ExpectedTransactionResponseDto;
6618
+
6619
+ export type ExpectedTransactionControllerConfirmMatchData = {
6620
+ /**
6621
+ * Expected transaction ID
6622
+ */
6623
+ id: string;
6624
+ /**
6625
+ * Region code for tenant context
6626
+ */
6627
+ region: 'cn' | 'us' | 'de' | 'gb';
6628
+ requestBody: ConfirmMatchDto;
6629
+ };
6630
+
6631
+ export type ExpectedTransactionControllerConfirmMatchResponse = unknown;
6632
+
6633
+ export type ExpectedTransactionControllerUnmatchData = {
6634
+ /**
6635
+ * Expected transaction ID
6636
+ */
6637
+ id: string;
6638
+ /**
6639
+ * Region code for tenant context
6640
+ */
6641
+ region: 'cn' | 'us' | 'de' | 'gb';
6642
+ };
6643
+
6644
+ export type ExpectedTransactionControllerUnmatchResponse = unknown;
6645
+
6646
+ export type ExpectedTransactionControllerEnterNowData = {
6647
+ /**
6648
+ * Expected transaction ID
6649
+ */
6650
+ id: string;
6651
+ /**
6652
+ * Region code for tenant context
6653
+ */
6654
+ region: 'cn' | 'us' | 'de' | 'gb';
6655
+ requestBody: EnterNowDto;
6656
+ };
6657
+
6658
+ export type ExpectedTransactionControllerEnterNowResponse = unknown;
6659
+
6660
+ export type ForecastControllerGetForecastData = {
6661
+ /**
6662
+ * Number of months to forecast (1-12, default 3)
6663
+ */
6664
+ months?: number;
6665
+ /**
6666
+ * Region code for tenant context
6667
+ */
6668
+ region: 'cn' | 'us' | 'de' | 'gb';
6669
+ };
6670
+
6671
+ export type ForecastControllerGetForecastResponse = ForecastResponseDto;
6672
+
6673
+ export type ReportingControllerGetPortfolioTrendsData = {
6674
+ /**
6675
+ * Data granularity
6676
+ */
6677
+ granularity?: 'day' | 'week' | 'month';
6678
+ /**
6679
+ * Time period
6680
+ */
6681
+ period?: '1m' | '3m' | '6m' | '1y';
6682
+ /**
6683
+ * Region code for tenant context
6684
+ */
6685
+ region: 'cn' | 'us' | 'de' | 'gb';
6686
+ };
6687
+
6688
+ export type ReportingControllerGetPortfolioTrendsResponse =
6689
+ PortfolioTrendsResponseDto;
6690
+
6691
+ export type ReportingControllerGetCashFlowTrendsData = {
6692
+ /**
6693
+ * Data granularity (accepted for API symmetry; v1 returns month buckets)
6694
+ */
6695
+ granularity?: 'day' | 'week' | 'month';
6696
+ /**
6697
+ * Time period
6018
6698
  */
6019
- id: string;
6699
+ period?: '1m' | '3m' | '6m' | '1y';
6020
6700
  /**
6021
6701
  * Region code for tenant context
6022
6702
  */
6023
6703
  region: 'cn' | 'us' | 'de' | 'gb';
6024
6704
  };
6025
6705
 
6026
- export type ExpectedTransactionControllerFindOneResponse =
6027
- ExpectedTransactionResponseDto;
6706
+ export type ReportingControllerGetCashFlowTrendsResponse =
6707
+ CashFlowTrendsResponseDto;
6028
6708
 
6029
- export type ExpectedTransactionControllerSkipData = {
6030
- /**
6031
- * Expected transaction ID
6032
- */
6033
- id: string;
6709
+ export type ReportingControllerGenerateSnapshotData = {
6034
6710
  /**
6035
6711
  * Region code for tenant context
6036
6712
  */
6037
6713
  region: 'cn' | 'us' | 'de' | 'gb';
6714
+ /**
6715
+ * Optional date (defaults to today)
6716
+ */
6717
+ requestBody: GenerateSnapshotBody;
6038
6718
  };
6039
6719
 
6040
- export type ExpectedTransactionControllerSkipResponse =
6041
- ExpectedTransactionResponseDto;
6720
+ export type ReportingControllerGenerateSnapshotResponse =
6721
+ GenerateSnapshotResponse;
6042
6722
 
6043
- export type ExpectedTransactionControllerUndoSkipData = {
6044
- /**
6045
- * Expected transaction ID
6046
- */
6047
- id: string;
6723
+ export type ReportingControllerBackfillSnapshotsData = {
6048
6724
  /**
6049
6725
  * Region code for tenant context
6050
6726
  */
6051
6727
  region: 'cn' | 'us' | 'de' | 'gb';
6728
+ requestBody: BackfillSnapshotsBody;
6052
6729
  };
6053
6730
 
6054
- export type ExpectedTransactionControllerUndoSkipResponse =
6055
- ExpectedTransactionResponseDto;
6731
+ export type ReportingControllerBackfillSnapshotsResponse =
6732
+ BackfillSnapshotsResponse;
6056
6733
 
6057
- export type ExpectedTransactionControllerConfirmMatchData = {
6734
+ export type UserControllerDeleteOwnUserData = {
6735
+ requestBody: DeleteOwnUserDto;
6736
+ };
6737
+
6738
+ export type UserControllerDeleteOwnUserResponse = void;
6739
+
6740
+ export type UserControllerGetUserData = {
6741
+ acceptLanguage: string;
6742
+ };
6743
+
6744
+ export type UserControllerGetUserResponse = unknown;
6745
+
6746
+ export type UserControllerSignupUserData = {
6747
+ requestBody: SignupDto;
6748
+ };
6749
+
6750
+ export type UserControllerSignupUserResponse = SignupResponseDto;
6751
+
6752
+ export type UserControllerDeleteUserData = {
6058
6753
  /**
6059
- * Expected transaction ID
6754
+ * User ID to delete
6060
6755
  */
6061
6756
  id: string;
6757
+ };
6758
+
6759
+ export type UserControllerDeleteUserResponse = void;
6760
+
6761
+ export type UserControllerGetUserInfoData = {
6062
6762
  /**
6063
- * Region code for tenant context
6763
+ * User ID
6064
6764
  */
6065
- region: 'cn' | 'us' | 'de' | 'gb';
6066
- requestBody: ConfirmMatchDto;
6765
+ id: string;
6067
6766
  };
6068
6767
 
6069
- export type ExpectedTransactionControllerConfirmMatchResponse = unknown;
6768
+ export type UserControllerGetUserInfoResponse = unknown;
6070
6769
 
6071
- export type ExpectedTransactionControllerUnmatchData = {
6770
+ export type UserControllerUpdateUserSettingData = {
6771
+ requestBody: UpdateUserSettingDto;
6772
+ };
6773
+
6774
+ export type UserControllerUpdateUserSettingResponse = unknown;
6775
+
6776
+ export type UserControllerGetAllUserSettingsByPageData = {
6072
6777
  /**
6073
- * Expected transaction ID
6778
+ * Page number
6074
6779
  */
6075
- id: string;
6780
+ pageNo: number;
6076
6781
  /**
6077
- * Region code for tenant context
6782
+ * Page size
6078
6783
  */
6079
- region: 'cn' | 'us' | 'de' | 'gb';
6784
+ pageSize: number;
6080
6785
  };
6081
6786
 
6082
- export type ExpectedTransactionControllerUnmatchResponse = unknown;
6787
+ export type UserControllerGetAllUserSettingsByPageResponse = unknown;
6083
6788
 
6084
- export type ExpectedTransactionControllerEnterNowData = {
6085
- /**
6086
- * Expected transaction ID
6087
- */
6088
- id: string;
6789
+ export type UserControllerGetAssetLiabilitySummaryResponse = unknown;
6790
+
6791
+ export type PropertyControllerGetAllResponse = unknown;
6792
+
6793
+ export type PropertyControllerGetByKeyData = {
6089
6794
  /**
6090
- * Region code for tenant context
6795
+ * Property key
6091
6796
  */
6092
- region: 'cn' | 'us' | 'de' | 'gb';
6093
- requestBody: EnterNowDto;
6797
+ key: string;
6094
6798
  };
6095
6799
 
6096
- export type ExpectedTransactionControllerEnterNowResponse = unknown;
6800
+ export type PropertyControllerGetByKeyResponse = unknown;
6097
6801
 
6098
- export type ForecastControllerGetForecastData = {
6802
+ export type PropertyControllerUpdateData = {
6099
6803
  /**
6100
- * Number of months to forecast (1-12, default 3)
6804
+ * Property key
6101
6805
  */
6102
- months?: number;
6806
+ key: string;
6807
+ requestBody: UpdatePropertyDto;
6808
+ };
6809
+
6810
+ export type PropertyControllerUpdateResponse = unknown;
6811
+
6812
+ export type PropertyControllerDeleteData = {
6103
6813
  /**
6104
- * Region code for tenant context
6814
+ * Property key
6105
6815
  */
6106
- region: 'cn' | 'us' | 'de' | 'gb';
6816
+ key: string;
6107
6817
  };
6108
6818
 
6109
- export type ForecastControllerGetForecastResponse = ForecastResponseDto;
6819
+ export type PropertyControllerDeleteResponse = void;
6110
6820
 
6111
6821
  export type TransactionRuleControllerCreateData = {
6112
6822
  /**
@@ -6253,93 +6963,6 @@ export type TransactionRuleControllerTestData = {
6253
6963
 
6254
6964
  export type TransactionRuleControllerTestResponse = TestRuleResponseDto;
6255
6965
 
6256
- export type UserControllerDeleteOwnUserData = {
6257
- requestBody: DeleteOwnUserDto;
6258
- };
6259
-
6260
- export type UserControllerDeleteOwnUserResponse = void;
6261
-
6262
- export type UserControllerGetUserData = {
6263
- acceptLanguage: string;
6264
- };
6265
-
6266
- export type UserControllerGetUserResponse = unknown;
6267
-
6268
- export type UserControllerSignupUserData = {
6269
- requestBody: SignupDto;
6270
- };
6271
-
6272
- export type UserControllerSignupUserResponse = unknown;
6273
-
6274
- export type UserControllerDeleteUserData = {
6275
- /**
6276
- * User ID to delete
6277
- */
6278
- id: string;
6279
- };
6280
-
6281
- export type UserControllerDeleteUserResponse = void;
6282
-
6283
- export type UserControllerGetUserInfoData = {
6284
- /**
6285
- * User ID
6286
- */
6287
- id: string;
6288
- };
6289
-
6290
- export type UserControllerGetUserInfoResponse = unknown;
6291
-
6292
- export type UserControllerUpdateUserSettingData = {
6293
- requestBody: UpdateUserSettingDto;
6294
- };
6295
-
6296
- export type UserControllerUpdateUserSettingResponse = unknown;
6297
-
6298
- export type UserControllerGetAllUserSettingsByPageData = {
6299
- /**
6300
- * Page number
6301
- */
6302
- pageNo: number;
6303
- /**
6304
- * Page size
6305
- */
6306
- pageSize: number;
6307
- };
6308
-
6309
- export type UserControllerGetAllUserSettingsByPageResponse = unknown;
6310
-
6311
- export type UserControllerGetAssetLiabilitySummaryResponse = unknown;
6312
-
6313
- export type PropertyControllerGetAllResponse = unknown;
6314
-
6315
- export type PropertyControllerGetByKeyData = {
6316
- /**
6317
- * Property key
6318
- */
6319
- key: string;
6320
- };
6321
-
6322
- export type PropertyControllerGetByKeyResponse = unknown;
6323
-
6324
- export type PropertyControllerUpdateData = {
6325
- /**
6326
- * Property key
6327
- */
6328
- key: string;
6329
- requestBody: UpdatePropertyDto;
6330
- };
6331
-
6332
- export type PropertyControllerUpdateResponse = unknown;
6333
-
6334
- export type PropertyControllerDeleteData = {
6335
- /**
6336
- * Property key
6337
- */
6338
- key: string;
6339
- };
6340
-
6341
- export type PropertyControllerDeleteResponse = void;
6342
-
6343
6966
  export type EventControllerCreateData = {
6344
6967
  /**
6345
6968
  * Region code for tenant context (decorative for life events)
@@ -6402,41 +7025,96 @@ export type EventControllerUpdateData = {
6402
7025
  */
6403
7026
  id: string;
6404
7027
  /**
6405
- * Region code for tenant context (decorative for life events)
7028
+ * Region code for tenant context (decorative for life events)
7029
+ */
7030
+ region: 'cn' | 'us' | 'de' | 'gb';
7031
+ requestBody: UpdateBeanEventDto;
7032
+ };
7033
+
7034
+ export type EventControllerUpdateResponse = EventResponseDto;
7035
+
7036
+ export type EventControllerDeleteData = {
7037
+ /**
7038
+ * Life event ID
7039
+ */
7040
+ id: string;
7041
+ /**
7042
+ * Region code for tenant context (decorative for life events)
7043
+ */
7044
+ region: 'cn' | 'us' | 'de' | 'gb';
7045
+ };
7046
+
7047
+ export type EventControllerDeleteResponse = void;
7048
+
7049
+ export type EventControllerGetSliceData = {
7050
+ accountPattern: string;
7051
+ granularity: string;
7052
+ /**
7053
+ * Life event ID
7054
+ */
7055
+ id: string;
7056
+ /**
7057
+ * Region code for tenant context (decorative for life events)
7058
+ */
7059
+ region: 'cn' | 'us' | 'de' | 'gb';
7060
+ };
7061
+
7062
+ export type EventControllerGetSliceResponse = unknown;
7063
+
7064
+ export type OnboardingControllerBootstrapData = {
7065
+ /**
7066
+ * Region code for tenant context
7067
+ */
7068
+ region: 'cn' | 'us' | 'de' | 'gb';
7069
+ requestBody: OnboardingDto;
7070
+ };
7071
+
7072
+ export type OnboardingControllerBootstrapResponse = unknown;
7073
+
7074
+ export type ReconciliationControllerComputeData = {
7075
+ /**
7076
+ * Region code for tenant context (decorative for reconciliation)
7077
+ */
7078
+ region: 'cn' | 'us' | 'de' | 'gb';
7079
+ requestBody: ComputeReconciliationDto;
7080
+ };
7081
+
7082
+ export type ReconciliationControllerComputeResponse =
7083
+ ReconciliationComputeResultDto;
7084
+
7085
+ export type ReconciliationControllerAssertData = {
7086
+ /**
7087
+ * Region code for tenant context (decorative for reconciliation)
6406
7088
  */
6407
7089
  region: 'cn' | 'us' | 'de' | 'gb';
6408
- requestBody: UpdateBeanEventDto;
7090
+ requestBody: AssertReconciliationDto;
6409
7091
  };
6410
7092
 
6411
- export type EventControllerUpdateResponse = EventResponseDto;
7093
+ export type ReconciliationControllerAssertResponse = ReconciliationRecordDto;
6412
7094
 
6413
- export type EventControllerDeleteData = {
6414
- /**
6415
- * Life event ID
6416
- */
6417
- id: string;
7095
+ export type ReconciliationControllerPadData = {
6418
7096
  /**
6419
- * Region code for tenant context (decorative for life events)
7097
+ * Region code for tenant context (decorative for reconciliation)
6420
7098
  */
6421
7099
  region: 'cn' | 'us' | 'de' | 'gb';
7100
+ requestBody: PadReconciliationDto;
6422
7101
  };
6423
7102
 
6424
- export type EventControllerDeleteResponse = void;
7103
+ export type ReconciliationControllerPadResponse = PadResultDto;
6425
7104
 
6426
- export type EventControllerGetSliceData = {
6427
- accountPattern: string;
6428
- granularity: string;
7105
+ export type ReconciliationControllerHistoryData = {
6429
7106
  /**
6430
- * Life event ID
7107
+ * BeanAccount id
6431
7108
  */
6432
- id: string;
7109
+ accountId: string;
6433
7110
  /**
6434
- * Region code for tenant context (decorative for life events)
7111
+ * Region code for tenant context (decorative for reconciliation)
6435
7112
  */
6436
7113
  region: 'cn' | 'us' | 'de' | 'gb';
6437
7114
  };
6438
7115
 
6439
- export type EventControllerGetSliceResponse = unknown;
7116
+ export type ReconciliationControllerHistoryResponse =
7117
+ Array<ReconciliationRecordDto>;
6440
7118
 
6441
7119
  export type ExportControllerExportBeancountResponse = unknown;
6442
7120
 
@@ -6530,48 +7208,6 @@ export type ImporterConfigControllerResetConfigData = {
6530
7208
 
6531
7209
  export type ImporterConfigControllerResetConfigResponse = ImporterConfigDto;
6532
7210
 
6533
- export type PlatformControllerFindAllResponse = unknown;
6534
-
6535
- export type PlatformControllerCreateData = {
6536
- requestBody: CreatePlatformDto;
6537
- };
6538
-
6539
- export type PlatformControllerCreateResponse = unknown;
6540
-
6541
- export type PlatformControllerGetPlatformListResponse = unknown;
6542
-
6543
- export type PlatformControllerMatchPlatformsData = {
6544
- /**
6545
- * Search query — Chinese name, English name, or abbreviation
6546
- */
6547
- q: string;
6548
- /**
6549
- * Region code for category override lookup
6550
- */
6551
- region?: string;
6552
- };
6553
-
6554
- export type PlatformControllerMatchPlatformsResponse = unknown;
6555
-
6556
- export type PlatformControllerUpdateData = {
6557
- /**
6558
- * Platform ID
6559
- */
6560
- id: string;
6561
- requestBody: UpdatePlatformDto;
6562
- };
6563
-
6564
- export type PlatformControllerUpdateResponse = unknown;
6565
-
6566
- export type PlatformControllerDeleteData = {
6567
- /**
6568
- * Platform ID
6569
- */
6570
- id: string;
6571
- };
6572
-
6573
- export type PlatformControllerDeleteResponse = void;
6574
-
6575
7211
  export type ProviderSyncControllerSyncData = {
6576
7212
  /**
6577
7213
  * Provider name
@@ -6617,6 +7253,49 @@ export type ProviderSyncControllerIsProviderSupportedData = {
6617
7253
 
6618
7254
  export type ProviderSyncControllerIsProviderSupportedResponse = unknown;
6619
7255
 
7256
+ export type ExternalAccountLinkControllerCreateData = {
7257
+ /**
7258
+ * Region code for tenant context
7259
+ */
7260
+ region: 'cn' | 'us' | 'de' | 'gb';
7261
+ requestBody: CreateExternalAccountLinkDto;
7262
+ };
7263
+
7264
+ export type ExternalAccountLinkControllerCreateResponse =
7265
+ ExternalAccountLinkResponseDto;
7266
+
7267
+ export type ExternalAccountLinkControllerFindAllData = {
7268
+ provider: string;
7269
+ /**
7270
+ * Region code for tenant context
7271
+ */
7272
+ region: 'cn' | 'us' | 'de' | 'gb';
7273
+ };
7274
+
7275
+ export type ExternalAccountLinkControllerFindAllResponse =
7276
+ ExternalAccountLinkListResponseDto;
7277
+
7278
+ export type ExternalAccountLinkControllerFindOneData = {
7279
+ id: string;
7280
+ /**
7281
+ * Region code for tenant context
7282
+ */
7283
+ region: 'cn' | 'us' | 'de' | 'gb';
7284
+ };
7285
+
7286
+ export type ExternalAccountLinkControllerFindOneResponse =
7287
+ ExternalAccountLinkResponseDto;
7288
+
7289
+ export type ExternalAccountLinkControllerRemoveData = {
7290
+ id: string;
7291
+ /**
7292
+ * Region code for tenant context
7293
+ */
7294
+ region: 'cn' | 'us' | 'de' | 'gb';
7295
+ };
7296
+
7297
+ export type ExternalAccountLinkControllerRemoveResponse = void;
7298
+
6620
7299
  export type TelemetryControllerReportTelemetryData = {
6621
7300
  /**
6622
7301
  * Region code for tenant context
@@ -6689,225 +7368,114 @@ export type NlpControllerGetSessionData = {
6689
7368
 
6690
7369
  export type NlpControllerGetSessionResponse = unknown;
6691
7370
 
6692
- export type DashboardControllerGetNetWorthData = {
6693
- /**
6694
- * Date for balance calculation (ISO 8601 format)
6695
- */
6696
- date?: string;
6697
- /**
6698
- * Region code for tenant context
6699
- */
6700
- region: 'cn' | 'us' | 'de' | 'gb';
6701
- };
6702
-
6703
- export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
6704
-
6705
- export type DashboardControllerGetAccountsData = {
6706
- /**
6707
- * Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
6708
- */
6709
- accountId?: string;
6710
- /**
6711
- * Date for balance calculation (ISO 8601 format)
6712
- */
6713
- date?: string;
6714
- /**
6715
- * Grouping strategy
6716
- */
6717
- groupBy?:
6718
- | 'platform'
6719
- | 'assetClass'
6720
- | 'holdingAssetClass'
6721
- | 'holdingAssetClassByAccount';
6722
- /**
6723
- * Region code for tenant context
6724
- */
6725
- region: 'cn' | 'us' | 'de' | 'gb';
6726
- };
6727
-
6728
- export type DashboardControllerGetAccountsResponse =
6729
- | AccountsResponseDto
6730
- | AssetClassAccountsResponseDto
6731
- | HoldingAssetClassCrossAccountResponseDto;
6732
-
6733
- export type DashboardControllerGetCashFlowData = {
6734
- /**
6735
- * Period in YYYY-MM format
6736
- */
6737
- period: string;
6738
- /**
6739
- * Region code for tenant context
6740
- */
6741
- region: 'cn' | 'us' | 'de' | 'gb';
6742
- };
6743
-
6744
- export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6745
-
6746
- export type DashboardControllerGetExpensesData = {
6747
- /**
6748
- * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
6749
- */
6750
- flow?: 'expense' | 'income';
6751
- /**
6752
- * Grouping strategy
6753
- */
6754
- groupBy?: 'category';
6755
- /**
6756
- * Time window (1m = current calendar month)
6757
- */
6758
- period?: '1m' | '3m' | '6m' | '1y';
6759
- /**
6760
- * Region code for tenant context
6761
- */
6762
- region: 'cn' | 'us' | 'de' | 'gb';
6763
- };
6764
-
6765
- export type DashboardControllerGetExpensesResponse =
6766
- ExpensesByCategoryResponseDto;
7371
+ export type PlatformControllerFindAllResponse = unknown;
6767
7372
 
6768
- export type HoldingPnlControllerGetHoldingPnlData = {
6769
- /**
6770
- * Scope to a single account
6771
- */
6772
- accountId?: string;
6773
- /**
6774
- * As-of date (ISO 8601), defaults to today
6775
- */
6776
- asOf?: string;
6777
- /**
6778
- * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6779
- */
6780
- method?: 'FIFO' | 'average';
6781
- /**
6782
- * Region code for tenant context
6783
- */
6784
- region: 'cn' | 'us' | 'de' | 'gb';
7373
+ export type PlatformControllerCreateData = {
7374
+ requestBody: CreatePlatformDto;
6785
7375
  };
6786
7376
 
6787
- export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6788
-
6789
- export type PriceControllerCreateData = {
6790
- /**
6791
- * Region code for tenant context
6792
- */
6793
- region: 'cn' | 'us' | 'de' | 'gb';
6794
- requestBody: CreateBeanPriceDto;
6795
- };
7377
+ export type PlatformControllerCreateResponse = unknown;
6796
7378
 
6797
- export type PriceControllerCreateResponse = PriceResponseDto;
7379
+ export type PlatformControllerGetPlatformListResponse =
7380
+ Array<PlatformListItemDto>;
6798
7381
 
6799
- export type PriceControllerFindAllData = {
6800
- /**
6801
- * Filter by currency (e.g., BTC, AAPL, USD)
6802
- */
6803
- currency?: string;
6804
- /**
6805
- * Filter prices from this date (ISO 8601 format)
6806
- */
6807
- dateFrom?: string;
6808
- /**
6809
- * Filter prices to this date (ISO 8601 format)
6810
- */
6811
- dateTo?: string;
6812
- /**
6813
- * Number of items per page (default: 20, max: 100)
6814
- */
6815
- limit?: number;
6816
- /**
6817
- * Page number for pagination (default: 1)
6818
- */
6819
- page?: number;
6820
- /**
6821
- * Filter by quote currency (pricing currency, e.g., USD, CNY)
6822
- */
6823
- quoteCurrency?: string;
7382
+ export type PlatformControllerMatchPlatformsData = {
6824
7383
  /**
6825
- * Region code for tenant context
7384
+ * Search query — Chinese name, English name, or abbreviation
6826
7385
  */
6827
- region: 'cn' | 'us' | 'de' | 'gb';
7386
+ q: string;
6828
7387
  /**
6829
- * Search term for currency or quoteCurrency (case-insensitive partial match)
7388
+ * Region code for category override lookup
6830
7389
  */
6831
- search?: string;
7390
+ region?: string;
6832
7391
  };
6833
7392
 
6834
- export type PriceControllerFindAllResponse = PriceListResponseDto;
7393
+ export type PlatformControllerMatchPlatformsResponse = PlatformMatchResponseDto;
6835
7394
 
6836
- export type PriceControllerFindOneData = {
7395
+ export type PlatformControllerUpdateData = {
6837
7396
  /**
6838
- * Price ID
7397
+ * Platform ID
6839
7398
  */
6840
7399
  id: string;
6841
- /**
6842
- * Region code for tenant context
6843
- */
6844
- region: 'cn' | 'us' | 'de' | 'gb';
7400
+ requestBody: UpdatePlatformDto;
6845
7401
  };
6846
7402
 
6847
- export type PriceControllerFindOneResponse = PriceResponseDto;
7403
+ export type PlatformControllerUpdateResponse = unknown;
6848
7404
 
6849
- export type PriceControllerUpdateData = {
7405
+ export type PlatformControllerDeleteData = {
6850
7406
  /**
6851
- * Price ID
7407
+ * Platform ID
6852
7408
  */
6853
7409
  id: string;
6854
- /**
6855
- * Region code for tenant context
6856
- */
6857
- region: 'cn' | 'us' | 'de' | 'gb';
6858
- requestBody: UpdateBeanPriceDto;
6859
7410
  };
6860
7411
 
6861
- export type PriceControllerUpdateResponse = PriceResponseDto;
7412
+ export type PlatformControllerDeleteResponse = void;
6862
7413
 
6863
- export type PriceControllerDeleteData = {
7414
+ export type DashboardControllerGetNetWorthData = {
6864
7415
  /**
6865
- * Price ID
7416
+ * Date for balance calculation (ISO 8601 format)
6866
7417
  */
6867
- id: string;
7418
+ date?: string;
6868
7419
  /**
6869
7420
  * Region code for tenant context
6870
7421
  */
6871
7422
  region: 'cn' | 'us' | 'de' | 'gb';
6872
7423
  };
6873
7424
 
6874
- export type PriceControllerDeleteResponse = void;
7425
+ export type DashboardControllerGetNetWorthResponse = NetWorthResponseDto;
6875
7426
 
6876
- export type PriceControllerBulkCreateData = {
7427
+ export type DashboardControllerGetAccountsData = {
7428
+ /**
7429
+ * Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
7430
+ */
7431
+ accountId?: string;
7432
+ /**
7433
+ * Date for balance calculation (ISO 8601 format)
7434
+ */
7435
+ date?: string;
7436
+ /**
7437
+ * Grouping strategy
7438
+ */
7439
+ groupBy?:
7440
+ | 'platform'
7441
+ | 'assetClass'
7442
+ | 'holdingAssetClass'
7443
+ | 'holdingAssetClassByAccount';
6877
7444
  /**
6878
7445
  * Region code for tenant context
6879
7446
  */
6880
7447
  region: 'cn' | 'us' | 'de' | 'gb';
6881
- requestBody: Array<string>;
6882
7448
  };
6883
7449
 
6884
- export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
7450
+ export type DashboardControllerGetAccountsResponse =
7451
+ | AccountsResponseDto
7452
+ | AssetClassAccountsResponseDto
7453
+ | HoldingAssetClassCrossAccountResponseDto;
6885
7454
 
6886
- export type ReportingControllerGetPortfolioTrendsData = {
6887
- /**
6888
- * Data granularity
6889
- */
6890
- granularity?: 'day' | 'week' | 'month';
7455
+ export type DashboardControllerGetCashFlowData = {
6891
7456
  /**
6892
- * Time period
7457
+ * Period in YYYY-MM format
6893
7458
  */
6894
- period?: '1m' | '3m' | '6m' | '1y';
7459
+ period: string;
6895
7460
  /**
6896
7461
  * Region code for tenant context
6897
7462
  */
6898
7463
  region: 'cn' | 'us' | 'de' | 'gb';
6899
7464
  };
6900
7465
 
6901
- export type ReportingControllerGetPortfolioTrendsResponse =
6902
- PortfolioTrendsResponseDto;
7466
+ export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6903
7467
 
6904
- export type ReportingControllerGetCashFlowTrendsData = {
7468
+ export type DashboardControllerGetExpensesData = {
6905
7469
  /**
6906
- * Data granularity (accepted for API symmetry; v1 returns month buckets)
7470
+ * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
6907
7471
  */
6908
- granularity?: 'day' | 'week' | 'month';
7472
+ flow?: 'expense' | 'income';
6909
7473
  /**
6910
- * Time period
7474
+ * Grouping strategy
7475
+ */
7476
+ groupBy?: 'category';
7477
+ /**
7478
+ * Time window (1m = current calendar month)
6911
7479
  */
6912
7480
  period?: '1m' | '3m' | '6m' | '1y';
6913
7481
  /**
@@ -6916,33 +7484,29 @@ export type ReportingControllerGetCashFlowTrendsData = {
6916
7484
  region: 'cn' | 'us' | 'de' | 'gb';
6917
7485
  };
6918
7486
 
6919
- export type ReportingControllerGetCashFlowTrendsResponse =
6920
- CashFlowTrendsResponseDto;
7487
+ export type DashboardControllerGetExpensesResponse =
7488
+ ExpensesByCategoryResponseDto;
6921
7489
 
6922
- export type ReportingControllerGenerateSnapshotData = {
7490
+ export type HoldingPnlControllerGetHoldingPnlData = {
6923
7491
  /**
6924
- * Region code for tenant context
7492
+ * Scope to a single account
6925
7493
  */
6926
- region: 'cn' | 'us' | 'de' | 'gb';
7494
+ accountId?: string;
6927
7495
  /**
6928
- * Optional date (defaults to today)
7496
+ * As-of date (ISO 8601), defaults to today
6929
7497
  */
6930
- requestBody: GenerateSnapshotBody;
6931
- };
6932
-
6933
- export type ReportingControllerGenerateSnapshotResponse =
6934
- GenerateSnapshotResponse;
6935
-
6936
- export type ReportingControllerBackfillSnapshotsData = {
7498
+ asOf?: string;
7499
+ /**
7500
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
7501
+ */
7502
+ method?: 'FIFO' | 'average';
6937
7503
  /**
6938
7504
  * Region code for tenant context
6939
7505
  */
6940
7506
  region: 'cn' | 'us' | 'de' | 'gb';
6941
- requestBody: BackfillSnapshotsBody;
6942
7507
  };
6943
7508
 
6944
- export type ReportingControllerBackfillSnapshotsResponse =
6945
- BackfillSnapshotsResponse;
7509
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6946
7510
 
6947
7511
  export type ApiKeysControllerCreateApiKeyResponse = unknown;
6948
7512
 
@@ -6950,7 +7514,7 @@ export type AuthControllerAccessTokenLoginData = {
6950
7514
  requestBody: AnonymousLoginDto;
6951
7515
  };
6952
7516
 
6953
- export type AuthControllerAccessTokenLoginResponse = unknown;
7517
+ export type AuthControllerAccessTokenLoginResponse = AnonymousLoginResponseDto;
6954
7518
 
6955
7519
  export type CacheControllerFlushCacheResponse = unknown;
6956
7520
 
@@ -7098,6 +7662,25 @@ export type $OpenApiTs = {
7098
7662
  };
7099
7663
  };
7100
7664
  };
7665
+ '/api/v1/{region}/bean/accounts/{id}/opening-balance': {
7666
+ post: {
7667
+ req: AccountControllerAddOpeningBalanceData;
7668
+ res: {
7669
+ /**
7670
+ * Opening-balance transaction created
7671
+ */
7672
+ 201: OpeningBalanceResultDto;
7673
+ /**
7674
+ * Account not found
7675
+ */
7676
+ 404: unknown;
7677
+ /**
7678
+ * An opening balance already exists for this account
7679
+ */
7680
+ 409: unknown;
7681
+ };
7682
+ };
7683
+ };
7101
7684
  '/api/v1/{region}/bean/account-standards': {
7102
7685
  get: {
7103
7686
  req: AccountStandardsControllerGetTemplatesData;
@@ -7706,6 +8289,90 @@ export type $OpenApiTs = {
7706
8289
  };
7707
8290
  };
7708
8291
  };
8292
+ '/api/v1/{region}/bean/prices': {
8293
+ post: {
8294
+ req: PriceControllerCreateData;
8295
+ res: {
8296
+ /**
8297
+ * Price created successfully
8298
+ */
8299
+ 201: PriceResponseDto;
8300
+ /**
8301
+ * Currency or quoteCurrency commodity not found
8302
+ */
8303
+ 404: unknown;
8304
+ /**
8305
+ * Price already exists for this currency pair and date
8306
+ */
8307
+ 409: unknown;
8308
+ };
8309
+ };
8310
+ get: {
8311
+ req: PriceControllerFindAllData;
8312
+ res: {
8313
+ /**
8314
+ * Prices retrieved successfully
8315
+ */
8316
+ 200: PriceListResponseDto;
8317
+ };
8318
+ };
8319
+ };
8320
+ '/api/v1/{region}/bean/prices/{id}': {
8321
+ get: {
8322
+ req: PriceControllerFindOneData;
8323
+ res: {
8324
+ /**
8325
+ * Price retrieved successfully
8326
+ */
8327
+ 200: PriceResponseDto;
8328
+ /**
8329
+ * Price not found
8330
+ */
8331
+ 404: unknown;
8332
+ };
8333
+ };
8334
+ put: {
8335
+ req: PriceControllerUpdateData;
8336
+ res: {
8337
+ /**
8338
+ * Price updated successfully
8339
+ */
8340
+ 200: PriceResponseDto;
8341
+ /**
8342
+ * Price not found
8343
+ */
8344
+ 404: unknown;
8345
+ /**
8346
+ * Updated price conflicts with existing price
8347
+ */
8348
+ 409: unknown;
8349
+ };
8350
+ };
8351
+ delete: {
8352
+ req: PriceControllerDeleteData;
8353
+ res: {
8354
+ /**
8355
+ * Price deleted successfully
8356
+ */
8357
+ 204: void;
8358
+ /**
8359
+ * Price not found
8360
+ */
8361
+ 404: unknown;
8362
+ };
8363
+ };
8364
+ };
8365
+ '/api/v1/{region}/bean/prices/bulk': {
8366
+ post: {
8367
+ req: PriceControllerBulkCreateData;
8368
+ res: {
8369
+ /**
8370
+ * Prices created successfully
8371
+ */
8372
+ 201: Array<PriceResponseDto>;
8373
+ };
8374
+ };
8375
+ };
7709
8376
  '/api/v1/{region}/bean/recurring-rules': {
7710
8377
  post: {
7711
8378
  req: RecurringRuleControllerCreateData;
@@ -7956,397 +8623,469 @@ export type $OpenApiTs = {
7956
8623
  };
7957
8624
  };
7958
8625
  };
7959
- '/api/v1/{region}/bean/transaction-rules': {
8626
+ '/api/v1/{region}/reporting/portfolio/trends': {
8627
+ get: {
8628
+ req: ReportingControllerGetPortfolioTrendsData;
8629
+ res: {
8630
+ /**
8631
+ * Trends retrieved successfully
8632
+ */
8633
+ 200: PortfolioTrendsResponseDto;
8634
+ /**
8635
+ * User not authenticated
8636
+ */
8637
+ 401: unknown;
8638
+ };
8639
+ };
8640
+ };
8641
+ '/api/v1/{region}/reporting/cash-flow/trends': {
8642
+ get: {
8643
+ req: ReportingControllerGetCashFlowTrendsData;
8644
+ res: {
8645
+ /**
8646
+ * Cash-flow trends retrieved successfully
8647
+ */
8648
+ 200: CashFlowTrendsResponseDto;
8649
+ /**
8650
+ * User not authenticated
8651
+ */
8652
+ 401: unknown;
8653
+ };
8654
+ };
8655
+ };
8656
+ '/api/v1/{region}/reporting/snapshots/generate': {
7960
8657
  post: {
7961
- req: TransactionRuleControllerCreateData;
8658
+ req: ReportingControllerGenerateSnapshotData;
7962
8659
  res: {
7963
8660
  /**
7964
- * Rule updated successfully (upsert mode)
8661
+ * Snapshot generated successfully
7965
8662
  */
7966
- 200: TransactionRuleResponseDto;
8663
+ 200: GenerateSnapshotResponse;
7967
8664
  /**
7968
- * Validation failed
8665
+ * Invalid date format
7969
8666
  */
7970
- 400: ApiProblemResponseDto;
8667
+ 400: unknown;
7971
8668
  /**
7972
- * Unauthorized
8669
+ * User not authenticated
8670
+ */
8671
+ 401: unknown;
8672
+ };
8673
+ };
8674
+ };
8675
+ '/api/v1/{region}/reporting/snapshots/backfill': {
8676
+ post: {
8677
+ req: ReportingControllerBackfillSnapshotsData;
8678
+ res: {
8679
+ /**
8680
+ * Backfill completed successfully
8681
+ */
8682
+ 200: BackfillSnapshotsResponse;
8683
+ /**
8684
+ * Invalid date format or range
8685
+ */
8686
+ 400: unknown;
8687
+ /**
8688
+ * User not authenticated
8689
+ */
8690
+ 401: unknown;
8691
+ /**
8692
+ * Backfill already in progress for this user
8693
+ */
8694
+ 409: unknown;
8695
+ };
8696
+ };
8697
+ };
8698
+ '/api/v1/users': {
8699
+ delete: {
8700
+ req: UserControllerDeleteOwnUserData;
8701
+ res: {
8702
+ /**
8703
+ * User deleted successfully
7973
8704
  */
7974
- 401: ApiProblemResponseDto;
8705
+ 204: void;
7975
8706
  /**
7976
- * Resource conflict - another process is updating this rule
8707
+ * Invalid access token
7977
8708
  */
7978
- 409: ApiProblemResponseDto;
8709
+ 403: unknown;
7979
8710
  };
7980
8711
  };
7981
8712
  get: {
7982
- req: TransactionRuleControllerListData;
8713
+ req: UserControllerGetUserData;
7983
8714
  res: {
7984
8715
  /**
7985
- * List of rules
7986
- */
7987
- 200: TransactionRuleListResponseDto;
7988
- /**
7989
- * Unauthorized
8716
+ * User retrieved successfully
7990
8717
  */
7991
- 401: ApiProblemResponseDto;
8718
+ 200: unknown;
7992
8719
  };
7993
8720
  };
7994
- };
7995
- '/api/v1/{region}/bean/transaction-rules/validate': {
7996
8721
  post: {
7997
- req: TransactionRuleControllerValidateData;
8722
+ req: UserControllerSignupUserData;
7998
8723
  res: {
7999
8724
  /**
8000
- * Validation result
8725
+ * User created successfully
8001
8726
  */
8002
- 200: ValidateRuleResponseDto;
8727
+ 201: SignupResponseDto;
8003
8728
  /**
8004
- * Validation failed
8729
+ * Invalid Turnstile token (when Turnstile is enabled)
8005
8730
  */
8006
- 400: ApiProblemResponseDto;
8731
+ 400: unknown;
8007
8732
  /**
8008
- * Unauthorized
8733
+ * User signup is disabled
8009
8734
  */
8010
- 401: ApiProblemResponseDto;
8735
+ 403: unknown;
8011
8736
  };
8012
8737
  };
8013
8738
  };
8014
- '/api/v1/{region}/bean/transaction-rules/bulk': {
8015
- post: {
8016
- req: TransactionRuleControllerBulkCreateData;
8739
+ '/api/v1/users/{id}': {
8740
+ delete: {
8741
+ req: UserControllerDeleteUserData;
8017
8742
  res: {
8018
8743
  /**
8019
- * Bulk create completed
8020
- */
8021
- 201: BulkCreateRulesResponseDto;
8022
- /**
8023
- * Invalid bulk create data
8744
+ * User deleted successfully
8024
8745
  */
8025
- 400: ApiProblemResponseDto;
8746
+ 204: void;
8026
8747
  /**
8027
- * Unauthorized
8748
+ * Cannot delete own account or insufficient permissions
8028
8749
  */
8029
- 401: ApiProblemResponseDto;
8750
+ 403: unknown;
8030
8751
  };
8031
8752
  };
8032
8753
  };
8033
- '/api/v1/{region}/bean/transaction-rules/export/{format}': {
8754
+ '/api/v1/users/{id}/info': {
8034
8755
  get: {
8035
- req: TransactionRuleControllerExportData;
8756
+ req: UserControllerGetUserInfoData;
8036
8757
  res: {
8037
8758
  /**
8038
- * Exported rules
8039
- */
8040
- 200: ExportRulesResponseDto;
8041
- /**
8042
- * Unsupported format
8759
+ * User info retrieved successfully
8043
8760
  */
8044
- 400: ApiProblemResponseDto;
8761
+ 200: unknown;
8045
8762
  /**
8046
- * Unauthorized
8763
+ * Cannot access other user info without admin permission
8047
8764
  */
8048
- 401: ApiProblemResponseDto;
8765
+ 403: unknown;
8049
8766
  };
8050
8767
  };
8051
8768
  };
8052
- '/api/v1/{region}/bean/transaction-rules/statistics/{period}': {
8053
- get: {
8054
- req: TransactionRuleControllerGetStatisticsData;
8769
+ '/api/v1/users/setting': {
8770
+ put: {
8771
+ req: UserControllerUpdateUserSettingData;
8055
8772
  res: {
8056
8773
  /**
8057
- * Rule statistics
8774
+ * Settings updated successfully
8058
8775
  */
8059
- 200: RuleStatisticsResponseDto;
8776
+ 200: unknown;
8060
8777
  /**
8061
- * Unauthorized
8778
+ * Insufficient permissions
8062
8779
  */
8063
- 401: ApiProblemResponseDto;
8780
+ 403: unknown;
8064
8781
  };
8065
8782
  };
8066
8783
  };
8067
- '/api/v1/{region}/bean/transaction-rules/{ruleId}': {
8784
+ '/api/v1/users/settings-by-page': {
8068
8785
  get: {
8069
- req: TransactionRuleControllerGetDetailData;
8786
+ req: UserControllerGetAllUserSettingsByPageData;
8070
8787
  res: {
8071
8788
  /**
8072
- * Rule details
8073
- */
8074
- 200: TransactionRuleResponseDto;
8075
- /**
8076
- * Unauthorized
8077
- */
8078
- 401: ApiProblemResponseDto;
8079
- /**
8080
- * Forbidden - not owner of rule
8081
- */
8082
- 403: ApiProblemResponseDto;
8083
- /**
8084
- * Rule not found
8789
+ * Settings list retrieved successfully
8085
8790
  */
8086
- 404: ApiProblemResponseDto;
8791
+ 200: unknown;
8087
8792
  };
8088
8793
  };
8089
- put: {
8090
- req: TransactionRuleControllerUpdateData;
8794
+ };
8795
+ '/api/v1/users/asset-liability-summary': {
8796
+ get: {
8091
8797
  res: {
8092
8798
  /**
8093
- * Rule updated successfully
8799
+ * Summary retrieved successfully
8094
8800
  */
8095
- 200: TransactionRuleResponseDto;
8801
+ 200: unknown;
8802
+ };
8803
+ };
8804
+ };
8805
+ '/api/v1/admin/properties': {
8806
+ get: {
8807
+ res: {
8096
8808
  /**
8097
- * Validation failed
8809
+ * Properties retrieved successfully
8098
8810
  */
8099
- 400: ApiProblemResponseDto;
8811
+ 200: unknown;
8100
8812
  /**
8101
8813
  * Unauthorized
8102
8814
  */
8103
- 401: ApiProblemResponseDto;
8104
- /**
8105
- * Forbidden - not owner of rule
8106
- */
8107
- 403: ApiProblemResponseDto;
8108
- /**
8109
- * Rule not found
8110
- */
8111
- 404: ApiProblemResponseDto;
8815
+ 401: unknown;
8112
8816
  /**
8113
- * Resource conflict - rule is being modified by another process
8817
+ * Forbidden - insufficient permissions
8114
8818
  */
8115
- 409: ApiProblemResponseDto;
8819
+ 403: unknown;
8116
8820
  };
8117
8821
  };
8118
- delete: {
8119
- req: TransactionRuleControllerDeleteData;
8822
+ };
8823
+ '/api/v1/admin/properties/{key}': {
8824
+ get: {
8825
+ req: PropertyControllerGetByKeyData;
8120
8826
  res: {
8121
8827
  /**
8122
- * Rule deleted successfully
8828
+ * Property retrieved successfully
8123
8829
  */
8124
- 204: void;
8830
+ 200: unknown;
8125
8831
  /**
8126
8832
  * Unauthorized
8127
8833
  */
8128
- 401: ApiProblemResponseDto;
8129
- /**
8130
- * Forbidden - not owner of rule
8131
- */
8132
- 403: ApiProblemResponseDto;
8834
+ 401: unknown;
8133
8835
  /**
8134
- * Rule not found
8836
+ * Forbidden - insufficient permissions
8135
8837
  */
8136
- 404: ApiProblemResponseDto;
8838
+ 403: unknown;
8137
8839
  /**
8138
- * Resource conflict - rule is being modified by another process
8840
+ * Property not found
8139
8841
  */
8140
- 409: ApiProblemResponseDto;
8842
+ 404: unknown;
8141
8843
  };
8142
8844
  };
8143
- };
8144
- '/api/v1/{region}/bean/transaction-rules/{ruleId}/test': {
8145
- post: {
8146
- req: TransactionRuleControllerTestData;
8845
+ put: {
8846
+ req: PropertyControllerUpdateData;
8147
8847
  res: {
8148
8848
  /**
8149
- * Test result
8849
+ * Property updated successfully
8150
8850
  */
8151
- 200: TestRuleResponseDto;
8851
+ 200: unknown;
8152
8852
  /**
8153
8853
  * Unauthorized
8154
8854
  */
8155
- 401: ApiProblemResponseDto;
8156
- /**
8157
- * Forbidden - not owner of rule
8158
- */
8159
- 403: ApiProblemResponseDto;
8855
+ 401: unknown;
8160
8856
  /**
8161
- * Rule not found
8857
+ * Forbidden - insufficient permissions
8162
8858
  */
8163
- 404: ApiProblemResponseDto;
8859
+ 403: unknown;
8164
8860
  };
8165
8861
  };
8166
- };
8167
- '/api/v1/users': {
8168
8862
  delete: {
8169
- req: UserControllerDeleteOwnUserData;
8863
+ req: PropertyControllerDeleteData;
8170
8864
  res: {
8171
8865
  /**
8172
- * User deleted successfully
8866
+ * Property deleted successfully
8173
8867
  */
8174
8868
  204: void;
8175
8869
  /**
8176
- * Invalid access token
8870
+ * Unauthorized
8871
+ */
8872
+ 401: unknown;
8873
+ /**
8874
+ * Forbidden - insufficient permissions
8177
8875
  */
8178
8876
  403: unknown;
8179
- };
8180
- };
8181
- get: {
8182
- req: UserControllerGetUserData;
8183
- res: {
8184
8877
  /**
8185
- * User retrieved successfully
8878
+ * Property not found
8186
8879
  */
8187
- 200: unknown;
8880
+ 404: unknown;
8188
8881
  };
8189
8882
  };
8883
+ };
8884
+ '/api/v1/{region}/bean/transaction-rules': {
8190
8885
  post: {
8191
- req: UserControllerSignupUserData;
8886
+ req: TransactionRuleControllerCreateData;
8192
8887
  res: {
8193
8888
  /**
8194
- * User created successfully
8889
+ * Rule updated successfully (upsert mode)
8195
8890
  */
8196
- 201: unknown;
8891
+ 200: TransactionRuleResponseDto;
8197
8892
  /**
8198
- * Invalid Turnstile token (when Turnstile is enabled)
8893
+ * Validation failed
8199
8894
  */
8200
- 400: unknown;
8895
+ 400: ApiProblemResponseDto;
8201
8896
  /**
8202
- * User signup is disabled
8897
+ * Unauthorized
8203
8898
  */
8204
- 403: unknown;
8899
+ 401: ApiProblemResponseDto;
8900
+ /**
8901
+ * Resource conflict - another process is updating this rule
8902
+ */
8903
+ 409: ApiProblemResponseDto;
8205
8904
  };
8206
8905
  };
8207
- };
8208
- '/api/v1/users/{id}': {
8209
- delete: {
8210
- req: UserControllerDeleteUserData;
8906
+ get: {
8907
+ req: TransactionRuleControllerListData;
8211
8908
  res: {
8212
8909
  /**
8213
- * User deleted successfully
8910
+ * List of rules
8214
8911
  */
8215
- 204: void;
8912
+ 200: TransactionRuleListResponseDto;
8216
8913
  /**
8217
- * Cannot delete own account or insufficient permissions
8914
+ * Unauthorized
8218
8915
  */
8219
- 403: unknown;
8916
+ 401: ApiProblemResponseDto;
8220
8917
  };
8221
8918
  };
8222
8919
  };
8223
- '/api/v1/users/{id}/info': {
8224
- get: {
8225
- req: UserControllerGetUserInfoData;
8920
+ '/api/v1/{region}/bean/transaction-rules/validate': {
8921
+ post: {
8922
+ req: TransactionRuleControllerValidateData;
8226
8923
  res: {
8227
8924
  /**
8228
- * User info retrieved successfully
8925
+ * Validation result
8229
8926
  */
8230
- 200: unknown;
8927
+ 200: ValidateRuleResponseDto;
8231
8928
  /**
8232
- * Cannot access other user info without admin permission
8929
+ * Validation failed
8233
8930
  */
8234
- 403: unknown;
8931
+ 400: ApiProblemResponseDto;
8932
+ /**
8933
+ * Unauthorized
8934
+ */
8935
+ 401: ApiProblemResponseDto;
8235
8936
  };
8236
8937
  };
8237
8938
  };
8238
- '/api/v1/users/setting': {
8239
- put: {
8240
- req: UserControllerUpdateUserSettingData;
8939
+ '/api/v1/{region}/bean/transaction-rules/bulk': {
8940
+ post: {
8941
+ req: TransactionRuleControllerBulkCreateData;
8241
8942
  res: {
8242
8943
  /**
8243
- * Settings updated successfully
8944
+ * Bulk create completed
8945
+ */
8946
+ 201: BulkCreateRulesResponseDto;
8947
+ /**
8948
+ * Invalid bulk create data
8244
8949
  */
8245
- 200: unknown;
8950
+ 400: ApiProblemResponseDto;
8246
8951
  /**
8247
- * Insufficient permissions
8952
+ * Unauthorized
8248
8953
  */
8249
- 403: unknown;
8954
+ 401: ApiProblemResponseDto;
8250
8955
  };
8251
8956
  };
8252
8957
  };
8253
- '/api/v1/users/settings-by-page': {
8958
+ '/api/v1/{region}/bean/transaction-rules/export/{format}': {
8254
8959
  get: {
8255
- req: UserControllerGetAllUserSettingsByPageData;
8960
+ req: TransactionRuleControllerExportData;
8256
8961
  res: {
8257
8962
  /**
8258
- * Settings list retrieved successfully
8963
+ * Exported rules
8259
8964
  */
8260
- 200: unknown;
8965
+ 200: ExportRulesResponseDto;
8966
+ /**
8967
+ * Unsupported format
8968
+ */
8969
+ 400: ApiProblemResponseDto;
8970
+ /**
8971
+ * Unauthorized
8972
+ */
8973
+ 401: ApiProblemResponseDto;
8261
8974
  };
8262
8975
  };
8263
8976
  };
8264
- '/api/v1/users/asset-liability-summary': {
8977
+ '/api/v1/{region}/bean/transaction-rules/statistics/{period}': {
8265
8978
  get: {
8979
+ req: TransactionRuleControllerGetStatisticsData;
8266
8980
  res: {
8267
8981
  /**
8268
- * Summary retrieved successfully
8982
+ * Rule statistics
8269
8983
  */
8270
- 200: unknown;
8984
+ 200: RuleStatisticsResponseDto;
8985
+ /**
8986
+ * Unauthorized
8987
+ */
8988
+ 401: ApiProblemResponseDto;
8271
8989
  };
8272
8990
  };
8273
8991
  };
8274
- '/api/v1/admin/properties': {
8992
+ '/api/v1/{region}/bean/transaction-rules/{ruleId}': {
8275
8993
  get: {
8994
+ req: TransactionRuleControllerGetDetailData;
8276
8995
  res: {
8277
8996
  /**
8278
- * Properties retrieved successfully
8997
+ * Rule details
8279
8998
  */
8280
- 200: unknown;
8999
+ 200: TransactionRuleResponseDto;
8281
9000
  /**
8282
9001
  * Unauthorized
8283
9002
  */
8284
- 401: unknown;
9003
+ 401: ApiProblemResponseDto;
8285
9004
  /**
8286
- * Forbidden - insufficient permissions
9005
+ * Forbidden - not owner of rule
8287
9006
  */
8288
- 403: unknown;
9007
+ 403: ApiProblemResponseDto;
9008
+ /**
9009
+ * Rule not found
9010
+ */
9011
+ 404: ApiProblemResponseDto;
8289
9012
  };
8290
9013
  };
8291
- };
8292
- '/api/v1/admin/properties/{key}': {
8293
- get: {
8294
- req: PropertyControllerGetByKeyData;
9014
+ put: {
9015
+ req: TransactionRuleControllerUpdateData;
8295
9016
  res: {
8296
9017
  /**
8297
- * Property retrieved successfully
9018
+ * Rule updated successfully
8298
9019
  */
8299
- 200: unknown;
9020
+ 200: TransactionRuleResponseDto;
9021
+ /**
9022
+ * Validation failed
9023
+ */
9024
+ 400: ApiProblemResponseDto;
8300
9025
  /**
8301
9026
  * Unauthorized
8302
9027
  */
8303
- 401: unknown;
9028
+ 401: ApiProblemResponseDto;
8304
9029
  /**
8305
- * Forbidden - insufficient permissions
9030
+ * Forbidden - not owner of rule
8306
9031
  */
8307
- 403: unknown;
9032
+ 403: ApiProblemResponseDto;
8308
9033
  /**
8309
- * Property not found
9034
+ * Rule not found
8310
9035
  */
8311
- 404: unknown;
9036
+ 404: ApiProblemResponseDto;
9037
+ /**
9038
+ * Resource conflict - rule is being modified by another process
9039
+ */
9040
+ 409: ApiProblemResponseDto;
8312
9041
  };
8313
9042
  };
8314
- put: {
8315
- req: PropertyControllerUpdateData;
9043
+ delete: {
9044
+ req: TransactionRuleControllerDeleteData;
8316
9045
  res: {
8317
9046
  /**
8318
- * Property updated successfully
9047
+ * Rule deleted successfully
8319
9048
  */
8320
- 200: unknown;
9049
+ 204: void;
8321
9050
  /**
8322
9051
  * Unauthorized
8323
9052
  */
8324
- 401: unknown;
9053
+ 401: ApiProblemResponseDto;
8325
9054
  /**
8326
- * Forbidden - insufficient permissions
9055
+ * Forbidden - not owner of rule
8327
9056
  */
8328
- 403: unknown;
9057
+ 403: ApiProblemResponseDto;
9058
+ /**
9059
+ * Rule not found
9060
+ */
9061
+ 404: ApiProblemResponseDto;
9062
+ /**
9063
+ * Resource conflict - rule is being modified by another process
9064
+ */
9065
+ 409: ApiProblemResponseDto;
8329
9066
  };
8330
9067
  };
8331
- delete: {
8332
- req: PropertyControllerDeleteData;
9068
+ };
9069
+ '/api/v1/{region}/bean/transaction-rules/{ruleId}/test': {
9070
+ post: {
9071
+ req: TransactionRuleControllerTestData;
8333
9072
  res: {
8334
9073
  /**
8335
- * Property deleted successfully
9074
+ * Test result
8336
9075
  */
8337
- 204: void;
9076
+ 200: TestRuleResponseDto;
8338
9077
  /**
8339
9078
  * Unauthorized
8340
9079
  */
8341
- 401: unknown;
9080
+ 401: ApiProblemResponseDto;
8342
9081
  /**
8343
- * Forbidden - insufficient permissions
9082
+ * Forbidden - not owner of rule
8344
9083
  */
8345
- 403: unknown;
9084
+ 403: ApiProblemResponseDto;
8346
9085
  /**
8347
- * Property not found
9086
+ * Rule not found
8348
9087
  */
8349
- 404: unknown;
9088
+ 404: ApiProblemResponseDto;
8350
9089
  };
8351
9090
  };
8352
9091
  };
@@ -8446,6 +9185,85 @@ export type $OpenApiTs = {
8446
9185
  };
8447
9186
  };
8448
9187
  };
9188
+ '/api/v1/{region}/bean/onboarding': {
9189
+ post: {
9190
+ req: OnboardingControllerBootstrapData;
9191
+ res: {
9192
+ /**
9193
+ * Onboarding bootstrap result.
9194
+ */
9195
+ 201: unknown;
9196
+ /**
9197
+ * Invalid region/account path/duplicate paths.
9198
+ */
9199
+ 422: unknown;
9200
+ };
9201
+ };
9202
+ };
9203
+ '/api/v1/{region}/bean/reconciliations': {
9204
+ post: {
9205
+ req: ReconciliationControllerComputeData;
9206
+ res: {
9207
+ /**
9208
+ * Reconciliation preview
9209
+ */
9210
+ 200: ReconciliationComputeResultDto;
9211
+ /**
9212
+ * Account not found
9213
+ */
9214
+ 404: unknown;
9215
+ };
9216
+ };
9217
+ };
9218
+ '/api/v1/{region}/bean/reconciliations/assert': {
9219
+ post: {
9220
+ req: ReconciliationControllerAssertData;
9221
+ res: {
9222
+ /**
9223
+ * Balance assertion recorded
9224
+ */
9225
+ 201: ReconciliationRecordDto;
9226
+ /**
9227
+ * Account not found
9228
+ */
9229
+ 404: unknown;
9230
+ };
9231
+ };
9232
+ };
9233
+ '/api/v1/{region}/bean/reconciliations/pad': {
9234
+ post: {
9235
+ req: ReconciliationControllerPadData;
9236
+ res: {
9237
+ /**
9238
+ * Pad adjusting entry generated
9239
+ */
9240
+ 201: PadResultDto;
9241
+ /**
9242
+ * Book already within tolerance — no pad needed
9243
+ */
9244
+ 400: unknown;
9245
+ /**
9246
+ * Account not found
9247
+ */
9248
+ 404: unknown;
9249
+ };
9250
+ };
9251
+ };
9252
+ '/api/v1/{region}/bean/accounts/{accountId}/reconciliations': {
9253
+ get: {
9254
+ req: ReconciliationControllerHistoryData;
9255
+ res: {
9256
+ /**
9257
+ * Reconciliation history
9258
+ */
9259
+ 200: Array<ReconciliationRecordDto>;
9260
+ /**
9261
+ * Account not found
9262
+ */
9263
+ 404: unknown;
9264
+ };
9265
+ };
9266
+ };
8449
9267
  '/api/v1/{region}/bean/export/beancount': {
8450
9268
  get: {
8451
9269
  res: {
@@ -8569,102 +9387,30 @@ export type $OpenApiTs = {
8569
9387
  /**
8570
9388
  * Configuration updated successfully
8571
9389
  */
8572
- 200: ImporterConfigDto;
8573
- /**
8574
- * Invalid input - Validation failed
8575
- */
8576
- 400: ApiProblemResponseDto;
8577
- /**
8578
- * Configuration not found
8579
- */
8580
- 404: ApiProblemResponseDto;
8581
- };
8582
- };
8583
- };
8584
- '/api/v1/{region}/bean/import/config/{importerId}/reset': {
8585
- post: {
8586
- req: ImporterConfigControllerResetConfigData;
8587
- res: {
8588
- /**
8589
- * Configuration reset successfully
8590
- */
8591
- 200: ImporterConfigDto;
8592
- /**
8593
- * Invalid input - Unsupported importer
8594
- */
8595
- 400: ApiProblemResponseDto;
8596
- };
8597
- };
8598
- };
8599
- '/api/v1/bean/platforms': {
8600
- get: {
8601
- res: {
8602
- /**
8603
- * List of platforms with binding and account counts
8604
- */
8605
- 200: unknown;
8606
- };
8607
- };
8608
- post: {
8609
- req: PlatformControllerCreateData;
8610
- res: {
8611
- /**
8612
- * Platform created successfully
8613
- */
8614
- 201: unknown;
8615
- /**
8616
- * Platform already exists
8617
- */
8618
- 409: unknown;
8619
- };
8620
- };
8621
- };
8622
- '/api/v1/bean/platforms/list': {
8623
- get: {
8624
- res: {
8625
- /**
8626
- * List of platforms with user binding status
8627
- */
8628
- 200: unknown;
8629
- };
8630
- };
8631
- };
8632
- '/api/v1/bean/platforms/match': {
8633
- get: {
8634
- req: PlatformControllerMatchPlatformsData;
8635
- res: {
8636
- /**
8637
- * List of matching platforms with suggested segment names
8638
- */
8639
- 200: unknown;
8640
- };
8641
- };
8642
- };
8643
- '/api/v1/bean/platforms/{id}': {
8644
- put: {
8645
- req: PlatformControllerUpdateData;
8646
- res: {
9390
+ 200: ImporterConfigDto;
8647
9391
  /**
8648
- * Platform updated successfully
9392
+ * Invalid input - Validation failed
8649
9393
  */
8650
- 200: unknown;
9394
+ 400: ApiProblemResponseDto;
8651
9395
  /**
8652
- * Platform not found
9396
+ * Configuration not found
8653
9397
  */
8654
- 404: unknown;
9398
+ 404: ApiProblemResponseDto;
8655
9399
  };
8656
9400
  };
8657
- delete: {
8658
- req: PlatformControllerDeleteData;
9401
+ };
9402
+ '/api/v1/{region}/bean/import/config/{importerId}/reset': {
9403
+ post: {
9404
+ req: ImporterConfigControllerResetConfigData;
8659
9405
  res: {
8660
9406
  /**
8661
- * Platform deleted successfully
9407
+ * Configuration reset successfully
8662
9408
  */
8663
- 204: void;
9409
+ 200: ImporterConfigDto;
8664
9410
  /**
8665
- * Platform not found
9411
+ * Invalid input - Unsupported importer
8666
9412
  */
8667
- 404: unknown;
9413
+ 400: ApiProblemResponseDto;
8668
9414
  };
8669
9415
  };
8670
9416
  };
@@ -8721,6 +9467,54 @@ export type $OpenApiTs = {
8721
9467
  };
8722
9468
  };
8723
9469
  };
9470
+ '/api/v1/{region}/bean/external-account-links': {
9471
+ post: {
9472
+ req: ExternalAccountLinkControllerCreateData;
9473
+ res: {
9474
+ /**
9475
+ * Link created.
9476
+ */
9477
+ 201: ExternalAccountLinkResponseDto;
9478
+ /**
9479
+ * beanAccountId not owned, or an active link already exists.
9480
+ */
9481
+ 422: unknown;
9482
+ };
9483
+ };
9484
+ get: {
9485
+ req: ExternalAccountLinkControllerFindAllData;
9486
+ res: {
9487
+ /**
9488
+ * Links retrieved.
9489
+ */
9490
+ 200: ExternalAccountLinkListResponseDto;
9491
+ };
9492
+ };
9493
+ };
9494
+ '/api/v1/{region}/bean/external-account-links/{id}': {
9495
+ get: {
9496
+ req: ExternalAccountLinkControllerFindOneData;
9497
+ res: {
9498
+ /**
9499
+ * Link retrieved.
9500
+ */
9501
+ 200: ExternalAccountLinkResponseDto;
9502
+ /**
9503
+ * Link not found or not owned by the user.
9504
+ */
9505
+ 422: unknown;
9506
+ };
9507
+ };
9508
+ delete: {
9509
+ req: ExternalAccountLinkControllerRemoveData;
9510
+ res: {
9511
+ /**
9512
+ * Link soft-deleted; historical transactions are unaffected.
9513
+ */
9514
+ 204: void;
9515
+ };
9516
+ };
9517
+ };
8724
9518
  '/api/v1/{region}/bean/import/parser-telemetry': {
8725
9519
  post: {
8726
9520
  req: TelemetryControllerReportTelemetryData;
@@ -8809,188 +9603,104 @@ export type $OpenApiTs = {
8809
9603
  };
8810
9604
  };
8811
9605
  };
8812
- '/api/v1/{region}/dashboard/net-worth': {
8813
- get: {
8814
- req: DashboardControllerGetNetWorthData;
8815
- res: {
8816
- /**
8817
- * Net worth retrieved successfully
8818
- */
8819
- 200: NetWorthResponseDto;
8820
- /**
8821
- * User not authenticated
8822
- */
8823
- 401: unknown;
8824
- };
8825
- };
8826
- };
8827
- '/api/v1/{region}/dashboard/accounts': {
8828
- get: {
8829
- req: DashboardControllerGetAccountsData;
8830
- res: {
8831
- /**
8832
- * Accounts retrieved successfully. Response type depends on groupBy parameter.
8833
- */
8834
- 200:
8835
- | AccountsResponseDto
8836
- | AssetClassAccountsResponseDto
8837
- | HoldingAssetClassCrossAccountResponseDto;
8838
- /**
8839
- * User not authenticated
8840
- */
8841
- 401: unknown;
8842
- };
8843
- };
8844
- };
8845
- '/api/v1/{region}/dashboard/cash-flow': {
8846
- get: {
8847
- req: DashboardControllerGetCashFlowData;
8848
- res: {
8849
- /**
8850
- * Cash flow retrieved successfully
8851
- */
8852
- 200: CashFlowResponseDto;
8853
- /**
8854
- * Invalid period format
8855
- */
8856
- 400: unknown;
8857
- /**
8858
- * User not authenticated
8859
- */
8860
- 401: unknown;
8861
- };
8862
- };
8863
- };
8864
- '/api/v1/{region}/dashboard/expenses': {
8865
- get: {
8866
- req: DashboardControllerGetExpensesData;
8867
- res: {
8868
- /**
8869
- * Expenses retrieved successfully
8870
- */
8871
- 200: ExpensesByCategoryResponseDto;
8872
- /**
8873
- * Invalid groupBy or period
8874
- */
8875
- 400: unknown;
8876
- /**
8877
- * User not authenticated
8878
- */
8879
- 401: unknown;
8880
- };
8881
- };
8882
- };
8883
- '/api/v1/{region}/investment/holdings/pnl': {
9606
+ '/api/v1/bean/platforms': {
8884
9607
  get: {
8885
- req: HoldingPnlControllerGetHoldingPnlData;
8886
9608
  res: {
8887
9609
  /**
8888
- * Holding P&L retrieved successfully
8889
- */
8890
- 200: HoldingPnlResponseDto;
8891
- /**
8892
- * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
8893
- */
8894
- 400: unknown;
8895
- /**
8896
- * User not authenticated
9610
+ * List of platforms with binding and account counts
8897
9611
  */
8898
- 401: unknown;
9612
+ 200: unknown;
8899
9613
  };
8900
9614
  };
8901
- };
8902
- '/api/v1/{region}/bean/prices': {
8903
9615
  post: {
8904
- req: PriceControllerCreateData;
9616
+ req: PlatformControllerCreateData;
8905
9617
  res: {
8906
9618
  /**
8907
- * Price created successfully
8908
- */
8909
- 201: PriceResponseDto;
8910
- /**
8911
- * Currency or quoteCurrency commodity not found
9619
+ * Platform created successfully
8912
9620
  */
8913
- 404: unknown;
9621
+ 201: unknown;
8914
9622
  /**
8915
- * Price already exists for this currency pair and date
9623
+ * Platform already exists
8916
9624
  */
8917
9625
  409: unknown;
8918
9626
  };
8919
9627
  };
9628
+ };
9629
+ '/api/v1/bean/platforms/list': {
8920
9630
  get: {
8921
- req: PriceControllerFindAllData;
8922
9631
  res: {
8923
9632
  /**
8924
- * Prices retrieved successfully
9633
+ * List of platforms with user binding status
8925
9634
  */
8926
- 200: PriceListResponseDto;
9635
+ 200: Array<PlatformListItemDto>;
8927
9636
  };
8928
9637
  };
8929
9638
  };
8930
- '/api/v1/{region}/bean/prices/{id}': {
9639
+ '/api/v1/bean/platforms/match': {
8931
9640
  get: {
8932
- req: PriceControllerFindOneData;
9641
+ req: PlatformControllerMatchPlatformsData;
8933
9642
  res: {
8934
9643
  /**
8935
- * Price retrieved successfully
8936
- */
8937
- 200: PriceResponseDto;
8938
- /**
8939
- * Price not found
9644
+ * Matching platforms with overall match type and truncation flag
8940
9645
  */
8941
- 404: unknown;
9646
+ 200: PlatformMatchResponseDto;
8942
9647
  };
8943
9648
  };
9649
+ };
9650
+ '/api/v1/bean/platforms/{id}': {
8944
9651
  put: {
8945
- req: PriceControllerUpdateData;
9652
+ req: PlatformControllerUpdateData;
8946
9653
  res: {
8947
9654
  /**
8948
- * Price updated successfully
9655
+ * Platform updated successfully
8949
9656
  */
8950
- 200: PriceResponseDto;
9657
+ 200: unknown;
8951
9658
  /**
8952
- * Price not found
9659
+ * Platform not found
8953
9660
  */
8954
9661
  404: unknown;
8955
- /**
8956
- * Updated price conflicts with existing price
8957
- */
8958
- 409: unknown;
8959
9662
  };
8960
9663
  };
8961
9664
  delete: {
8962
- req: PriceControllerDeleteData;
9665
+ req: PlatformControllerDeleteData;
8963
9666
  res: {
8964
9667
  /**
8965
- * Price deleted successfully
9668
+ * Platform deleted successfully
8966
9669
  */
8967
9670
  204: void;
8968
9671
  /**
8969
- * Price not found
9672
+ * Platform not found
8970
9673
  */
8971
9674
  404: unknown;
8972
9675
  };
8973
9676
  };
8974
9677
  };
8975
- '/api/v1/{region}/bean/prices/bulk': {
8976
- post: {
8977
- req: PriceControllerBulkCreateData;
9678
+ '/api/v1/{region}/dashboard/net-worth': {
9679
+ get: {
9680
+ req: DashboardControllerGetNetWorthData;
8978
9681
  res: {
8979
9682
  /**
8980
- * Prices created successfully
9683
+ * Net worth retrieved successfully
8981
9684
  */
8982
- 201: Array<PriceResponseDto>;
9685
+ 200: NetWorthResponseDto;
9686
+ /**
9687
+ * User not authenticated
9688
+ */
9689
+ 401: unknown;
8983
9690
  };
8984
9691
  };
8985
9692
  };
8986
- '/api/v1/{region}/reporting/portfolio/trends': {
9693
+ '/api/v1/{region}/dashboard/accounts': {
8987
9694
  get: {
8988
- req: ReportingControllerGetPortfolioTrendsData;
9695
+ req: DashboardControllerGetAccountsData;
8989
9696
  res: {
8990
9697
  /**
8991
- * Trends retrieved successfully
9698
+ * Accounts retrieved successfully. Response type depends on groupBy parameter.
8992
9699
  */
8993
- 200: PortfolioTrendsResponseDto;
9700
+ 200:
9701
+ | AccountsResponseDto
9702
+ | AssetClassAccountsResponseDto
9703
+ | HoldingAssetClassCrossAccountResponseDto;
8994
9704
  /**
8995
9705
  * User not authenticated
8996
9706
  */
@@ -8998,14 +9708,18 @@ export type $OpenApiTs = {
8998
9708
  };
8999
9709
  };
9000
9710
  };
9001
- '/api/v1/{region}/reporting/cash-flow/trends': {
9711
+ '/api/v1/{region}/dashboard/cash-flow': {
9002
9712
  get: {
9003
- req: ReportingControllerGetCashFlowTrendsData;
9713
+ req: DashboardControllerGetCashFlowData;
9004
9714
  res: {
9005
9715
  /**
9006
- * Cash-flow trends retrieved successfully
9716
+ * Cash flow retrieved successfully
9007
9717
  */
9008
- 200: CashFlowTrendsResponseDto;
9718
+ 200: CashFlowResponseDto;
9719
+ /**
9720
+ * Invalid period format
9721
+ */
9722
+ 400: unknown;
9009
9723
  /**
9010
9724
  * User not authenticated
9011
9725
  */
@@ -9013,16 +9727,16 @@ export type $OpenApiTs = {
9013
9727
  };
9014
9728
  };
9015
9729
  };
9016
- '/api/v1/{region}/reporting/snapshots/generate': {
9017
- post: {
9018
- req: ReportingControllerGenerateSnapshotData;
9730
+ '/api/v1/{region}/dashboard/expenses': {
9731
+ get: {
9732
+ req: DashboardControllerGetExpensesData;
9019
9733
  res: {
9020
9734
  /**
9021
- * Snapshot generated successfully
9735
+ * Expenses retrieved successfully
9022
9736
  */
9023
- 200: GenerateSnapshotResponse;
9737
+ 200: ExpensesByCategoryResponseDto;
9024
9738
  /**
9025
- * Invalid date format
9739
+ * Invalid groupBy or period
9026
9740
  */
9027
9741
  400: unknown;
9028
9742
  /**
@@ -9032,26 +9746,22 @@ export type $OpenApiTs = {
9032
9746
  };
9033
9747
  };
9034
9748
  };
9035
- '/api/v1/{region}/reporting/snapshots/backfill': {
9036
- post: {
9037
- req: ReportingControllerBackfillSnapshotsData;
9749
+ '/api/v1/{region}/investment/holdings/pnl': {
9750
+ get: {
9751
+ req: HoldingPnlControllerGetHoldingPnlData;
9038
9752
  res: {
9039
9753
  /**
9040
- * Backfill completed successfully
9754
+ * Holding P&L retrieved successfully
9041
9755
  */
9042
- 200: BackfillSnapshotsResponse;
9756
+ 200: HoldingPnlResponseDto;
9043
9757
  /**
9044
- * Invalid date format or range
9758
+ * Invalid asOf format/value/future date, invalid accountId format, or unsupported method
9045
9759
  */
9046
9760
  400: unknown;
9047
9761
  /**
9048
9762
  * User not authenticated
9049
9763
  */
9050
9764
  401: unknown;
9051
- /**
9052
- * Backfill already in progress for this user
9053
- */
9054
- 409: unknown;
9055
9765
  };
9056
9766
  };
9057
9767
  };
@@ -9076,7 +9786,7 @@ export type $OpenApiTs = {
9076
9786
  /**
9077
9787
  * Login successful
9078
9788
  */
9079
- 200: unknown;
9789
+ 200: AnonymousLoginResponseDto;
9080
9790
  /**
9081
9791
  * Invalid access token
9082
9792
  */