@firela/api-types 0.0.0-canary.610daafc → 0.0.0-canary.6a42fd0e

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.
@@ -1966,6 +1966,108 @@ export type UpdateCommodityDto = {
1966
1966
  };
1967
1967
  };
1968
1968
 
1969
+ export type CreateBeanPriceDto = {
1970
+ /**
1971
+ * Currency being priced (e.g., USD, AAPL, BTC)
1972
+ */
1973
+ currency: string;
1974
+ /**
1975
+ * Quote currency (pricing currency, e.g., CNY, EUR)
1976
+ */
1977
+ quoteCurrency: string;
1978
+ /**
1979
+ * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
1980
+ */
1981
+ amount: number;
1982
+ /**
1983
+ * Price date (ISO 8601 format)
1984
+ */
1985
+ date: string;
1986
+ /**
1987
+ * Metadata (validated by Zod schema, max field lengths enforced)
1988
+ */
1989
+ metadata?: {
1990
+ [key: string]: unknown;
1991
+ };
1992
+ };
1993
+
1994
+ export type PriceResponseDto = {
1995
+ /**
1996
+ * Unique identifier
1997
+ */
1998
+ id: string;
1999
+ /**
2000
+ * User ID (owner of the price)
2001
+ */
2002
+ userId: string;
2003
+ /**
2004
+ * Currency being priced (e.g., USD, AAPL, BTC)
2005
+ */
2006
+ currency: string;
2007
+ /**
2008
+ * Quote currency (pricing currency, e.g., USD, CNY)
2009
+ */
2010
+ quoteCurrency: string;
2011
+ /**
2012
+ * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
2013
+ */
2014
+ amount: number;
2015
+ /**
2016
+ * Price date (ISO 8601 format). Represents the date this price was valid.
2017
+ */
2018
+ date: string;
2019
+ /**
2020
+ * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
2021
+ */
2022
+ meta: {
2023
+ [key: string]: unknown;
2024
+ };
2025
+ /**
2026
+ * Creation timestamp
2027
+ */
2028
+ createdAt: string;
2029
+ /**
2030
+ * Last update timestamp
2031
+ */
2032
+ updatedAt: string;
2033
+ };
2034
+
2035
+ export type PriceListResponseDto = {
2036
+ /**
2037
+ * List of prices
2038
+ */
2039
+ items: Array<PriceResponseDto>;
2040
+ /**
2041
+ * Total number of prices
2042
+ */
2043
+ total: number;
2044
+ };
2045
+
2046
+ export type UpdateBeanPriceDto = {
2047
+ /**
2048
+ * Currency being priced
2049
+ */
2050
+ currency?: string;
2051
+ /**
2052
+ * Quote currency (pricing currency)
2053
+ */
2054
+ quoteCurrency?: string;
2055
+ /**
2056
+ * Price amount (MUST be >= 0 per Beancount spec)
2057
+ */
2058
+ amount?: number;
2059
+ /**
2060
+ * Price date (ISO 8601 format)
2061
+ */
2062
+ date?: string;
2063
+ /**
2064
+ * Metadata
2065
+ */
2066
+ metadata?: {
2067
+ [key: string]: unknown;
2068
+ };
2069
+ };
2070
+
1969
2071
  export type CreateRecurringRuleDto = {
1970
2072
  /**
1971
2073
  * Rule name (unique per user)
@@ -3168,6 +3270,130 @@ export type UpdateBeanEventDto = {
3168
3270
  };
3169
3271
  };
3170
3272
 
3273
+ export type ActualBalanceDto = {
3274
+ /**
3275
+ * Actual balance amount as a decimal string (preserves precision for tolerance inference).
3276
+ */
3277
+ amount: string;
3278
+ /**
3279
+ * Currency code (ISO 4217 or commodity ticker).
3280
+ */
3281
+ ccy: string;
3282
+ };
3283
+
3284
+ export type ComputeReconciliationDto = {
3285
+ /**
3286
+ * BeanAccount id to reconcile.
3287
+ */
3288
+ accountId: string;
3289
+ /**
3290
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3291
+ */
3292
+ asOfDate: string;
3293
+ /**
3294
+ * Actual balance from the external statement.
3295
+ */
3296
+ actualBalance: ActualBalanceDto;
3297
+ };
3298
+
3299
+ export type ReconciliationComputeResultDto = {
3300
+ accountId: string;
3301
+ asOfDate: string;
3302
+ /**
3303
+ * System-computed book balance (decimal string).
3304
+ */
3305
+ bookBalance: string;
3306
+ /**
3307
+ * User-entered actual balance (decimal string).
3308
+ */
3309
+ actualBalance: string;
3310
+ currency: string;
3311
+ /**
3312
+ * Diff = book − actual (decimal string).
3313
+ */
3314
+ diff: string;
3315
+ /**
3316
+ * Applied tolerance (decimal string).
3317
+ */
3318
+ tolerance: string;
3319
+ /**
3320
+ * true when |diff| ≤ tolerance.
3321
+ */
3322
+ withinTolerance: boolean;
3323
+ /**
3324
+ * Suggested next action: assert when within tolerance, pad otherwise.
3325
+ */
3326
+ suggestedAction: 'assert' | 'pad';
3327
+ };
3328
+
3329
+ /**
3330
+ * Suggested next action: assert when within tolerance, pad otherwise.
3331
+ */
3332
+ export type suggestedAction = 'assert' | 'pad';
3333
+
3334
+ export type AssertReconciliationDto = {
3335
+ /**
3336
+ * BeanAccount id to reconcile.
3337
+ */
3338
+ accountId: string;
3339
+ /**
3340
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3341
+ */
3342
+ asOfDate: string;
3343
+ /**
3344
+ * Actual balance from the external statement.
3345
+ */
3346
+ actualBalance: ActualBalanceDto;
3347
+ /**
3348
+ * Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).
3349
+ */
3350
+ tolerance?: string;
3351
+ };
3352
+
3353
+ export type ReconciliationRecordDto = {
3354
+ id: string;
3355
+ accountId: string;
3356
+ date: string;
3357
+ /**
3358
+ * Asserted (actual) amount.
3359
+ */
3360
+ amount: string;
3361
+ currency: string;
3362
+ tolerance?: string;
3363
+ /**
3364
+ * book − actual.
3365
+ */
3366
+ diffAmount?: string;
3367
+ diffCurrency?: string;
3368
+ createdAt: string;
3369
+ };
3370
+
3371
+ export type PadReconciliationDto = {
3372
+ /**
3373
+ * BeanAccount id to reconcile.
3374
+ */
3375
+ accountId: string;
3376
+ /**
3377
+ * Assertion date (ISO 8601, e.g. "2026-07-24").
3378
+ */
3379
+ asOfDate: string;
3380
+ /**
3381
+ * Actual balance from the external statement.
3382
+ */
3383
+ actualBalance: ActualBalanceDto;
3384
+ /**
3385
+ * Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).
3386
+ */
3387
+ sourceAccount?: string;
3388
+ };
3389
+
3390
+ export type PadResultDto = {
3391
+ /**
3392
+ * Created pad adjusting transaction id.
3393
+ */
3394
+ transactionId: string;
3395
+ };
3396
+
3171
3397
  export type FileImportDto = {
3172
3398
  /**
3173
3399
  * Bill file to import (CSV, PDF, OFX, etc.)
@@ -4922,181 +5148,79 @@ export type HoldingPnlResponseDto = {
4922
5148
  */
4923
5149
  export type method = 'average' | 'FIFO';
4924
5150
 
4925
- export type CreateBeanPriceDto = {
5151
+ export type CurrencyBalanceDto = {
4926
5152
  /**
4927
- * Currency being priced (e.g., USD, AAPL, BTC)
5153
+ * ISO 4217 currency code
4928
5154
  */
4929
5155
  currency: string;
4930
5156
  /**
4931
- * Quote currency (pricing currency, e.g., CNY, EUR)
5157
+ * Balance amount
4932
5158
  */
4933
- quoteCurrency: string;
5159
+ balance: string;
5160
+ };
5161
+
5162
+ export type TimeSeriesPointDto = {
4934
5163
  /**
4935
- * Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.
5164
+ * Date in YYYY-MM-DD format
4936
5165
  */
4937
- amount: number;
5166
+ date: string;
4938
5167
  /**
4939
- * Price date (ISO 8601 format)
5168
+ * Value at this date (in base currency)
4940
5169
  */
4941
- date: string;
5170
+ value: string;
4942
5171
  /**
4943
- * Metadata (validated by Zod schema, max field lengths enforced)
5172
+ * Change from previous point
4944
5173
  */
4945
- metadata?: {
5174
+ change?: {
4946
5175
  [key: string]: unknown;
4947
5176
  };
4948
- };
4949
-
4950
- export type PriceResponseDto = {
4951
5177
  /**
4952
- * Unique identifier
5178
+ * Total assets at this date (in base currency)
4953
5179
  */
4954
- id: string;
5180
+ assets?: string;
4955
5181
  /**
4956
- * User ID (owner of the price)
5182
+ * Total liabilities at this date (in base currency)
4957
5183
  */
4958
- userId: string;
5184
+ liabilities?: string;
4959
5185
  /**
4960
- * Currency being priced (e.g., USD, AAPL, BTC)
5186
+ * Multi-currency breakdown for this point
4961
5187
  */
4962
- currency: string;
5188
+ byCurrency?: Array<CurrencyBalanceDto>;
5189
+ };
5190
+
5191
+ export type TrendSummaryDto = {
4963
5192
  /**
4964
- * Quote currency (pricing currency, e.g., USD, CNY)
5193
+ * Value at start of period
4965
5194
  */
4966
- quoteCurrency: string;
5195
+ startValue: string;
4967
5196
  /**
4968
- * Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.
5197
+ * Value at end of period
4969
5198
  */
4970
- amount: number;
5199
+ endValue: string;
4971
5200
  /**
4972
- * Price date (ISO 8601 format). Represents the date this price was valid.
5201
+ * Total change over period
4973
5202
  */
4974
- date: string;
5203
+ totalChange: string;
4975
5204
  /**
4976
- * Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.
5205
+ * Total change percentage
4977
5206
  */
4978
- meta: {
4979
- [key: string]: unknown;
4980
- };
5207
+ totalChangePercentage: string;
5208
+ };
5209
+
5210
+ export type MultiCurrencyPointDto = {
4981
5211
  /**
4982
- * Creation timestamp
5212
+ * Date in YYYY-MM-DD format
4983
5213
  */
4984
- createdAt: string;
5214
+ date: string;
4985
5215
  /**
4986
- * Last update timestamp
5216
+ * Balances by currency
4987
5217
  */
4988
- updatedAt: string;
5218
+ byCurrency: Array<CurrencyBalanceDto>;
4989
5219
  };
4990
5220
 
4991
- export type PriceListResponseDto = {
5221
+ export type PortfolioTrendsResponseDto = {
4992
5222
  /**
4993
- * List of prices
4994
- */
4995
- items: Array<PriceResponseDto>;
4996
- /**
4997
- * Total number of prices
4998
- */
4999
- total: number;
5000
- };
5001
-
5002
- export type UpdateBeanPriceDto = {
5003
- /**
5004
- * Currency being priced
5005
- */
5006
- currency?: string;
5007
- /**
5008
- * Quote currency (pricing currency)
5009
- */
5010
- quoteCurrency?: string;
5011
- /**
5012
- * Price amount (MUST be >= 0 per Beancount spec)
5013
- */
5014
- amount?: number;
5015
- /**
5016
- * Price date (ISO 8601 format)
5017
- */
5018
- date?: string;
5019
- /**
5020
- * Metadata
5021
- */
5022
- metadata?: {
5023
- [key: string]: unknown;
5024
- };
5025
- };
5026
-
5027
- export type CurrencyBalanceDto = {
5028
- /**
5029
- * ISO 4217 currency code
5030
- */
5031
- currency: string;
5032
- /**
5033
- * Balance amount
5034
- */
5035
- balance: string;
5036
- };
5037
-
5038
- export type TimeSeriesPointDto = {
5039
- /**
5040
- * Date in YYYY-MM-DD format
5041
- */
5042
- date: string;
5043
- /**
5044
- * Value at this date (in base currency)
5045
- */
5046
- value: string;
5047
- /**
5048
- * Change from previous point
5049
- */
5050
- change?: {
5051
- [key: string]: unknown;
5052
- };
5053
- /**
5054
- * Total assets at this date (in base currency)
5055
- */
5056
- assets?: string;
5057
- /**
5058
- * Total liabilities at this date (in base currency)
5059
- */
5060
- liabilities?: string;
5061
- /**
5062
- * Multi-currency breakdown for this point
5063
- */
5064
- byCurrency?: Array<CurrencyBalanceDto>;
5065
- };
5066
-
5067
- export type TrendSummaryDto = {
5068
- /**
5069
- * Value at start of period
5070
- */
5071
- startValue: string;
5072
- /**
5073
- * Value at end of period
5074
- */
5075
- endValue: string;
5076
- /**
5077
- * Total change over period
5078
- */
5079
- totalChange: string;
5080
- /**
5081
- * Total change percentage
5082
- */
5083
- totalChangePercentage: string;
5084
- };
5085
-
5086
- export type MultiCurrencyPointDto = {
5087
- /**
5088
- * Date in YYYY-MM-DD format
5089
- */
5090
- date: string;
5091
- /**
5092
- * Balances by currency
5093
- */
5094
- byCurrency: Array<CurrencyBalanceDto>;
5095
- };
5096
-
5097
- export type PortfolioTrendsResponseDto = {
5098
- /**
5099
- * Time series data points
5223
+ * Time series data points
5100
5224
  */
5101
5225
  series: Array<TimeSeriesPointDto>;
5102
5226
  /**
@@ -5906,6 +6030,103 @@ export type CommodityControllerBulkCreateData = {
5906
6030
 
5907
6031
  export type CommodityControllerBulkCreateResponse = Array<CommodityResponseDto>;
5908
6032
 
6033
+ export type PriceControllerCreateData = {
6034
+ /**
6035
+ * Region code for tenant context
6036
+ */
6037
+ region: 'cn' | 'us' | 'de' | 'gb';
6038
+ requestBody: CreateBeanPriceDto;
6039
+ };
6040
+
6041
+ export type PriceControllerCreateResponse = PriceResponseDto;
6042
+
6043
+ export type PriceControllerFindAllData = {
6044
+ /**
6045
+ * Filter by currency (e.g., BTC, AAPL, USD)
6046
+ */
6047
+ currency?: string;
6048
+ /**
6049
+ * Filter prices from this date (ISO 8601 format)
6050
+ */
6051
+ dateFrom?: string;
6052
+ /**
6053
+ * Filter prices to this date (ISO 8601 format)
6054
+ */
6055
+ dateTo?: string;
6056
+ /**
6057
+ * Number of items per page (default: 20, max: 100)
6058
+ */
6059
+ limit?: number;
6060
+ /**
6061
+ * Page number for pagination (default: 1)
6062
+ */
6063
+ page?: number;
6064
+ /**
6065
+ * Filter by quote currency (pricing currency, e.g., USD, CNY)
6066
+ */
6067
+ quoteCurrency?: string;
6068
+ /**
6069
+ * Region code for tenant context
6070
+ */
6071
+ region: 'cn' | 'us' | 'de' | 'gb';
6072
+ /**
6073
+ * Search term for currency or quoteCurrency (case-insensitive partial match)
6074
+ */
6075
+ search?: string;
6076
+ };
6077
+
6078
+ export type PriceControllerFindAllResponse = PriceListResponseDto;
6079
+
6080
+ export type PriceControllerFindOneData = {
6081
+ /**
6082
+ * Price ID
6083
+ */
6084
+ id: string;
6085
+ /**
6086
+ * Region code for tenant context
6087
+ */
6088
+ region: 'cn' | 'us' | 'de' | 'gb';
6089
+ };
6090
+
6091
+ export type PriceControllerFindOneResponse = PriceResponseDto;
6092
+
6093
+ export type PriceControllerUpdateData = {
6094
+ /**
6095
+ * Price ID
6096
+ */
6097
+ id: string;
6098
+ /**
6099
+ * Region code for tenant context
6100
+ */
6101
+ region: 'cn' | 'us' | 'de' | 'gb';
6102
+ requestBody: UpdateBeanPriceDto;
6103
+ };
6104
+
6105
+ export type PriceControllerUpdateResponse = PriceResponseDto;
6106
+
6107
+ export type PriceControllerDeleteData = {
6108
+ /**
6109
+ * Price ID
6110
+ */
6111
+ id: string;
6112
+ /**
6113
+ * Region code for tenant context
6114
+ */
6115
+ region: 'cn' | 'us' | 'de' | 'gb';
6116
+ };
6117
+
6118
+ export type PriceControllerDeleteResponse = void;
6119
+
6120
+ export type PriceControllerBulkCreateData = {
6121
+ /**
6122
+ * Region code for tenant context
6123
+ */
6124
+ region: 'cn' | 'us' | 'de' | 'gb';
6125
+ requestBody: Array<string>;
6126
+ };
6127
+
6128
+ export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
6129
+
5909
6130
  export type RecurringRuleControllerCreateData = {
5910
6131
  /**
5911
6132
  * Region code for tenant context
@@ -6469,6 +6690,51 @@ export type EventControllerGetSliceData = {
6469
6690
 
6470
6691
  export type EventControllerGetSliceResponse = unknown;
6471
6692
 
6693
+ export type ReconciliationControllerComputeData = {
6694
+ /**
6695
+ * Region code for tenant context (decorative for reconciliation)
6696
+ */
6697
+ region: 'cn' | 'us' | 'de' | 'gb';
6698
+ requestBody: ComputeReconciliationDto;
6699
+ };
6700
+
6701
+ export type ReconciliationControllerComputeResponse =
6702
+ ReconciliationComputeResultDto;
6703
+
6704
+ export type ReconciliationControllerAssertData = {
6705
+ /**
6706
+ * Region code for tenant context (decorative for reconciliation)
6707
+ */
6708
+ region: 'cn' | 'us' | 'de' | 'gb';
6709
+ requestBody: AssertReconciliationDto;
6710
+ };
6711
+
6712
+ export type ReconciliationControllerAssertResponse = ReconciliationRecordDto;
6713
+
6714
+ export type ReconciliationControllerPadData = {
6715
+ /**
6716
+ * Region code for tenant context (decorative for reconciliation)
6717
+ */
6718
+ region: 'cn' | 'us' | 'de' | 'gb';
6719
+ requestBody: PadReconciliationDto;
6720
+ };
6721
+
6722
+ export type ReconciliationControllerPadResponse = PadResultDto;
6723
+
6724
+ export type ReconciliationControllerHistoryData = {
6725
+ /**
6726
+ * BeanAccount id
6727
+ */
6728
+ accountId: string;
6729
+ /**
6730
+ * Region code for tenant context (decorative for reconciliation)
6731
+ */
6732
+ region: 'cn' | 'us' | 'de' | 'gb';
6733
+ };
6734
+
6735
+ export type ReconciliationControllerHistoryResponse =
6736
+ Array<ReconciliationRecordDto>;
6737
+
6472
6738
  export type ExportControllerExportBeancountResponse = unknown;
6473
6739
 
6474
6740
  export type FileImportControllerImportFileData = {
@@ -6763,156 +7029,59 @@ export type DashboardControllerGetAccountsResponse =
6763
7029
 
6764
7030
  export type DashboardControllerGetCashFlowData = {
6765
7031
  /**
6766
- * Period in YYYY-MM format
6767
- */
6768
- period: string;
6769
- /**
6770
- * Region code for tenant context
6771
- */
6772
- region: 'cn' | 'us' | 'de' | 'gb';
6773
- };
6774
-
6775
- export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6776
-
6777
- export type DashboardControllerGetExpensesData = {
6778
- /**
6779
- * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
6780
- */
6781
- flow?: 'expense' | 'income';
6782
- /**
6783
- * Grouping strategy
6784
- */
6785
- groupBy?: 'category';
6786
- /**
6787
- * Time window (1m = current calendar month)
6788
- */
6789
- period?: '1m' | '3m' | '6m' | '1y';
6790
- /**
6791
- * Region code for tenant context
6792
- */
6793
- region: 'cn' | 'us' | 'de' | 'gb';
6794
- };
6795
-
6796
- export type DashboardControllerGetExpensesResponse =
6797
- ExpensesByCategoryResponseDto;
6798
-
6799
- export type HoldingPnlControllerGetHoldingPnlData = {
6800
- /**
6801
- * Scope to a single account
6802
- */
6803
- accountId?: string;
6804
- /**
6805
- * As-of date (ISO 8601), defaults to today
6806
- */
6807
- asOf?: string;
6808
- /**
6809
- * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
6810
- */
6811
- method?: 'FIFO' | 'average';
6812
- /**
6813
- * Region code for tenant context
6814
- */
6815
- region: 'cn' | 'us' | 'de' | 'gb';
6816
- };
6817
-
6818
- export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6819
-
6820
- export type PriceControllerCreateData = {
6821
- /**
6822
- * Region code for tenant context
6823
- */
6824
- region: 'cn' | 'us' | 'de' | 'gb';
6825
- requestBody: CreateBeanPriceDto;
6826
- };
6827
-
6828
- export type PriceControllerCreateResponse = PriceResponseDto;
6829
-
6830
- export type PriceControllerFindAllData = {
6831
- /**
6832
- * Filter by currency (e.g., BTC, AAPL, USD)
6833
- */
6834
- currency?: string;
6835
- /**
6836
- * Filter prices from this date (ISO 8601 format)
6837
- */
6838
- dateFrom?: string;
6839
- /**
6840
- * Filter prices to this date (ISO 8601 format)
6841
- */
6842
- dateTo?: string;
6843
- /**
6844
- * Number of items per page (default: 20, max: 100)
6845
- */
6846
- limit?: number;
6847
- /**
6848
- * Page number for pagination (default: 1)
6849
- */
6850
- page?: number;
6851
- /**
6852
- * Filter by quote currency (pricing currency, e.g., USD, CNY)
6853
- */
6854
- quoteCurrency?: string;
6855
- /**
6856
- * Region code for tenant context
6857
- */
6858
- region: 'cn' | 'us' | 'de' | 'gb';
6859
- /**
6860
- * Search term for currency or quoteCurrency (case-insensitive partial match)
6861
- */
6862
- search?: string;
6863
- };
6864
-
6865
- export type PriceControllerFindAllResponse = PriceListResponseDto;
6866
-
6867
- export type PriceControllerFindOneData = {
6868
- /**
6869
- * Price ID
6870
- */
6871
- id: string;
6872
- /**
6873
- * Region code for tenant context
6874
- */
6875
- region: 'cn' | 'us' | 'de' | 'gb';
6876
- };
6877
-
6878
- export type PriceControllerFindOneResponse = PriceResponseDto;
6879
-
6880
- export type PriceControllerUpdateData = {
6881
- /**
6882
- * Price ID
7032
+ * Period in YYYY-MM format
6883
7033
  */
6884
- id: string;
7034
+ period: string;
6885
7035
  /**
6886
7036
  * Region code for tenant context
6887
7037
  */
6888
7038
  region: 'cn' | 'us' | 'de' | 'gb';
6889
- requestBody: UpdateBeanPriceDto;
6890
7039
  };
6891
7040
 
6892
- export type PriceControllerUpdateResponse = PriceResponseDto;
7041
+ export type DashboardControllerGetCashFlowResponse = CashFlowResponseDto;
6893
7042
 
6894
- export type PriceControllerDeleteData = {
7043
+ export type DashboardControllerGetExpensesData = {
6895
7044
  /**
6896
- * Price ID
7045
+ * Account root to aggregate (expense → ^Expenses:, income → ^Income:)
6897
7046
  */
6898
- id: string;
7047
+ flow?: 'expense' | 'income';
7048
+ /**
7049
+ * Grouping strategy
7050
+ */
7051
+ groupBy?: 'category';
7052
+ /**
7053
+ * Time window (1m = current calendar month)
7054
+ */
7055
+ period?: '1m' | '3m' | '6m' | '1y';
6899
7056
  /**
6900
7057
  * Region code for tenant context
6901
7058
  */
6902
7059
  region: 'cn' | 'us' | 'de' | 'gb';
6903
7060
  };
6904
7061
 
6905
- export type PriceControllerDeleteResponse = void;
7062
+ export type DashboardControllerGetExpensesResponse =
7063
+ ExpensesByCategoryResponseDto;
6906
7064
 
6907
- export type PriceControllerBulkCreateData = {
7065
+ export type HoldingPnlControllerGetHoldingPnlData = {
7066
+ /**
7067
+ * Scope to a single account
7068
+ */
7069
+ accountId?: string;
7070
+ /**
7071
+ * As-of date (ISO 8601), defaults to today
7072
+ */
7073
+ asOf?: string;
7074
+ /**
7075
+ * Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
7076
+ */
7077
+ method?: 'FIFO' | 'average';
6908
7078
  /**
6909
7079
  * Region code for tenant context
6910
7080
  */
6911
7081
  region: 'cn' | 'us' | 'de' | 'gb';
6912
- requestBody: Array<string>;
6913
7082
  };
6914
7083
 
6915
- export type PriceControllerBulkCreateResponse = Array<PriceResponseDto>;
7084
+ export type HoldingPnlControllerGetHoldingPnlResponse = HoldingPnlResponseDto;
6916
7085
 
6917
7086
  export type ReportingControllerGetPortfolioTrendsData = {
6918
7087
  /**
@@ -7737,6 +7906,90 @@ export type $OpenApiTs = {
7737
7906
  };
7738
7907
  };
7739
7908
  };
7909
+ '/api/v1/{region}/bean/prices': {
7910
+ post: {
7911
+ req: PriceControllerCreateData;
7912
+ res: {
7913
+ /**
7914
+ * Price created successfully
7915
+ */
7916
+ 201: PriceResponseDto;
7917
+ /**
7918
+ * Currency or quoteCurrency commodity not found
7919
+ */
7920
+ 404: unknown;
7921
+ /**
7922
+ * Price already exists for this currency pair and date
7923
+ */
7924
+ 409: unknown;
7925
+ };
7926
+ };
7927
+ get: {
7928
+ req: PriceControllerFindAllData;
7929
+ res: {
7930
+ /**
7931
+ * Prices retrieved successfully
7932
+ */
7933
+ 200: PriceListResponseDto;
7934
+ };
7935
+ };
7936
+ };
7937
+ '/api/v1/{region}/bean/prices/{id}': {
7938
+ get: {
7939
+ req: PriceControllerFindOneData;
7940
+ res: {
7941
+ /**
7942
+ * Price retrieved successfully
7943
+ */
7944
+ 200: PriceResponseDto;
7945
+ /**
7946
+ * Price not found
7947
+ */
7948
+ 404: unknown;
7949
+ };
7950
+ };
7951
+ put: {
7952
+ req: PriceControllerUpdateData;
7953
+ res: {
7954
+ /**
7955
+ * Price updated successfully
7956
+ */
7957
+ 200: PriceResponseDto;
7958
+ /**
7959
+ * Price not found
7960
+ */
7961
+ 404: unknown;
7962
+ /**
7963
+ * Updated price conflicts with existing price
7964
+ */
7965
+ 409: unknown;
7966
+ };
7967
+ };
7968
+ delete: {
7969
+ req: PriceControllerDeleteData;
7970
+ res: {
7971
+ /**
7972
+ * Price deleted successfully
7973
+ */
7974
+ 204: void;
7975
+ /**
7976
+ * Price not found
7977
+ */
7978
+ 404: unknown;
7979
+ };
7980
+ };
7981
+ };
7982
+ '/api/v1/{region}/bean/prices/bulk': {
7983
+ post: {
7984
+ req: PriceControllerBulkCreateData;
7985
+ res: {
7986
+ /**
7987
+ * Prices created successfully
7988
+ */
7989
+ 201: Array<PriceResponseDto>;
7990
+ };
7991
+ };
7992
+ };
7740
7993
  '/api/v1/{region}/bean/recurring-rules': {
7741
7994
  post: {
7742
7995
  req: RecurringRuleControllerCreateData;
@@ -8477,6 +8730,70 @@ export type $OpenApiTs = {
8477
8730
  };
8478
8731
  };
8479
8732
  };
8733
+ '/api/v1/{region}/bean/reconciliations': {
8734
+ post: {
8735
+ req: ReconciliationControllerComputeData;
8736
+ res: {
8737
+ /**
8738
+ * Reconciliation preview
8739
+ */
8740
+ 200: ReconciliationComputeResultDto;
8741
+ /**
8742
+ * Account not found
8743
+ */
8744
+ 404: unknown;
8745
+ };
8746
+ };
8747
+ };
8748
+ '/api/v1/{region}/bean/reconciliations/assert': {
8749
+ post: {
8750
+ req: ReconciliationControllerAssertData;
8751
+ res: {
8752
+ /**
8753
+ * Balance assertion recorded
8754
+ */
8755
+ 201: ReconciliationRecordDto;
8756
+ /**
8757
+ * Account not found
8758
+ */
8759
+ 404: unknown;
8760
+ };
8761
+ };
8762
+ };
8763
+ '/api/v1/{region}/bean/reconciliations/pad': {
8764
+ post: {
8765
+ req: ReconciliationControllerPadData;
8766
+ res: {
8767
+ /**
8768
+ * Pad adjusting entry generated
8769
+ */
8770
+ 201: PadResultDto;
8771
+ /**
8772
+ * Book already within tolerance — no pad needed
8773
+ */
8774
+ 400: unknown;
8775
+ /**
8776
+ * Account not found
8777
+ */
8778
+ 404: unknown;
8779
+ };
8780
+ };
8781
+ };
8782
+ '/api/v1/{region}/bean/accounts/{accountId}/reconciliations': {
8783
+ get: {
8784
+ req: ReconciliationControllerHistoryData;
8785
+ res: {
8786
+ /**
8787
+ * Reconciliation history
8788
+ */
8789
+ 200: Array<ReconciliationRecordDto>;
8790
+ /**
8791
+ * Account not found
8792
+ */
8793
+ 404: unknown;
8794
+ };
8795
+ };
8796
+ };
8480
8797
  '/api/v1/{region}/bean/export/beancount': {
8481
8798
  get: {
8482
8799
  res: {
@@ -8930,90 +9247,6 @@ export type $OpenApiTs = {
8930
9247
  };
8931
9248
  };
8932
9249
  };
8933
- '/api/v1/{region}/bean/prices': {
8934
- post: {
8935
- req: PriceControllerCreateData;
8936
- res: {
8937
- /**
8938
- * Price created successfully
8939
- */
8940
- 201: PriceResponseDto;
8941
- /**
8942
- * Currency or quoteCurrency commodity not found
8943
- */
8944
- 404: unknown;
8945
- /**
8946
- * Price already exists for this currency pair and date
8947
- */
8948
- 409: unknown;
8949
- };
8950
- };
8951
- get: {
8952
- req: PriceControllerFindAllData;
8953
- res: {
8954
- /**
8955
- * Prices retrieved successfully
8956
- */
8957
- 200: PriceListResponseDto;
8958
- };
8959
- };
8960
- };
8961
- '/api/v1/{region}/bean/prices/{id}': {
8962
- get: {
8963
- req: PriceControllerFindOneData;
8964
- res: {
8965
- /**
8966
- * Price retrieved successfully
8967
- */
8968
- 200: PriceResponseDto;
8969
- /**
8970
- * Price not found
8971
- */
8972
- 404: unknown;
8973
- };
8974
- };
8975
- put: {
8976
- req: PriceControllerUpdateData;
8977
- res: {
8978
- /**
8979
- * Price updated successfully
8980
- */
8981
- 200: PriceResponseDto;
8982
- /**
8983
- * Price not found
8984
- */
8985
- 404: unknown;
8986
- /**
8987
- * Updated price conflicts with existing price
8988
- */
8989
- 409: unknown;
8990
- };
8991
- };
8992
- delete: {
8993
- req: PriceControllerDeleteData;
8994
- res: {
8995
- /**
8996
- * Price deleted successfully
8997
- */
8998
- 204: void;
8999
- /**
9000
- * Price not found
9001
- */
9002
- 404: unknown;
9003
- };
9004
- };
9005
- };
9006
- '/api/v1/{region}/bean/prices/bulk': {
9007
- post: {
9008
- req: PriceControllerBulkCreateData;
9009
- res: {
9010
- /**
9011
- * Prices created successfully
9012
- */
9013
- 201: Array<PriceResponseDto>;
9014
- };
9015
- };
9016
- };
9017
9250
  '/api/v1/{region}/reporting/portfolio/trends': {
9018
9251
  get: {
9019
9252
  req: ReportingControllerGetPortfolioTrendsData;