@firela/api-types 0.0.0-canary.012b1cb9

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.
@@ -0,0 +1,4263 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import type { CancelablePromise } from './core/CancelablePromise';
3
+ import { OpenAPI } from './core/OpenAPI';
4
+ import { request as __request } from './core/request';
5
+ import type {
6
+ AccountControllerCreateData,
7
+ AccountControllerCreateResponse,
8
+ AccountControllerFindAllData,
9
+ AccountControllerFindAllResponse,
10
+ AccountControllerFindOneData,
11
+ AccountControllerFindOneResponse,
12
+ AccountControllerUpdateData,
13
+ AccountControllerUpdateResponse,
14
+ AccountControllerDeleteData,
15
+ AccountControllerDeleteResponse,
16
+ AccountControllerCloseData,
17
+ AccountControllerCloseResponse,
18
+ AccountControllerReopenData,
19
+ AccountControllerReopenResponse,
20
+ AccountControllerAddOpeningBalanceData,
21
+ AccountControllerAddOpeningBalanceResponse,
22
+ AccountStandardsControllerGetTemplatesData,
23
+ AccountStandardsControllerGetTemplatesResponse,
24
+ AccountStandardsControllerGetTemplateMetadataData,
25
+ AccountStandardsControllerGetTemplateMetadataResponse,
26
+ AccountStandardsControllerGetRegionsData,
27
+ AccountStandardsControllerGetRegionsResponse,
28
+ TransactionControllerCreateData,
29
+ TransactionControllerCreateResponse,
30
+ TransactionControllerListData,
31
+ TransactionControllerListResponse,
32
+ TransactionControllerCreateBatchData,
33
+ TransactionControllerCreateBatchResponse,
34
+ TransactionControllerCorrectData,
35
+ TransactionControllerCorrectResponse,
36
+ TransactionControllerSuggestTagsData,
37
+ TransactionControllerSuggestTagsResponse,
38
+ TransactionControllerGetDetailData,
39
+ TransactionControllerGetDetailResponse,
40
+ TransactionControllerUpdateData,
41
+ TransactionControllerUpdateResponse,
42
+ TransactionControllerDeleteData,
43
+ TransactionControllerDeleteResponse,
44
+ BalanceControllerGetBalanceData,
45
+ BalanceControllerGetBalanceResponse,
46
+ BalanceControllerGetMultiCurrencyBalanceData,
47
+ BalanceControllerGetMultiCurrencyBalanceResponse,
48
+ ReviewControllerFindAllData,
49
+ ReviewControllerFindAllResponse,
50
+ ReviewControllerGetStatsData,
51
+ ReviewControllerGetStatsResponse,
52
+ ReviewControllerFindOneData,
53
+ ReviewControllerFindOneResponse,
54
+ ReviewControllerResolveData,
55
+ ReviewControllerResolveResponse,
56
+ ReviewControllerUndoData,
57
+ ReviewControllerUndoResponse,
58
+ ReviewControllerBatchResolveData,
59
+ ReviewControllerBatchResolveResponse,
60
+ PayeeControllerCreateData,
61
+ PayeeControllerCreateResponse,
62
+ PayeeControllerFindAllData,
63
+ PayeeControllerFindAllResponse,
64
+ PayeeControllerAutocompleteData,
65
+ PayeeControllerAutocompleteResponse,
66
+ PayeeControllerGetTopPayeesData,
67
+ PayeeControllerGetTopPayeesResponse,
68
+ PayeeControllerFindOneData,
69
+ PayeeControllerFindOneResponse,
70
+ PayeeControllerUpdateData,
71
+ PayeeControllerUpdateResponse,
72
+ PayeeControllerDeleteData,
73
+ PayeeControllerDeleteResponse,
74
+ PayeeProfileAdminControllerCreateData,
75
+ PayeeProfileAdminControllerCreateResponse,
76
+ PayeeProfileAdminControllerFindAllData,
77
+ PayeeProfileAdminControllerFindAllResponse,
78
+ PayeeProfileAdminControllerFindOneData,
79
+ PayeeProfileAdminControllerFindOneResponse,
80
+ PayeeProfileAdminControllerUpdateData,
81
+ PayeeProfileAdminControllerUpdateResponse,
82
+ PayeeProfileAdminControllerDeleteData,
83
+ PayeeProfileAdminControllerDeleteResponse,
84
+ PayeeProfileAdminControllerVerifyData,
85
+ PayeeProfileAdminControllerVerifyResponse,
86
+ PayeeProfileAdminControllerUnverifyData,
87
+ PayeeProfileAdminControllerUnverifyResponse,
88
+ CommodityControllerCreateData,
89
+ CommodityControllerCreateResponse,
90
+ CommodityControllerFindAllData,
91
+ CommodityControllerFindAllResponse,
92
+ CommodityControllerFindOneData,
93
+ CommodityControllerFindOneResponse,
94
+ CommodityControllerUpdateData,
95
+ CommodityControllerUpdateResponse,
96
+ CommodityControllerDeleteData,
97
+ CommodityControllerDeleteResponse,
98
+ CommodityControllerGetOrCreateData,
99
+ CommodityControllerGetOrCreateResponse,
100
+ CommodityControllerBulkCreateData,
101
+ CommodityControllerBulkCreateResponse,
102
+ PriceControllerCreateData,
103
+ PriceControllerCreateResponse,
104
+ PriceControllerFindAllData,
105
+ PriceControllerFindAllResponse,
106
+ PriceControllerFindOneData,
107
+ PriceControllerFindOneResponse,
108
+ PriceControllerUpdateData,
109
+ PriceControllerUpdateResponse,
110
+ PriceControllerDeleteData,
111
+ PriceControllerDeleteResponse,
112
+ PriceControllerBulkCreateData,
113
+ PriceControllerBulkCreateResponse,
114
+ RecurringRuleControllerCreateData,
115
+ RecurringRuleControllerCreateResponse,
116
+ RecurringRuleControllerFindAllData,
117
+ RecurringRuleControllerFindAllResponse,
118
+ RecurringRuleControllerCreateFromTransactionData,
119
+ RecurringRuleControllerCreateFromTransactionResponse,
120
+ RecurringRuleControllerFindOneData,
121
+ RecurringRuleControllerFindOneResponse,
122
+ RecurringRuleControllerUpdateData,
123
+ RecurringRuleControllerUpdateResponse,
124
+ RecurringRuleControllerDeleteData,
125
+ RecurringRuleControllerDeleteResponse,
126
+ RecurringRuleControllerGetWithStatsData,
127
+ RecurringRuleControllerGetWithStatsResponse,
128
+ ExpectedTransactionControllerFindAllData,
129
+ ExpectedTransactionControllerFindAllResponse,
130
+ ExpectedTransactionControllerFindOverdueData,
131
+ ExpectedTransactionControllerFindOverdueResponse,
132
+ ExpectedTransactionControllerFindOneData,
133
+ ExpectedTransactionControllerFindOneResponse,
134
+ ExpectedTransactionControllerSkipData,
135
+ ExpectedTransactionControllerSkipResponse,
136
+ ExpectedTransactionControllerUndoSkipData,
137
+ ExpectedTransactionControllerUndoSkipResponse,
138
+ ExpectedTransactionControllerConfirmMatchData,
139
+ ExpectedTransactionControllerConfirmMatchResponse,
140
+ ExpectedTransactionControllerUnmatchData,
141
+ ExpectedTransactionControllerUnmatchResponse,
142
+ ExpectedTransactionControllerEnterNowData,
143
+ ExpectedTransactionControllerEnterNowResponse,
144
+ ForecastControllerGetForecastData,
145
+ ForecastControllerGetForecastResponse,
146
+ ReportingControllerGetPortfolioTrendsData,
147
+ ReportingControllerGetPortfolioTrendsResponse,
148
+ ReportingControllerGetCashFlowTrendsData,
149
+ ReportingControllerGetCashFlowTrendsResponse,
150
+ ReportingControllerGenerateSnapshotData,
151
+ ReportingControllerGenerateSnapshotResponse,
152
+ ReportingControllerBackfillSnapshotsData,
153
+ ReportingControllerBackfillSnapshotsResponse,
154
+ UserControllerDeleteOwnUserData,
155
+ UserControllerDeleteOwnUserResponse,
156
+ UserControllerGetUserData,
157
+ UserControllerGetUserResponse,
158
+ UserControllerSignupUserData,
159
+ UserControllerSignupUserResponse,
160
+ UserControllerDeleteUserData,
161
+ UserControllerDeleteUserResponse,
162
+ UserControllerGetUserInfoData,
163
+ UserControllerGetUserInfoResponse,
164
+ UserControllerUpdateUserSettingData,
165
+ UserControllerUpdateUserSettingResponse,
166
+ UserControllerGetAllUserSettingsByPageData,
167
+ UserControllerGetAllUserSettingsByPageResponse,
168
+ UserControllerGetAssetLiabilitySummaryResponse,
169
+ PropertyControllerGetAllResponse,
170
+ PropertyControllerGetByKeyData,
171
+ PropertyControllerGetByKeyResponse,
172
+ PropertyControllerUpdateData,
173
+ PropertyControllerUpdateResponse,
174
+ PropertyControllerDeleteData,
175
+ PropertyControllerDeleteResponse,
176
+ TransactionRuleControllerCreateData,
177
+ TransactionRuleControllerCreateResponse,
178
+ TransactionRuleControllerListData,
179
+ TransactionRuleControllerListResponse,
180
+ TransactionRuleControllerValidateData,
181
+ TransactionRuleControllerValidateResponse,
182
+ TransactionRuleControllerBulkCreateData,
183
+ TransactionRuleControllerBulkCreateResponse,
184
+ TransactionRuleControllerExportData,
185
+ TransactionRuleControllerExportResponse,
186
+ TransactionRuleControllerGetStatisticsData,
187
+ TransactionRuleControllerGetStatisticsResponse,
188
+ TransactionRuleControllerGetDetailData,
189
+ TransactionRuleControllerGetDetailResponse,
190
+ TransactionRuleControllerUpdateData,
191
+ TransactionRuleControllerUpdateResponse,
192
+ TransactionRuleControllerDeleteData,
193
+ TransactionRuleControllerDeleteResponse,
194
+ TransactionRuleControllerTestData,
195
+ TransactionRuleControllerTestResponse,
196
+ CategoryCatalogControllerListData,
197
+ CategoryCatalogControllerListResponse,
198
+ EventControllerCreateData,
199
+ EventControllerCreateResponse,
200
+ EventControllerFindAllData,
201
+ EventControllerFindAllResponse,
202
+ EventControllerFindOneData,
203
+ EventControllerFindOneResponse,
204
+ EventControllerUpdateData,
205
+ EventControllerUpdateResponse,
206
+ EventControllerDeleteData,
207
+ EventControllerDeleteResponse,
208
+ EventControllerGetSliceData,
209
+ EventControllerGetSliceResponse,
210
+ OnboardingControllerBootstrapData,
211
+ OnboardingControllerBootstrapResponse,
212
+ ReconciliationControllerComputeData,
213
+ ReconciliationControllerComputeResponse,
214
+ ReconciliationControllerAssertData,
215
+ ReconciliationControllerAssertResponse,
216
+ ReconciliationControllerPadData,
217
+ ReconciliationControllerPadResponse,
218
+ ReconciliationControllerHistoryData,
219
+ ReconciliationControllerHistoryResponse,
220
+ ExportControllerExportBeancountResponse,
221
+ FileImportControllerImportFileData,
222
+ FileImportControllerImportFileResponse,
223
+ FileImportControllerIdentifyFileData,
224
+ FileImportControllerIdentifyFileResponse,
225
+ FileImportControllerImportBeancountData,
226
+ FileImportControllerImportBeancountResponse,
227
+ ImporterConfigControllerGetConfigData,
228
+ ImporterConfigControllerGetConfigResponse,
229
+ ImporterConfigControllerUpdateConfigData,
230
+ ImporterConfigControllerUpdateConfigResponse,
231
+ ImporterConfigControllerResetConfigData,
232
+ ImporterConfigControllerResetConfigResponse,
233
+ ProviderSyncControllerSyncData,
234
+ ProviderSyncControllerSyncResponse,
235
+ ProviderSyncControllerGetSupportedProvidersData,
236
+ ProviderSyncControllerGetSupportedProvidersResponse,
237
+ ProviderSyncControllerIsProviderSupportedData,
238
+ ProviderSyncControllerIsProviderSupportedResponse,
239
+ ExternalAccountLinkControllerCreateData,
240
+ ExternalAccountLinkControllerCreateResponse,
241
+ ExternalAccountLinkControllerFindAllData,
242
+ ExternalAccountLinkControllerFindAllResponse,
243
+ ExternalAccountLinkControllerFindOneData,
244
+ ExternalAccountLinkControllerFindOneResponse,
245
+ ExternalAccountLinkControllerRemoveData,
246
+ ExternalAccountLinkControllerRemoveResponse,
247
+ TelemetryControllerReportTelemetryData,
248
+ TelemetryControllerReportTelemetryResponse,
249
+ TelemetryControllerReportCoverageMissData,
250
+ TelemetryControllerReportCoverageMissResponse,
251
+ TelemetryControllerGetCoverageMetricsData,
252
+ TelemetryControllerGetCoverageMetricsResponse,
253
+ NlpControllerProcessNaturalLanguageData,
254
+ NlpControllerProcessNaturalLanguageResponse,
255
+ NlpControllerClearSessionData,
256
+ NlpControllerClearSessionResponse,
257
+ NlpControllerGetSessionData,
258
+ NlpControllerGetSessionResponse,
259
+ PlatformControllerFindAllResponse,
260
+ PlatformControllerCreateData,
261
+ PlatformControllerCreateResponse,
262
+ PlatformControllerGetPlatformListData,
263
+ PlatformControllerGetPlatformListResponse,
264
+ PlatformControllerMatchPlatformsData,
265
+ PlatformControllerMatchPlatformsResponse,
266
+ PlatformControllerUpdateData,
267
+ PlatformControllerUpdateResponse,
268
+ PlatformControllerDeleteData,
269
+ PlatformControllerDeleteResponse,
270
+ DashboardControllerGetNetWorthData,
271
+ DashboardControllerGetNetWorthResponse,
272
+ DashboardControllerGetAccountsData,
273
+ DashboardControllerGetAccountsResponse,
274
+ DashboardControllerGetCashFlowData,
275
+ DashboardControllerGetCashFlowResponse,
276
+ DashboardControllerGetExpensesData,
277
+ DashboardControllerGetExpensesResponse,
278
+ HoldingPnlControllerGetHoldingPnlData,
279
+ HoldingPnlControllerGetHoldingPnlResponse,
280
+ ApiKeysControllerCreateApiKeyResponse,
281
+ AuthControllerAccessTokenLoginData,
282
+ AuthControllerAccessTokenLoginResponse,
283
+ CacheControllerFlushCacheResponse,
284
+ ExchangeRateControllerGetExchangeRateData,
285
+ ExchangeRateControllerGetExchangeRateResponse,
286
+ HealthControllerGetHealthResponse,
287
+ HealthControllerCheckDatabaseResponse,
288
+ HealthControllerCheckOpenBbResponse,
289
+ HealthControllerCheckRedisResponse,
290
+ HealthControllerGetCircuitBreakersHealthResponse,
291
+ HealthControllerResetCircuitBreakerData,
292
+ HealthControllerResetCircuitBreakerResponse,
293
+ HealthControllerGetMetricsResponse,
294
+ InfoControllerGetInfoResponse,
295
+ SymbolControllerSearchData,
296
+ SymbolControllerSearchResponse,
297
+ SymbolControllerGetQuoteData,
298
+ SymbolControllerGetQuoteResponse
299
+ } from './types.gen';
300
+
301
+ export class BeanAccountsService {
302
+ /**
303
+ * Create a new account
304
+ * Creates a new account (Beancount Open directive)
305
+ * @param data The data for the request.
306
+ * @param data.region Region code for tenant context
307
+ * @param data.requestBody
308
+ * @returns AccountResponseDto Account created successfully
309
+ * @throws ApiError
310
+ */
311
+ public static accountControllerCreate(
312
+ data: AccountControllerCreateData
313
+ ): CancelablePromise<AccountControllerCreateResponse> {
314
+ return __request(OpenAPI, {
315
+ method: 'POST',
316
+ url: '/api/v1/{region}/bean/accounts',
317
+ path: {
318
+ region: data.region
319
+ },
320
+ body: data.requestBody,
321
+ mediaType: 'application/json',
322
+ errors: {
323
+ 409: 'Account already exists'
324
+ }
325
+ });
326
+ }
327
+
328
+ /**
329
+ * List accounts
330
+ * Returns all accounts with optional filtering
331
+ * @param data The data for the request.
332
+ * @param data.region Region code for tenant context
333
+ * @param data.type Filter by account type
334
+ * @param data.status Filter by status
335
+ * @param data.isCustom Filter by custom (user-created) accounts only
336
+ * @param data.search Search term for account path
337
+ * @param data.limit Maximum number of results
338
+ * @param data.offset Number of results to skip
339
+ * @returns AccountListResponseDto Accounts retrieved successfully
340
+ * @throws ApiError
341
+ */
342
+ public static accountControllerFindAll(
343
+ data: AccountControllerFindAllData
344
+ ): CancelablePromise<AccountControllerFindAllResponse> {
345
+ return __request(OpenAPI, {
346
+ method: 'GET',
347
+ url: '/api/v1/{region}/bean/accounts',
348
+ path: {
349
+ region: data.region
350
+ },
351
+ query: {
352
+ type: data.type,
353
+ status: data.status,
354
+ isCustom: data.isCustom,
355
+ search: data.search,
356
+ limit: data.limit,
357
+ offset: data.offset
358
+ }
359
+ });
360
+ }
361
+
362
+ /**
363
+ * Get account by ID
364
+ * Returns a specific account
365
+ * @param data The data for the request.
366
+ * @param data.id Account UUID
367
+ * @param data.region Region code for tenant context
368
+ * @returns AccountResponseDto Account retrieved successfully
369
+ * @throws ApiError
370
+ */
371
+ public static accountControllerFindOne(
372
+ data: AccountControllerFindOneData
373
+ ): CancelablePromise<AccountControllerFindOneResponse> {
374
+ return __request(OpenAPI, {
375
+ method: 'GET',
376
+ url: '/api/v1/{region}/bean/accounts/{id}',
377
+ path: {
378
+ id: data.id,
379
+ region: data.region
380
+ },
381
+ errors: {
382
+ 404: 'Account not found'
383
+ }
384
+ });
385
+ }
386
+
387
+ /**
388
+ * Update account
389
+ * Updates account metadata (path cannot be changed)
390
+ * @param data The data for the request.
391
+ * @param data.id Account UUID
392
+ * @param data.region Region code for tenant context
393
+ * @param data.requestBody
394
+ * @returns AccountResponseDto Account updated successfully
395
+ * @throws ApiError
396
+ */
397
+ public static accountControllerUpdate(
398
+ data: AccountControllerUpdateData
399
+ ): CancelablePromise<AccountControllerUpdateResponse> {
400
+ return __request(OpenAPI, {
401
+ method: 'PUT',
402
+ url: '/api/v1/{region}/bean/accounts/{id}',
403
+ path: {
404
+ id: data.id,
405
+ region: data.region
406
+ },
407
+ body: data.requestBody,
408
+ mediaType: 'application/json',
409
+ errors: {
410
+ 404: 'Account not found'
411
+ }
412
+ });
413
+ }
414
+
415
+ /**
416
+ * Delete account
417
+ * Deletes an account (only if no active transactions; voided/superseded residual postings are cleaned up)
418
+ * @param data The data for the request.
419
+ * @param data.id Account UUID
420
+ * @param data.region Region code for tenant context
421
+ * @returns void Account deleted successfully
422
+ * @throws ApiError
423
+ */
424
+ public static accountControllerDelete(
425
+ data: AccountControllerDeleteData
426
+ ): CancelablePromise<AccountControllerDeleteResponse> {
427
+ return __request(OpenAPI, {
428
+ method: 'DELETE',
429
+ url: '/api/v1/{region}/bean/accounts/{id}',
430
+ path: {
431
+ id: data.id,
432
+ region: data.region
433
+ },
434
+ errors: {
435
+ 404: 'Account not found',
436
+ 409: 'Account has active transactions and cannot be deleted'
437
+ }
438
+ });
439
+ }
440
+
441
+ /**
442
+ * Close account
443
+ * Closes an account (Beancount Close directive)
444
+ * @param data The data for the request.
445
+ * @param data.id Account UUID
446
+ * @param data.region Region code for tenant context
447
+ * @param data.requestBody
448
+ * @returns AccountResponseDto Account closed successfully
449
+ * @throws ApiError
450
+ */
451
+ public static accountControllerClose(
452
+ data: AccountControllerCloseData
453
+ ): CancelablePromise<AccountControllerCloseResponse> {
454
+ return __request(OpenAPI, {
455
+ method: 'POST',
456
+ url: '/api/v1/{region}/bean/accounts/{id}/close',
457
+ path: {
458
+ id: data.id,
459
+ region: data.region
460
+ },
461
+ body: data.requestBody,
462
+ mediaType: 'application/json',
463
+ errors: {
464
+ 400: 'Account is already closed',
465
+ 404: 'Account not found'
466
+ }
467
+ });
468
+ }
469
+
470
+ /**
471
+ * Reopen account
472
+ * Reopens a previously closed account
473
+ * @param data The data for the request.
474
+ * @param data.id Account UUID
475
+ * @param data.region Region code for tenant context
476
+ * @param data.requestBody
477
+ * @returns AccountResponseDto Account reopened successfully
478
+ * @throws ApiError
479
+ */
480
+ public static accountControllerReopen(
481
+ data: AccountControllerReopenData
482
+ ): CancelablePromise<AccountControllerReopenResponse> {
483
+ return __request(OpenAPI, {
484
+ method: 'POST',
485
+ url: '/api/v1/{region}/bean/accounts/{id}/reopen',
486
+ path: {
487
+ id: data.id,
488
+ region: data.region
489
+ },
490
+ body: data.requestBody,
491
+ mediaType: 'application/json',
492
+ errors: {
493
+ 400: 'Account is not closed',
494
+ 404: 'Account not found'
495
+ }
496
+ });
497
+ }
498
+
499
+ /**
500
+ * Post an opening-balance transaction
501
+ * Posts a double-entry opening-balance transaction against Equity:Opening-Balances for an existing Assets/Liabilities account. At most one active opening balance per account.
502
+ * @param data The data for the request.
503
+ * @param data.id Account UUID
504
+ * @param data.region Region code for tenant context
505
+ * @param data.requestBody
506
+ * @returns OpeningBalanceResultDto Opening-balance transaction created
507
+ * @throws ApiError
508
+ */
509
+ public static accountControllerAddOpeningBalance(
510
+ data: AccountControllerAddOpeningBalanceData
511
+ ): CancelablePromise<AccountControllerAddOpeningBalanceResponse> {
512
+ return __request(OpenAPI, {
513
+ method: 'POST',
514
+ url: '/api/v1/{region}/bean/accounts/{id}/opening-balance',
515
+ path: {
516
+ id: data.id,
517
+ region: data.region
518
+ },
519
+ body: data.requestBody,
520
+ mediaType: 'application/json',
521
+ errors: {
522
+ 404: 'Account not found',
523
+ 409: 'An opening balance already exists for this account'
524
+ }
525
+ });
526
+ }
527
+ }
528
+
529
+ export class BeanAccountStandardsService {
530
+ /**
531
+ * Get account templates
532
+ * Returns predefined account templates for a region. Supports filtering by account type and search term.
533
+ * @param data The data for the request.
534
+ * @param data.region Region code (cn, us, de)
535
+ * @param data.type Filter by account type
536
+ * @param data.search Search term for path or description
537
+ * @returns AccountStandardListResponseDto Account templates retrieved successfully
538
+ * @throws ApiError
539
+ */
540
+ public static accountStandardsControllerGetTemplates(
541
+ data: AccountStandardsControllerGetTemplatesData
542
+ ): CancelablePromise<AccountStandardsControllerGetTemplatesResponse> {
543
+ return __request(OpenAPI, {
544
+ method: 'GET',
545
+ url: '/api/v1/{region}/bean/account-standards',
546
+ path: {
547
+ region: data.region
548
+ },
549
+ query: {
550
+ type: data.type,
551
+ search: data.search
552
+ }
553
+ });
554
+ }
555
+
556
+ /**
557
+ * Get template metadata for an account path
558
+ * Returns root type for a template path.
559
+ * @param data The data for the request.
560
+ * @param data.region Region code for tenant context
561
+ * @param data.path Account path to check
562
+ * @returns TemplateMetadataResponseDto Template metadata retrieved successfully
563
+ * @throws ApiError
564
+ */
565
+ public static accountStandardsControllerGetTemplateMetadata(
566
+ data: AccountStandardsControllerGetTemplateMetadataData
567
+ ): CancelablePromise<AccountStandardsControllerGetTemplateMetadataResponse> {
568
+ return __request(OpenAPI, {
569
+ method: 'GET',
570
+ url: '/api/v1/{region}/bean/account-standards/template-metadata',
571
+ path: {
572
+ region: data.region
573
+ },
574
+ query: {
575
+ path: data.path
576
+ }
577
+ });
578
+ }
579
+
580
+ /**
581
+ * Get available regions with hierarchy
582
+ * Returns supported regions with inheritance metadata
583
+ * @param data The data for the request.
584
+ * @param data.region Region code for tenant context
585
+ * @returns RegionsMetadataResponseDto Regions metadata retrieved successfully
586
+ * @throws ApiError
587
+ */
588
+ public static accountStandardsControllerGetRegions(
589
+ data: AccountStandardsControllerGetRegionsData
590
+ ): CancelablePromise<AccountStandardsControllerGetRegionsResponse> {
591
+ return __request(OpenAPI, {
592
+ method: 'GET',
593
+ url: '/api/v1/{region}/bean/account-standards/regions',
594
+ path: {
595
+ region: data.region
596
+ }
597
+ });
598
+ }
599
+ }
600
+
601
+ export class BeanTransactionsService {
602
+ /**
603
+ * @deprecated
604
+ * Create transaction (DEPRECATED)
605
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
606
+ * @param data The data for the request.
607
+ * @param data.region Region code for tenant context
608
+ * @param data.requestBody Transaction data with postings
609
+ * @returns TransactionResponseDto Transaction created successfully
610
+ * @throws ApiError
611
+ */
612
+ public static transactionControllerCreate(
613
+ data: TransactionControllerCreateData
614
+ ): CancelablePromise<TransactionControllerCreateResponse> {
615
+ return __request(OpenAPI, {
616
+ method: 'POST',
617
+ url: '/api/v1/{region}/bean/transactions',
618
+ path: {
619
+ region: data.region
620
+ },
621
+ body: data.requestBody,
622
+ mediaType: 'application/json',
623
+ errors: {
624
+ 400: 'Validation failed',
625
+ 401: 'Authentication required',
626
+ 422: 'Semantic validation failed (transaction does not balance, invalid accounts)',
627
+ 500: 'Unexpected server error'
628
+ }
629
+ });
630
+ }
631
+
632
+ /**
633
+ * List transactions
634
+ * Returns a paginated list of transactions with optional filters
635
+ * @param data The data for the request.
636
+ * @param data.region Region code for tenant context
637
+ * @param data.limit Number of items per page (1-100, default: 20)
638
+ * @param data.offset Number of items to skip (default: 0)
639
+ * @param data.dateFrom Filter by start date (inclusive), format: YYYY-MM-DD
640
+ * @param data.dateTo Filter by end date (inclusive), format: YYYY-MM-DD
641
+ * @param data.status Filter by transaction status
642
+ * @param data.search Search in narration and payee fields (max 200 chars)
643
+ * @param data.accountId Filter by account ID (transactions with postings to this account)
644
+ * @param data.category Filter by ADR-0075 functional category (Group segment); matches any posting to an Expenses/Income account whose derived Group segment equals this value
645
+ * @returns TransactionListResponseDto Transaction list
646
+ * @throws ApiError
647
+ */
648
+ public static transactionControllerList(
649
+ data: TransactionControllerListData
650
+ ): CancelablePromise<TransactionControllerListResponse> {
651
+ return __request(OpenAPI, {
652
+ method: 'GET',
653
+ url: '/api/v1/{region}/bean/transactions',
654
+ path: {
655
+ region: data.region
656
+ },
657
+ query: {
658
+ limit: data.limit,
659
+ offset: data.offset,
660
+ dateFrom: data.dateFrom,
661
+ dateTo: data.dateTo,
662
+ status: data.status,
663
+ search: data.search,
664
+ accountId: data.accountId,
665
+ category: data.category
666
+ },
667
+ errors: {
668
+ 400: 'Validation failed',
669
+ 401: 'Authentication required'
670
+ }
671
+ });
672
+ }
673
+
674
+ /**
675
+ * @deprecated
676
+ * Batch create transactions (DEPRECATED)
677
+ * DEPRECATED: Use POST /:region/bean/import/provider/:name/sync instead. This endpoint skips dedup, rule matching, and review branching.
678
+ * @param data The data for the request.
679
+ * @param data.region Region code for tenant context
680
+ * @param data.requestBody
681
+ * @returns BatchTransactionResponseDto Transactions processed
682
+ * @throws ApiError
683
+ */
684
+ public static transactionControllerCreateBatch(
685
+ data: TransactionControllerCreateBatchData
686
+ ): CancelablePromise<TransactionControllerCreateBatchResponse> {
687
+ return __request(OpenAPI, {
688
+ method: 'POST',
689
+ url: '/api/v1/{region}/bean/transactions/batch',
690
+ path: {
691
+ region: data.region
692
+ },
693
+ body: data.requestBody,
694
+ mediaType: 'application/json',
695
+ errors: {
696
+ 400: 'Invalid input',
697
+ 401: 'Authentication required'
698
+ }
699
+ });
700
+ }
701
+
702
+ /**
703
+ * Correct (supersede) a transaction
704
+ * Atomically voids the original (SUPERSEDED) and creates a replacement through the full validation pipeline.
705
+ * @param data The data for the request.
706
+ * @param data.id Original transaction ID to correct
707
+ * @param data.region Region code for tenant context
708
+ * @param data.requestBody
709
+ * @returns TransactionDetailDto Corrected transaction created
710
+ * @throws ApiError
711
+ */
712
+ public static transactionControllerCorrect(
713
+ data: TransactionControllerCorrectData
714
+ ): CancelablePromise<TransactionControllerCorrectResponse> {
715
+ return __request(OpenAPI, {
716
+ method: 'POST',
717
+ url: '/api/v1/{region}/bean/transactions/{id}/correct',
718
+ path: {
719
+ id: data.id,
720
+ region: data.region
721
+ },
722
+ body: data.requestBody,
723
+ mediaType: 'application/json',
724
+ errors: {
725
+ 404: 'Original transaction not found',
726
+ 409: 'Original no longer ACTIVE (concurrent modification)',
727
+ 422: 'Pipeline validation failed (does not balance, invalid accounts)'
728
+ }
729
+ });
730
+ }
731
+
732
+ /**
733
+ * Suggest transaction tags
734
+ * Returns distinct tags from the user ACTIVE transactions, sorted by usage, for autocomplete. Optional q performs a case-insensitive prefix match.
735
+ * @param data The data for the request.
736
+ * @param data.region Region code for tenant context
737
+ * @param data.q Prefix match, case-insensitive (max 50 chars)
738
+ * @param data.sort usage (default) or name
739
+ * @param data.limit Max suggestions (1-100, default 10)
740
+ * @returns TagSuggestionsResponseDto Tag suggestions
741
+ * @throws ApiError
742
+ */
743
+ public static transactionControllerSuggestTags(
744
+ data: TransactionControllerSuggestTagsData
745
+ ): CancelablePromise<TransactionControllerSuggestTagsResponse> {
746
+ return __request(OpenAPI, {
747
+ method: 'GET',
748
+ url: '/api/v1/{region}/bean/transactions/tags',
749
+ path: {
750
+ region: data.region
751
+ },
752
+ query: {
753
+ q: data.q,
754
+ sort: data.sort,
755
+ limit: data.limit
756
+ },
757
+ errors: {
758
+ 400: 'Validation failed',
759
+ 401: 'Authentication required'
760
+ }
761
+ });
762
+ }
763
+
764
+ /**
765
+ * Get transaction detail
766
+ * Returns transaction details including all postings
767
+ * @param data The data for the request.
768
+ * @param data.id Transaction ID
769
+ * @param data.region Region code for tenant context
770
+ * @returns TransactionDetailDto Transaction detail
771
+ * @throws ApiError
772
+ */
773
+ public static transactionControllerGetDetail(
774
+ data: TransactionControllerGetDetailData
775
+ ): CancelablePromise<TransactionControllerGetDetailResponse> {
776
+ return __request(OpenAPI, {
777
+ method: 'GET',
778
+ url: '/api/v1/{region}/bean/transactions/{id}',
779
+ path: {
780
+ id: data.id,
781
+ region: data.region
782
+ },
783
+ errors: {
784
+ 401: 'Authentication required',
785
+ 404: 'Transaction not found'
786
+ }
787
+ });
788
+ }
789
+
790
+ /**
791
+ * Update transaction metadata
792
+ * Updates transaction metadata (flag, payee, narration, tags, links, meta). Postings cannot be modified.
793
+ * @param data The data for the request.
794
+ * @param data.id Transaction ID
795
+ * @param data.region Region code for tenant context
796
+ * @param data.requestBody Fields to update (all optional)
797
+ * @returns TransactionDetailDto Transaction updated successfully
798
+ * @throws ApiError
799
+ */
800
+ public static transactionControllerUpdate(
801
+ data: TransactionControllerUpdateData
802
+ ): CancelablePromise<TransactionControllerUpdateResponse> {
803
+ return __request(OpenAPI, {
804
+ method: 'PATCH',
805
+ url: '/api/v1/{region}/bean/transactions/{id}',
806
+ path: {
807
+ id: data.id,
808
+ region: data.region
809
+ },
810
+ body: data.requestBody,
811
+ mediaType: 'application/json',
812
+ errors: {
813
+ 400: 'Cannot update voided transaction',
814
+ 401: 'Authentication required',
815
+ 404: 'Transaction not found'
816
+ }
817
+ });
818
+ }
819
+
820
+ /**
821
+ * Void transaction
822
+ * Soft-deletes a transaction by marking it as VOIDED
823
+ * @param data The data for the request.
824
+ * @param data.id Transaction ID
825
+ * @param data.region Region code for tenant context
826
+ * @returns void Transaction voided successfully
827
+ * @throws ApiError
828
+ */
829
+ public static transactionControllerDelete(
830
+ data: TransactionControllerDeleteData
831
+ ): CancelablePromise<TransactionControllerDeleteResponse> {
832
+ return __request(OpenAPI, {
833
+ method: 'DELETE',
834
+ url: '/api/v1/{region}/bean/transactions/{id}',
835
+ path: {
836
+ id: data.id,
837
+ region: data.region
838
+ },
839
+ errors: {
840
+ 400: 'Transaction already voided',
841
+ 401: 'Authentication required',
842
+ 404: 'Transaction not found'
843
+ }
844
+ });
845
+ }
846
+ }
847
+
848
+ export class BeanBalancesService {
849
+ /**
850
+ * Query account balance
851
+ * Calculate account balance at a specific date for a single currency
852
+ * @param data The data for the request.
853
+ * @param data.account Account name (e.g., "Assets:Checking")
854
+ * @param data.region Region code for tenant context
855
+ * @param data.date Date to calculate balance at (ISO 8601 format)
856
+ * @param data.currency Currency to query (e.g., "USD", "CNY")
857
+ * @returns BalanceResponseDto Balance calculated successfully
858
+ * @throws ApiError
859
+ */
860
+ public static balanceControllerGetBalance(
861
+ data: BalanceControllerGetBalanceData
862
+ ): CancelablePromise<BalanceControllerGetBalanceResponse> {
863
+ return __request(OpenAPI, {
864
+ method: 'GET',
865
+ url: '/api/v1/{region}/bean/balances',
866
+ path: {
867
+ region: data.region
868
+ },
869
+ query: {
870
+ account: data.account,
871
+ date: data.date,
872
+ currency: data.currency
873
+ },
874
+ errors: {
875
+ 400: 'Invalid query parameters',
876
+ 401: 'User not authenticated'
877
+ }
878
+ });
879
+ }
880
+
881
+ /**
882
+ * Query multi-currency account balance
883
+ * Calculate account balances for all currencies at a specific date
884
+ * @param data The data for the request.
885
+ * @param data.region Region code for tenant context
886
+ * @returns MultiCurrencyBalanceResponseDto Balances calculated successfully
887
+ * @throws ApiError
888
+ */
889
+ public static balanceControllerGetMultiCurrencyBalance(
890
+ data: BalanceControllerGetMultiCurrencyBalanceData
891
+ ): CancelablePromise<BalanceControllerGetMultiCurrencyBalanceResponse> {
892
+ return __request(OpenAPI, {
893
+ method: 'GET',
894
+ url: '/api/v1/{region}/bean/balances/multi-currency',
895
+ path: {
896
+ region: data.region
897
+ },
898
+ errors: {
899
+ 400: 'Invalid query parameters',
900
+ 401: 'User not authenticated'
901
+ }
902
+ });
903
+ }
904
+ }
905
+
906
+ export class BeanReviewsService {
907
+ /**
908
+ * List pending reviews
909
+ * @param data The data for the request.
910
+ * @param data.region Region code for tenant context
911
+ * @param data.type Filter by review type
912
+ * @param data.confidenceLevel Filter by confidence level
913
+ * @param data.sortBy Sort order
914
+ * @param data.page Page number (default: 1)
915
+ * @param data.limit Items per page (1-100, default: 20)
916
+ * @returns ReviewListResponseDto
917
+ * @throws ApiError
918
+ */
919
+ public static reviewControllerFindAll(
920
+ data: ReviewControllerFindAllData
921
+ ): CancelablePromise<ReviewControllerFindAllResponse> {
922
+ return __request(OpenAPI, {
923
+ method: 'GET',
924
+ url: '/api/v1/{region}/bean/reviews',
925
+ path: {
926
+ region: data.region
927
+ },
928
+ query: {
929
+ type: data.type,
930
+ confidenceLevel: data.confidenceLevel,
931
+ sortBy: data.sortBy,
932
+ page: data.page,
933
+ limit: data.limit
934
+ }
935
+ });
936
+ }
937
+
938
+ /**
939
+ * Get review statistics
940
+ * @param data The data for the request.
941
+ * @param data.region Region code for tenant context
942
+ * @returns ReviewStatsDto
943
+ * @throws ApiError
944
+ */
945
+ public static reviewControllerGetStats(
946
+ data: ReviewControllerGetStatsData
947
+ ): CancelablePromise<ReviewControllerGetStatsResponse> {
948
+ return __request(OpenAPI, {
949
+ method: 'GET',
950
+ url: '/api/v1/{region}/bean/reviews/stats',
951
+ path: {
952
+ region: data.region
953
+ }
954
+ });
955
+ }
956
+
957
+ /**
958
+ * Get review by ID
959
+ * @param data The data for the request.
960
+ * @param data.id Review ID
961
+ * @param data.region Region code for tenant context
962
+ * @returns ReviewDetailDto
963
+ * @throws ApiError
964
+ */
965
+ public static reviewControllerFindOne(
966
+ data: ReviewControllerFindOneData
967
+ ): CancelablePromise<ReviewControllerFindOneResponse> {
968
+ return __request(OpenAPI, {
969
+ method: 'GET',
970
+ url: '/api/v1/{region}/bean/reviews/{id}',
971
+ path: {
972
+ id: data.id,
973
+ region: data.region
974
+ }
975
+ });
976
+ }
977
+
978
+ /**
979
+ * Resolve a review item
980
+ * @param data The data for the request.
981
+ * @param data.id Review ID
982
+ * @param data.region Region code for tenant context
983
+ * @param data.requestBody
984
+ * @returns ResolveResultDto
985
+ * @throws ApiError
986
+ */
987
+ public static reviewControllerResolve(
988
+ data: ReviewControllerResolveData
989
+ ): CancelablePromise<ReviewControllerResolveResponse> {
990
+ return __request(OpenAPI, {
991
+ method: 'POST',
992
+ url: '/api/v1/{region}/bean/reviews/{id}/resolve',
993
+ path: {
994
+ id: data.id,
995
+ region: data.region
996
+ },
997
+ body: data.requestBody,
998
+ mediaType: 'application/json'
999
+ });
1000
+ }
1001
+
1002
+ /**
1003
+ * Undo a resolution (within 24h)
1004
+ * @param data The data for the request.
1005
+ * @param data.id Review ID
1006
+ * @param data.region Region code for tenant context
1007
+ * @returns UndoResultDto
1008
+ * @throws ApiError
1009
+ */
1010
+ public static reviewControllerUndo(
1011
+ data: ReviewControllerUndoData
1012
+ ): CancelablePromise<ReviewControllerUndoResponse> {
1013
+ return __request(OpenAPI, {
1014
+ method: 'POST',
1015
+ url: '/api/v1/{region}/bean/reviews/{id}/undo',
1016
+ path: {
1017
+ id: data.id,
1018
+ region: data.region
1019
+ }
1020
+ });
1021
+ }
1022
+
1023
+ /**
1024
+ * Batch resolve multiple reviews
1025
+ * @param data The data for the request.
1026
+ * @param data.region Region code for tenant context
1027
+ * @param data.requestBody Batch resolution request containing review IDs and action
1028
+ * @returns BatchResolveResultDto
1029
+ * @throws ApiError
1030
+ */
1031
+ public static reviewControllerBatchResolve(
1032
+ data: ReviewControllerBatchResolveData
1033
+ ): CancelablePromise<ReviewControllerBatchResolveResponse> {
1034
+ return __request(OpenAPI, {
1035
+ method: 'POST',
1036
+ url: '/api/v1/{region}/bean/reviews/batch-resolve',
1037
+ path: {
1038
+ region: data.region
1039
+ },
1040
+ body: data.requestBody,
1041
+ mediaType: 'application/json'
1042
+ });
1043
+ }
1044
+ }
1045
+
1046
+ export class BeanPayeesService {
1047
+ /**
1048
+ * Create a new payee
1049
+ * Creates a new payee mapping for the authenticated user. The payee name must be unique within the user's account.
1050
+ * @param data The data for the request.
1051
+ * @param data.requestBody
1052
+ * @returns PayeeResponseDto Payee created successfully
1053
+ * @throws ApiError
1054
+ */
1055
+ public static payeeControllerCreate(
1056
+ data: PayeeControllerCreateData
1057
+ ): CancelablePromise<PayeeControllerCreateResponse> {
1058
+ return __request(OpenAPI, {
1059
+ method: 'POST',
1060
+ url: '/api/v1/bean/payees',
1061
+ body: data.requestBody,
1062
+ mediaType: 'application/json',
1063
+ errors: {
1064
+ 400: 'Invalid input data',
1065
+ 409: 'Payee already exists'
1066
+ }
1067
+ });
1068
+ }
1069
+
1070
+ /**
1071
+ * List user payees
1072
+ * Returns all payee mappings for the authenticated user with optional filtering
1073
+ * @param data The data for the request.
1074
+ * @param data.search Search term for payee name (partial match, case-insensitive). Useful for autocomplete.
1075
+ * @param data.payee Filter by exact payee name match
1076
+ * @param data.category Filter by custom category
1077
+ * @param data.tag Filter by custom tag (returns payees that have this tag)
1078
+ * @param data.isActive Filter by active status. Defaults to true (show only active payees).
1079
+ * @returns PayeeListResponseDto Payees retrieved successfully
1080
+ * @throws ApiError
1081
+ */
1082
+ public static payeeControllerFindAll(
1083
+ data: PayeeControllerFindAllData = {}
1084
+ ): CancelablePromise<PayeeControllerFindAllResponse> {
1085
+ return __request(OpenAPI, {
1086
+ method: 'GET',
1087
+ url: '/api/v1/bean/payees',
1088
+ query: {
1089
+ search: data.search,
1090
+ payee: data.payee,
1091
+ category: data.category,
1092
+ tag: data.tag,
1093
+ isActive: data.isActive
1094
+ }
1095
+ });
1096
+ }
1097
+
1098
+ /**
1099
+ * Get payee autocomplete suggestions
1100
+ * Returns active payee names matching the query, sorted by recent usage. Used for transaction input autocomplete.
1101
+ * @param data The data for the request.
1102
+ * @param data.q Search query for payee name (partial match, case-insensitive)
1103
+ * @param data.limit Maximum number of suggestions
1104
+ * @returns PayeeAutocompleteResponseDto Autocomplete suggestions retrieved successfully
1105
+ * @throws ApiError
1106
+ */
1107
+ public static payeeControllerAutocomplete(
1108
+ data: PayeeControllerAutocompleteData
1109
+ ): CancelablePromise<PayeeControllerAutocompleteResponse> {
1110
+ return __request(OpenAPI, {
1111
+ method: 'GET',
1112
+ url: '/api/v1/bean/payees/autocomplete',
1113
+ query: {
1114
+ q: data.q,
1115
+ limit: data.limit
1116
+ }
1117
+ });
1118
+ }
1119
+
1120
+ /**
1121
+ * Get top payees by usage
1122
+ * Returns the most frequently used payees, sorted by use count. Used for statistics and analytics.
1123
+ * @param data The data for the request.
1124
+ * @param data.limit Maximum number of results
1125
+ * @returns PayeeStatsResponseDto Top payees retrieved successfully
1126
+ * @throws ApiError
1127
+ */
1128
+ public static payeeControllerGetTopPayees(
1129
+ data: PayeeControllerGetTopPayeesData = {}
1130
+ ): CancelablePromise<PayeeControllerGetTopPayeesResponse> {
1131
+ return __request(OpenAPI, {
1132
+ method: 'GET',
1133
+ url: '/api/v1/bean/payees/top',
1134
+ query: {
1135
+ limit: data.limit
1136
+ }
1137
+ });
1138
+ }
1139
+
1140
+ /**
1141
+ * Get payee by ID
1142
+ * Returns a specific payee mapping by its UUID
1143
+ * @param data The data for the request.
1144
+ * @param data.id Payee UUID
1145
+ * @returns PayeeResponseDto Payee retrieved successfully
1146
+ * @throws ApiError
1147
+ */
1148
+ public static payeeControllerFindOne(
1149
+ data: PayeeControllerFindOneData
1150
+ ): CancelablePromise<PayeeControllerFindOneResponse> {
1151
+ return __request(OpenAPI, {
1152
+ method: 'GET',
1153
+ url: '/api/v1/bean/payees/{id}',
1154
+ path: {
1155
+ id: data.id
1156
+ },
1157
+ errors: {
1158
+ 403: 'Payee belongs to another user',
1159
+ 404: 'Payee not found'
1160
+ }
1161
+ });
1162
+ }
1163
+
1164
+ /**
1165
+ * Update payee
1166
+ * Updates a payee mapping. The payee name cannot be changed after creation.
1167
+ * @param data The data for the request.
1168
+ * @param data.id Payee UUID
1169
+ * @param data.requestBody
1170
+ * @returns PayeeResponseDto Payee updated successfully
1171
+ * @throws ApiError
1172
+ */
1173
+ public static payeeControllerUpdate(
1174
+ data: PayeeControllerUpdateData
1175
+ ): CancelablePromise<PayeeControllerUpdateResponse> {
1176
+ return __request(OpenAPI, {
1177
+ method: 'PUT',
1178
+ url: '/api/v1/bean/payees/{id}',
1179
+ path: {
1180
+ id: data.id
1181
+ },
1182
+ body: data.requestBody,
1183
+ mediaType: 'application/json',
1184
+ errors: {
1185
+ 400: 'Invalid input data',
1186
+ 404: 'Payee not found'
1187
+ }
1188
+ });
1189
+ }
1190
+
1191
+ /**
1192
+ * Delete payee
1193
+ * Soft deletes a payee by marking it as inactive. Inactive payees will not appear in autocomplete suggestions.
1194
+ * @param data The data for the request.
1195
+ * @param data.id Payee UUID
1196
+ * @returns void Payee deleted successfully
1197
+ * @throws ApiError
1198
+ */
1199
+ public static payeeControllerDelete(
1200
+ data: PayeeControllerDeleteData
1201
+ ): CancelablePromise<PayeeControllerDeleteResponse> {
1202
+ return __request(OpenAPI, {
1203
+ method: 'DELETE',
1204
+ url: '/api/v1/bean/payees/{id}',
1205
+ path: {
1206
+ id: data.id
1207
+ },
1208
+ errors: {
1209
+ 404: 'Payee not found'
1210
+ }
1211
+ });
1212
+ }
1213
+ }
1214
+
1215
+ export class AdminPayeeProfilesService {
1216
+ /**
1217
+ * Create payee profile (Admin only)
1218
+ * Creates a new global payee profile. The canonical name must be unique (case-insensitive).
1219
+ * @param data The data for the request.
1220
+ * @param data.requestBody
1221
+ * @returns PayeeProfileResponseDto Payee profile created successfully
1222
+ * @throws ApiError
1223
+ */
1224
+ public static payeeProfileAdminControllerCreate(
1225
+ data: PayeeProfileAdminControllerCreateData
1226
+ ): CancelablePromise<PayeeProfileAdminControllerCreateResponse> {
1227
+ return __request(OpenAPI, {
1228
+ method: 'POST',
1229
+ url: '/api/v1/admin/payee-profiles',
1230
+ body: data.requestBody,
1231
+ mediaType: 'application/json',
1232
+ errors: {
1233
+ 400: 'Validation failed',
1234
+ 403: 'Admin access required',
1235
+ 409: 'Payee profile already exists'
1236
+ }
1237
+ });
1238
+ }
1239
+
1240
+ /**
1241
+ * List payee profiles (Admin only)
1242
+ * Returns all payee profiles with optional filtering by category, country, verification status, etc.
1243
+ * @param data The data for the request.
1244
+ * @param data.search Search term for canonical name and aliases (case-insensitive)
1245
+ * @param data.category Filter by category
1246
+ * @param data.country Filter by country (ISO 3166-1 alpha-2)
1247
+ * @param data.isActive Filter by active status (default: true - show only active)
1248
+ * @param data.verified Filter by verification status. true = verified only, false = unverified only
1249
+ * @param data.dataSource Filter by data source
1250
+ * @returns PayeeProfileListResponseDto Payee profiles retrieved successfully
1251
+ * @throws ApiError
1252
+ */
1253
+ public static payeeProfileAdminControllerFindAll(
1254
+ data: PayeeProfileAdminControllerFindAllData = {}
1255
+ ): CancelablePromise<PayeeProfileAdminControllerFindAllResponse> {
1256
+ return __request(OpenAPI, {
1257
+ method: 'GET',
1258
+ url: '/api/v1/admin/payee-profiles',
1259
+ query: {
1260
+ search: data.search,
1261
+ category: data.category,
1262
+ country: data.country,
1263
+ isActive: data.isActive,
1264
+ verified: data.verified,
1265
+ dataSource: data.dataSource
1266
+ },
1267
+ errors: {
1268
+ 403: 'Admin access required'
1269
+ }
1270
+ });
1271
+ }
1272
+
1273
+ /**
1274
+ * Get payee profile by ID (Admin only)
1275
+ * Returns a single payee profile by its ID.
1276
+ * @param data The data for the request.
1277
+ * @param data.id Payee profile ID (UUID)
1278
+ * @returns PayeeProfileResponseDto Payee profile retrieved successfully
1279
+ * @throws ApiError
1280
+ */
1281
+ public static payeeProfileAdminControllerFindOne(
1282
+ data: PayeeProfileAdminControllerFindOneData
1283
+ ): CancelablePromise<PayeeProfileAdminControllerFindOneResponse> {
1284
+ return __request(OpenAPI, {
1285
+ method: 'GET',
1286
+ url: '/api/v1/admin/payee-profiles/{id}',
1287
+ path: {
1288
+ id: data.id
1289
+ },
1290
+ errors: {
1291
+ 403: 'Admin access required',
1292
+ 404: 'Payee profile not found'
1293
+ }
1294
+ });
1295
+ }
1296
+
1297
+ /**
1298
+ * Update payee profile (Admin only)
1299
+ * Updates an existing payee profile. The canonical name cannot be changed.
1300
+ * @param data The data for the request.
1301
+ * @param data.id Payee profile ID (UUID)
1302
+ * @param data.requestBody
1303
+ * @returns PayeeProfileResponseDto Payee profile updated successfully
1304
+ * @throws ApiError
1305
+ */
1306
+ public static payeeProfileAdminControllerUpdate(
1307
+ data: PayeeProfileAdminControllerUpdateData
1308
+ ): CancelablePromise<PayeeProfileAdminControllerUpdateResponse> {
1309
+ return __request(OpenAPI, {
1310
+ method: 'PUT',
1311
+ url: '/api/v1/admin/payee-profiles/{id}',
1312
+ path: {
1313
+ id: data.id
1314
+ },
1315
+ body: data.requestBody,
1316
+ mediaType: 'application/json',
1317
+ errors: {
1318
+ 403: 'Admin access required',
1319
+ 404: 'Payee profile not found'
1320
+ }
1321
+ });
1322
+ }
1323
+
1324
+ /**
1325
+ * Soft delete payee profile (Admin only)
1326
+ * Marks a payee profile as inactive (soft delete). The profile cannot be deleted if it is referenced by user payees.
1327
+ * @param data The data for the request.
1328
+ * @param data.id Payee profile ID (UUID)
1329
+ * @returns void Payee profile deleted successfully
1330
+ * @throws ApiError
1331
+ */
1332
+ public static payeeProfileAdminControllerDelete(
1333
+ data: PayeeProfileAdminControllerDeleteData
1334
+ ): CancelablePromise<PayeeProfileAdminControllerDeleteResponse> {
1335
+ return __request(OpenAPI, {
1336
+ method: 'DELETE',
1337
+ url: '/api/v1/admin/payee-profiles/{id}',
1338
+ path: {
1339
+ id: data.id
1340
+ },
1341
+ errors: {
1342
+ 403: 'Admin access required',
1343
+ 404: 'Payee profile not found',
1344
+ 409: 'Payee profile is in use and cannot be deleted'
1345
+ }
1346
+ });
1347
+ }
1348
+
1349
+ /**
1350
+ * Verify payee profile (Admin only)
1351
+ * Marks a payee profile as verified by setting verifiedAt to current timestamp.
1352
+ * @param data The data for the request.
1353
+ * @param data.id Payee profile ID (UUID)
1354
+ * @returns PayeeProfileResponseDto Payee profile verified successfully
1355
+ * @throws ApiError
1356
+ */
1357
+ public static payeeProfileAdminControllerVerify(
1358
+ data: PayeeProfileAdminControllerVerifyData
1359
+ ): CancelablePromise<PayeeProfileAdminControllerVerifyResponse> {
1360
+ return __request(OpenAPI, {
1361
+ method: 'POST',
1362
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1363
+ path: {
1364
+ id: data.id
1365
+ },
1366
+ errors: {
1367
+ 403: 'Admin access required',
1368
+ 404: 'Payee profile not found'
1369
+ }
1370
+ });
1371
+ }
1372
+
1373
+ /**
1374
+ * Unverify payee profile (Admin only)
1375
+ * Removes verification status by setting verifiedAt to null.
1376
+ * @param data The data for the request.
1377
+ * @param data.id Payee profile ID (UUID)
1378
+ * @returns PayeeProfileResponseDto Payee profile unverified successfully
1379
+ * @throws ApiError
1380
+ */
1381
+ public static payeeProfileAdminControllerUnverify(
1382
+ data: PayeeProfileAdminControllerUnverifyData
1383
+ ): CancelablePromise<PayeeProfileAdminControllerUnverifyResponse> {
1384
+ return __request(OpenAPI, {
1385
+ method: 'DELETE',
1386
+ url: '/api/v1/admin/payee-profiles/{id}/verify',
1387
+ path: {
1388
+ id: data.id
1389
+ },
1390
+ errors: {
1391
+ 403: 'Admin access required',
1392
+ 404: 'Payee profile not found'
1393
+ }
1394
+ });
1395
+ }
1396
+ }
1397
+
1398
+ export class BeanCommoditiesService {
1399
+ /**
1400
+ * Create a new commodity
1401
+ * Creates a new commodity definition for the authenticated user
1402
+ * @param data The data for the request.
1403
+ * @param data.region Region code for tenant context
1404
+ * @param data.requestBody
1405
+ * @returns CommodityResponseDto Commodity created successfully
1406
+ * @throws ApiError
1407
+ */
1408
+ public static commodityControllerCreate(
1409
+ data: CommodityControllerCreateData
1410
+ ): CancelablePromise<CommodityControllerCreateResponse> {
1411
+ return __request(OpenAPI, {
1412
+ method: 'POST',
1413
+ url: '/api/v1/{region}/bean/commodities',
1414
+ path: {
1415
+ region: data.region
1416
+ },
1417
+ body: data.requestBody,
1418
+ mediaType: 'application/json',
1419
+ errors: {
1420
+ 400: 'Invalid input data',
1421
+ 409: 'Commodity already exists'
1422
+ }
1423
+ });
1424
+ }
1425
+
1426
+ /**
1427
+ * List user commodities
1428
+ * Returns all commodity definitions for the authenticated user with optional filtering
1429
+ * @param data The data for the request.
1430
+ * @param data.region Region code for tenant context
1431
+ * @param data.search Search term for symbol or metadata fields (partial match). Searches symbol and metadata.name.
1432
+ * @param data.symbol Filter by exact symbol match
1433
+ * @returns CommodityListResponseDto Commodities retrieved successfully
1434
+ * @throws ApiError
1435
+ */
1436
+ public static commodityControllerFindAll(
1437
+ data: CommodityControllerFindAllData
1438
+ ): CancelablePromise<CommodityControllerFindAllResponse> {
1439
+ return __request(OpenAPI, {
1440
+ method: 'GET',
1441
+ url: '/api/v1/{region}/bean/commodities',
1442
+ path: {
1443
+ region: data.region
1444
+ },
1445
+ query: {
1446
+ search: data.search,
1447
+ symbol: data.symbol
1448
+ }
1449
+ });
1450
+ }
1451
+
1452
+ /**
1453
+ * Get commodity by symbol
1454
+ * Returns a specific commodity definition by its symbol
1455
+ * @param data The data for the request.
1456
+ * @param data.symbol Commodity symbol
1457
+ * @param data.region Region code for tenant context
1458
+ * @returns CommodityResponseDto Commodity retrieved successfully
1459
+ * @throws ApiError
1460
+ */
1461
+ public static commodityControllerFindOne(
1462
+ data: CommodityControllerFindOneData
1463
+ ): CancelablePromise<CommodityControllerFindOneResponse> {
1464
+ return __request(OpenAPI, {
1465
+ method: 'GET',
1466
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1467
+ path: {
1468
+ symbol: data.symbol,
1469
+ region: data.region
1470
+ },
1471
+ errors: {
1472
+ 404: 'Commodity not found'
1473
+ }
1474
+ });
1475
+ }
1476
+
1477
+ /**
1478
+ * Update commodity
1479
+ * Updates an existing commodity definition. Symbol cannot be changed.
1480
+ * @param data The data for the request.
1481
+ * @param data.symbol Commodity symbol
1482
+ * @param data.region Region code for tenant context
1483
+ * @param data.requestBody
1484
+ * @returns CommodityResponseDto Commodity updated successfully
1485
+ * @throws ApiError
1486
+ */
1487
+ public static commodityControllerUpdate(
1488
+ data: CommodityControllerUpdateData
1489
+ ): CancelablePromise<CommodityControllerUpdateResponse> {
1490
+ return __request(OpenAPI, {
1491
+ method: 'PUT',
1492
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1493
+ path: {
1494
+ symbol: data.symbol,
1495
+ region: data.region
1496
+ },
1497
+ body: data.requestBody,
1498
+ mediaType: 'application/json',
1499
+ errors: {
1500
+ 400: 'Invalid input data',
1501
+ 404: 'Commodity not found'
1502
+ }
1503
+ });
1504
+ }
1505
+
1506
+ /**
1507
+ * Delete commodity
1508
+ * Deletes a commodity definition
1509
+ * @param data The data for the request.
1510
+ * @param data.symbol Commodity symbol
1511
+ * @param data.region Region code for tenant context
1512
+ * @returns void Commodity deleted successfully
1513
+ * @throws ApiError
1514
+ */
1515
+ public static commodityControllerDelete(
1516
+ data: CommodityControllerDeleteData
1517
+ ): CancelablePromise<CommodityControllerDeleteResponse> {
1518
+ return __request(OpenAPI, {
1519
+ method: 'DELETE',
1520
+ url: '/api/v1/{region}/bean/commodities/{symbol}',
1521
+ path: {
1522
+ symbol: data.symbol,
1523
+ region: data.region
1524
+ },
1525
+ errors: {
1526
+ 404: 'Commodity not found'
1527
+ }
1528
+ });
1529
+ }
1530
+
1531
+ /**
1532
+ * Ensure commodity exists
1533
+ * Gets existing commodity or creates it with automatic initialization from OpenBB
1534
+ * @param data The data for the request.
1535
+ * @param data.symbol Commodity symbol
1536
+ * @param data.region Region code for tenant context
1537
+ * @returns CommodityResponseDto Commodity retrieved or created
1538
+ * @throws ApiError
1539
+ */
1540
+ public static commodityControllerGetOrCreate(
1541
+ data: CommodityControllerGetOrCreateData
1542
+ ): CancelablePromise<CommodityControllerGetOrCreateResponse> {
1543
+ return __request(OpenAPI, {
1544
+ method: 'POST',
1545
+ url: '/api/v1/{region}/bean/commodities/{symbol}/ensure',
1546
+ path: {
1547
+ symbol: data.symbol,
1548
+ region: data.region
1549
+ }
1550
+ });
1551
+ }
1552
+
1553
+ /**
1554
+ * Bulk create commodities
1555
+ * Creates multiple commodities from a list of symbols, useful for initialization
1556
+ * @param data The data for the request.
1557
+ * @param data.region Region code for tenant context
1558
+ * @returns CommodityResponseDto Commodities created successfully
1559
+ * @throws ApiError
1560
+ */
1561
+ public static commodityControllerBulkCreate(
1562
+ data: CommodityControllerBulkCreateData
1563
+ ): CancelablePromise<CommodityControllerBulkCreateResponse> {
1564
+ return __request(OpenAPI, {
1565
+ method: 'POST',
1566
+ url: '/api/v1/{region}/bean/commodities/bulk',
1567
+ path: {
1568
+ region: data.region
1569
+ }
1570
+ });
1571
+ }
1572
+ }
1573
+
1574
+ export class BeanPricesService {
1575
+ /**
1576
+ * Create a new price
1577
+ * Creates a new price entry for the authenticated user
1578
+ * @param data The data for the request.
1579
+ * @param data.region Region code for tenant context
1580
+ * @param data.requestBody
1581
+ * @returns PriceResponseDto Price created successfully
1582
+ * @throws ApiError
1583
+ */
1584
+ public static priceControllerCreate(
1585
+ data: PriceControllerCreateData
1586
+ ): CancelablePromise<PriceControllerCreateResponse> {
1587
+ return __request(OpenAPI, {
1588
+ method: 'POST',
1589
+ url: '/api/v1/{region}/bean/prices',
1590
+ path: {
1591
+ region: data.region
1592
+ },
1593
+ body: data.requestBody,
1594
+ mediaType: 'application/json',
1595
+ errors: {
1596
+ 404: 'Currency or quoteCurrency commodity not found',
1597
+ 409: 'Price already exists for this currency pair and date'
1598
+ }
1599
+ });
1600
+ }
1601
+
1602
+ /**
1603
+ * List user prices
1604
+ * Returns all price entries for the authenticated user with optional filtering
1605
+ * @param data The data for the request.
1606
+ * @param data.region Region code for tenant context
1607
+ * @param data.currency Filter by currency (e.g., BTC, AAPL, USD)
1608
+ * @param data.quoteCurrency Filter by quote currency (pricing currency, e.g., USD, CNY)
1609
+ * @param data.dateFrom Filter prices from this date (ISO 8601 format)
1610
+ * @param data.dateTo Filter prices to this date (ISO 8601 format)
1611
+ * @param data.search Search term for currency or quoteCurrency (case-insensitive partial match)
1612
+ * @param data.page Page number for pagination (default: 1)
1613
+ * @param data.limit Number of items per page (default: 20, max: 100)
1614
+ * @returns PriceListResponseDto Prices retrieved successfully
1615
+ * @throws ApiError
1616
+ */
1617
+ public static priceControllerFindAll(
1618
+ data: PriceControllerFindAllData
1619
+ ): CancelablePromise<PriceControllerFindAllResponse> {
1620
+ return __request(OpenAPI, {
1621
+ method: 'GET',
1622
+ url: '/api/v1/{region}/bean/prices',
1623
+ path: {
1624
+ region: data.region
1625
+ },
1626
+ query: {
1627
+ currency: data.currency,
1628
+ quoteCurrency: data.quoteCurrency,
1629
+ dateFrom: data.dateFrom,
1630
+ dateTo: data.dateTo,
1631
+ search: data.search,
1632
+ page: data.page,
1633
+ limit: data.limit
1634
+ }
1635
+ });
1636
+ }
1637
+
1638
+ /**
1639
+ * Get price by ID
1640
+ * Returns a single price entry by its ID
1641
+ * @param data The data for the request.
1642
+ * @param data.id Price ID
1643
+ * @param data.region Region code for tenant context
1644
+ * @returns PriceResponseDto Price retrieved successfully
1645
+ * @throws ApiError
1646
+ */
1647
+ public static priceControllerFindOne(
1648
+ data: PriceControllerFindOneData
1649
+ ): CancelablePromise<PriceControllerFindOneResponse> {
1650
+ return __request(OpenAPI, {
1651
+ method: 'GET',
1652
+ url: '/api/v1/{region}/bean/prices/{id}',
1653
+ path: {
1654
+ id: data.id,
1655
+ region: data.region
1656
+ },
1657
+ errors: {
1658
+ 404: 'Price not found'
1659
+ }
1660
+ });
1661
+ }
1662
+
1663
+ /**
1664
+ * Update a price
1665
+ * Updates an existing price entry
1666
+ * @param data The data for the request.
1667
+ * @param data.id Price ID
1668
+ * @param data.region Region code for tenant context
1669
+ * @param data.requestBody
1670
+ * @returns PriceResponseDto Price updated successfully
1671
+ * @throws ApiError
1672
+ */
1673
+ public static priceControllerUpdate(
1674
+ data: PriceControllerUpdateData
1675
+ ): CancelablePromise<PriceControllerUpdateResponse> {
1676
+ return __request(OpenAPI, {
1677
+ method: 'PUT',
1678
+ url: '/api/v1/{region}/bean/prices/{id}',
1679
+ path: {
1680
+ id: data.id,
1681
+ region: data.region
1682
+ },
1683
+ body: data.requestBody,
1684
+ mediaType: 'application/json',
1685
+ errors: {
1686
+ 404: 'Price not found',
1687
+ 409: 'Updated price conflicts with existing price'
1688
+ }
1689
+ });
1690
+ }
1691
+
1692
+ /**
1693
+ * Delete a price
1694
+ * Deletes a price entry (hard delete)
1695
+ * @param data The data for the request.
1696
+ * @param data.id Price ID
1697
+ * @param data.region Region code for tenant context
1698
+ * @returns void Price deleted successfully
1699
+ * @throws ApiError
1700
+ */
1701
+ public static priceControllerDelete(
1702
+ data: PriceControllerDeleteData
1703
+ ): CancelablePromise<PriceControllerDeleteResponse> {
1704
+ return __request(OpenAPI, {
1705
+ method: 'DELETE',
1706
+ url: '/api/v1/{region}/bean/prices/{id}',
1707
+ path: {
1708
+ id: data.id,
1709
+ region: data.region
1710
+ },
1711
+ errors: {
1712
+ 404: 'Price not found'
1713
+ }
1714
+ });
1715
+ }
1716
+
1717
+ /**
1718
+ * Bulk create prices
1719
+ * Creates multiple price entries at once (skips duplicates)
1720
+ * @param data The data for the request.
1721
+ * @param data.region Region code for tenant context
1722
+ * @param data.requestBody
1723
+ * @returns PriceResponseDto Prices created successfully
1724
+ * @throws ApiError
1725
+ */
1726
+ public static priceControllerBulkCreate(
1727
+ data: PriceControllerBulkCreateData
1728
+ ): CancelablePromise<PriceControllerBulkCreateResponse> {
1729
+ return __request(OpenAPI, {
1730
+ method: 'POST',
1731
+ url: '/api/v1/{region}/bean/prices/bulk',
1732
+ path: {
1733
+ region: data.region
1734
+ },
1735
+ body: data.requestBody,
1736
+ mediaType: 'application/json'
1737
+ });
1738
+ }
1739
+ }
1740
+
1741
+ export class RecurringRulesService {
1742
+ /**
1743
+ * Create a new recurring rule
1744
+ * Creates a new recurring transaction rule for the authenticated user
1745
+ * @param data The data for the request.
1746
+ * @param data.region Region code for tenant context
1747
+ * @param data.requestBody
1748
+ * @returns RecurringRuleResponseDto Rule created successfully
1749
+ * @throws ApiError
1750
+ */
1751
+ public static recurringRuleControllerCreate(
1752
+ data: RecurringRuleControllerCreateData
1753
+ ): CancelablePromise<RecurringRuleControllerCreateResponse> {
1754
+ return __request(OpenAPI, {
1755
+ method: 'POST',
1756
+ url: '/api/v1/{region}/bean/recurring-rules',
1757
+ path: {
1758
+ region: data.region
1759
+ },
1760
+ body: data.requestBody,
1761
+ mediaType: 'application/json',
1762
+ errors: {
1763
+ 400: 'Invalid input data (e.g., autoCreate without accounts)',
1764
+ 409: 'Rule with same name already exists'
1765
+ }
1766
+ });
1767
+ }
1768
+
1769
+ /**
1770
+ * List recurring rules
1771
+ * Returns all recurring rules for the authenticated user with optional filtering
1772
+ * @param data The data for the request.
1773
+ * @param data.region Region code for tenant context
1774
+ * @param data.isActive Filter by active status
1775
+ * @param data.frequency Filter by frequency (WEEKLY, MONTHLY, etc.)
1776
+ * @param data.hasAutoCreate Filter by autoCreate enabled
1777
+ * @returns RecurringRuleResponseDto Rules retrieved successfully
1778
+ * @throws ApiError
1779
+ */
1780
+ public static recurringRuleControllerFindAll(
1781
+ data: RecurringRuleControllerFindAllData
1782
+ ): CancelablePromise<RecurringRuleControllerFindAllResponse> {
1783
+ return __request(OpenAPI, {
1784
+ method: 'GET',
1785
+ url: '/api/v1/{region}/bean/recurring-rules',
1786
+ path: {
1787
+ region: data.region
1788
+ },
1789
+ query: {
1790
+ isActive: data.isActive,
1791
+ frequency: data.frequency,
1792
+ hasAutoCreate: data.hasAutoCreate
1793
+ }
1794
+ });
1795
+ }
1796
+
1797
+ /**
1798
+ * Create recurring rule from transaction
1799
+ * Auto-creates a recurring rule using transaction data. User only confirms frequency.
1800
+ * @param data The data for the request.
1801
+ * @param data.transactionId Source transaction ID
1802
+ * @param data.region Region code for tenant context
1803
+ * @param data.requestBody
1804
+ * @returns RecurringRuleResponseDto Rule created successfully
1805
+ * @throws ApiError
1806
+ */
1807
+ public static recurringRuleControllerCreateFromTransaction(
1808
+ data: RecurringRuleControllerCreateFromTransactionData
1809
+ ): CancelablePromise<RecurringRuleControllerCreateFromTransactionResponse> {
1810
+ return __request(OpenAPI, {
1811
+ method: 'POST',
1812
+ url: '/api/v1/{region}/bean/recurring-rules/from-transaction/{transactionId}',
1813
+ path: {
1814
+ transactionId: data.transactionId,
1815
+ region: data.region
1816
+ },
1817
+ body: data.requestBody,
1818
+ mediaType: 'application/json',
1819
+ errors: {
1820
+ 404: 'Transaction not found',
1821
+ 409: 'Rule with same name already exists or transaction already linked'
1822
+ }
1823
+ });
1824
+ }
1825
+
1826
+ /**
1827
+ * Get recurring rule by ID
1828
+ * Returns a specific recurring rule with its details
1829
+ * @param data The data for the request.
1830
+ * @param data.id Rule ID
1831
+ * @param data.region Region code for tenant context
1832
+ * @returns RecurringRuleResponseDto Rule retrieved successfully
1833
+ * @throws ApiError
1834
+ */
1835
+ public static recurringRuleControllerFindOne(
1836
+ data: RecurringRuleControllerFindOneData
1837
+ ): CancelablePromise<RecurringRuleControllerFindOneResponse> {
1838
+ return __request(OpenAPI, {
1839
+ method: 'GET',
1840
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1841
+ path: {
1842
+ id: data.id,
1843
+ region: data.region
1844
+ },
1845
+ errors: {
1846
+ 404: 'Rule not found'
1847
+ }
1848
+ });
1849
+ }
1850
+
1851
+ /**
1852
+ * Update recurring rule
1853
+ * Updates an existing recurring rule
1854
+ * @param data The data for the request.
1855
+ * @param data.id Rule ID
1856
+ * @param data.region Region code for tenant context
1857
+ * @param data.requestBody
1858
+ * @returns RecurringRuleResponseDto Rule updated successfully
1859
+ * @throws ApiError
1860
+ */
1861
+ public static recurringRuleControllerUpdate(
1862
+ data: RecurringRuleControllerUpdateData
1863
+ ): CancelablePromise<RecurringRuleControllerUpdateResponse> {
1864
+ return __request(OpenAPI, {
1865
+ method: 'PATCH',
1866
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1867
+ path: {
1868
+ id: data.id,
1869
+ region: data.region
1870
+ },
1871
+ body: data.requestBody,
1872
+ mediaType: 'application/json',
1873
+ errors: {
1874
+ 400: 'Invalid input data',
1875
+ 404: 'Rule not found'
1876
+ }
1877
+ });
1878
+ }
1879
+
1880
+ /**
1881
+ * Delete recurring rule
1882
+ * Soft deletes a recurring rule (sets isActive to false)
1883
+ * @param data The data for the request.
1884
+ * @param data.id Rule ID
1885
+ * @param data.region Region code for tenant context
1886
+ * @returns void Rule deleted successfully
1887
+ * @throws ApiError
1888
+ */
1889
+ public static recurringRuleControllerDelete(
1890
+ data: RecurringRuleControllerDeleteData
1891
+ ): CancelablePromise<RecurringRuleControllerDeleteResponse> {
1892
+ return __request(OpenAPI, {
1893
+ method: 'DELETE',
1894
+ url: '/api/v1/{region}/bean/recurring-rules/{id}',
1895
+ path: {
1896
+ id: data.id,
1897
+ region: data.region
1898
+ },
1899
+ errors: {
1900
+ 404: 'Rule not found'
1901
+ }
1902
+ });
1903
+ }
1904
+
1905
+ /**
1906
+ * Get rule with statistics
1907
+ * Returns a rule with pending/overdue counts and next expected date
1908
+ * @param data The data for the request.
1909
+ * @param data.id Rule ID
1910
+ * @param data.region Region code for tenant context
1911
+ * @returns RecurringRuleWithStatsResponseDto Rule with stats retrieved successfully
1912
+ * @throws ApiError
1913
+ */
1914
+ public static recurringRuleControllerGetWithStats(
1915
+ data: RecurringRuleControllerGetWithStatsData
1916
+ ): CancelablePromise<RecurringRuleControllerGetWithStatsResponse> {
1917
+ return __request(OpenAPI, {
1918
+ method: 'GET',
1919
+ url: '/api/v1/{region}/bean/recurring-rules/{id}/stats',
1920
+ path: {
1921
+ id: data.id,
1922
+ region: data.region
1923
+ },
1924
+ errors: {
1925
+ 404: 'Rule not found'
1926
+ }
1927
+ });
1928
+ }
1929
+ }
1930
+
1931
+ export class ExpectedTransactionsService {
1932
+ /**
1933
+ * List expected transactions
1934
+ * Returns expected transactions for the authenticated user with optional filtering
1935
+ * @param data The data for the request.
1936
+ * @param data.region Region code for tenant context
1937
+ * @param data.ruleId Filter by recurring rule ID
1938
+ * @param data.status Filter by status (PENDING, COMPLETED, SKIPPED)
1939
+ * @param data.fromDate Filter by date range start (YYYY-MM-DD)
1940
+ * @param data.toDate Filter by date range end (YYYY-MM-DD)
1941
+ * @returns ExpectedTransactionListResponseDto Expected transactions retrieved successfully
1942
+ * @throws ApiError
1943
+ */
1944
+ public static expectedTransactionControllerFindAll(
1945
+ data: ExpectedTransactionControllerFindAllData
1946
+ ): CancelablePromise<ExpectedTransactionControllerFindAllResponse> {
1947
+ return __request(OpenAPI, {
1948
+ method: 'GET',
1949
+ url: '/api/v1/{region}/bean/expected-transactions',
1950
+ path: {
1951
+ region: data.region
1952
+ },
1953
+ query: {
1954
+ ruleId: data.ruleId,
1955
+ status: data.status,
1956
+ fromDate: data.fromDate,
1957
+ toDate: data.toDate
1958
+ }
1959
+ });
1960
+ }
1961
+
1962
+ /**
1963
+ * List overdue expected transactions
1964
+ * Returns all overdue expected transactions (PENDING past tolerance)
1965
+ * @param data The data for the request.
1966
+ * @param data.region Region code for tenant context
1967
+ * @returns ExpectedTransactionListResponseDto Overdue transactions retrieved successfully
1968
+ * @throws ApiError
1969
+ */
1970
+ public static expectedTransactionControllerFindOverdue(
1971
+ data: ExpectedTransactionControllerFindOverdueData
1972
+ ): CancelablePromise<ExpectedTransactionControllerFindOverdueResponse> {
1973
+ return __request(OpenAPI, {
1974
+ method: 'GET',
1975
+ url: '/api/v1/{region}/bean/expected-transactions/overdue',
1976
+ path: {
1977
+ region: data.region
1978
+ }
1979
+ });
1980
+ }
1981
+
1982
+ /**
1983
+ * Get expected transaction by ID
1984
+ * Returns a specific expected transaction with rule details
1985
+ * @param data The data for the request.
1986
+ * @param data.id Expected transaction ID
1987
+ * @param data.region Region code for tenant context
1988
+ * @returns ExpectedTransactionResponseDto Expected transaction retrieved successfully
1989
+ * @throws ApiError
1990
+ */
1991
+ public static expectedTransactionControllerFindOne(
1992
+ data: ExpectedTransactionControllerFindOneData
1993
+ ): CancelablePromise<ExpectedTransactionControllerFindOneResponse> {
1994
+ return __request(OpenAPI, {
1995
+ method: 'GET',
1996
+ url: '/api/v1/{region}/bean/expected-transactions/{id}',
1997
+ path: {
1998
+ id: data.id,
1999
+ region: data.region
2000
+ },
2001
+ errors: {
2002
+ 404: 'Expected transaction not found'
2003
+ }
2004
+ });
2005
+ }
2006
+
2007
+ /**
2008
+ * Skip expected transaction
2009
+ * Marks an expected transaction as skipped (PENDING -> SKIPPED)
2010
+ * @param data The data for the request.
2011
+ * @param data.id Expected transaction ID
2012
+ * @param data.region Region code for tenant context
2013
+ * @returns ExpectedTransactionResponseDto Expected transaction skipped successfully
2014
+ * @throws ApiError
2015
+ */
2016
+ public static expectedTransactionControllerSkip(
2017
+ data: ExpectedTransactionControllerSkipData
2018
+ ): CancelablePromise<ExpectedTransactionControllerSkipResponse> {
2019
+ return __request(OpenAPI, {
2020
+ method: 'POST',
2021
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2022
+ path: {
2023
+ id: data.id,
2024
+ region: data.region
2025
+ },
2026
+ errors: {
2027
+ 400: 'Cannot skip - not in PENDING status',
2028
+ 404: 'Expected transaction not found'
2029
+ }
2030
+ });
2031
+ }
2032
+
2033
+ /**
2034
+ * Undo skip
2035
+ * Reverses a skip operation (SKIPPED -> PENDING)
2036
+ * @param data The data for the request.
2037
+ * @param data.id Expected transaction ID
2038
+ * @param data.region Region code for tenant context
2039
+ * @returns ExpectedTransactionResponseDto Skip undone successfully
2040
+ * @throws ApiError
2041
+ */
2042
+ public static expectedTransactionControllerUndoSkip(
2043
+ data: ExpectedTransactionControllerUndoSkipData
2044
+ ): CancelablePromise<ExpectedTransactionControllerUndoSkipResponse> {
2045
+ return __request(OpenAPI, {
2046
+ method: 'DELETE',
2047
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/skip',
2048
+ path: {
2049
+ id: data.id,
2050
+ region: data.region
2051
+ },
2052
+ errors: {
2053
+ 400: 'Cannot undo - not in SKIPPED status',
2054
+ 404: 'Expected transaction not found'
2055
+ }
2056
+ });
2057
+ }
2058
+
2059
+ /**
2060
+ * Confirm transaction match
2061
+ * Manually matches an expected transaction with an actual transaction
2062
+ * @param data The data for the request.
2063
+ * @param data.id Expected transaction ID
2064
+ * @param data.region Region code for tenant context
2065
+ * @param data.requestBody
2066
+ * @returns unknown Match confirmed successfully
2067
+ * @throws ApiError
2068
+ */
2069
+ public static expectedTransactionControllerConfirmMatch(
2070
+ data: ExpectedTransactionControllerConfirmMatchData
2071
+ ): CancelablePromise<ExpectedTransactionControllerConfirmMatchResponse> {
2072
+ return __request(OpenAPI, {
2073
+ method: 'POST',
2074
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2075
+ path: {
2076
+ id: data.id,
2077
+ region: data.region
2078
+ },
2079
+ body: data.requestBody,
2080
+ mediaType: 'application/json',
2081
+ errors: {
2082
+ 400: 'Cannot match - not in PENDING status',
2083
+ 404: 'Expected or actual transaction not found',
2084
+ 409: 'Actual transaction already matched to another rule'
2085
+ }
2086
+ });
2087
+ }
2088
+
2089
+ /**
2090
+ * Unmatch transaction
2091
+ * Removes the match between expected and actual transaction (COMPLETED -> PENDING)
2092
+ * @param data The data for the request.
2093
+ * @param data.id Expected transaction ID
2094
+ * @param data.region Region code for tenant context
2095
+ * @returns unknown Match removed successfully
2096
+ * @throws ApiError
2097
+ */
2098
+ public static expectedTransactionControllerUnmatch(
2099
+ data: ExpectedTransactionControllerUnmatchData
2100
+ ): CancelablePromise<ExpectedTransactionControllerUnmatchResponse> {
2101
+ return __request(OpenAPI, {
2102
+ method: 'DELETE',
2103
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/match',
2104
+ path: {
2105
+ id: data.id,
2106
+ region: data.region
2107
+ },
2108
+ errors: {
2109
+ 400: 'Cannot unmatch - not in COMPLETED status',
2110
+ 404: 'Expected transaction not found'
2111
+ }
2112
+ });
2113
+ }
2114
+
2115
+ /**
2116
+ * Enter Now
2117
+ * Creates an actual transaction for an expected transaction (YNAB-style Enter Now)
2118
+ * @param data The data for the request.
2119
+ * @param data.id Expected transaction ID
2120
+ * @param data.region Region code for tenant context
2121
+ * @param data.requestBody
2122
+ * @returns unknown Transaction created successfully
2123
+ * @throws ApiError
2124
+ */
2125
+ public static expectedTransactionControllerEnterNow(
2126
+ data: ExpectedTransactionControllerEnterNowData
2127
+ ): CancelablePromise<ExpectedTransactionControllerEnterNowResponse> {
2128
+ return __request(OpenAPI, {
2129
+ method: 'POST',
2130
+ url: '/api/v1/{region}/bean/expected-transactions/{id}/enter',
2131
+ path: {
2132
+ id: data.id,
2133
+ region: data.region
2134
+ },
2135
+ body: data.requestBody,
2136
+ mediaType: 'application/json',
2137
+ errors: {
2138
+ 400: 'Cannot enter - not in PENDING status or missing accounts',
2139
+ 404: 'Expected transaction or accounts not found'
2140
+ }
2141
+ });
2142
+ }
2143
+ }
2144
+
2145
+ export class RecurringForecastService {
2146
+ /**
2147
+ * Get cash flow forecast
2148
+ * Returns predicted outflows for the next N months based on active recurring rules
2149
+ * @param data The data for the request.
2150
+ * @param data.region Region code for tenant context
2151
+ * @param data.months Number of months to forecast (1-12, default 3)
2152
+ * @returns ForecastResponseDto Forecast retrieved successfully
2153
+ * @throws ApiError
2154
+ */
2155
+ public static forecastControllerGetForecast(
2156
+ data: ForecastControllerGetForecastData
2157
+ ): CancelablePromise<ForecastControllerGetForecastResponse> {
2158
+ return __request(OpenAPI, {
2159
+ method: 'GET',
2160
+ url: '/api/v1/{region}/bean/recurring/forecast',
2161
+ path: {
2162
+ region: data.region
2163
+ },
2164
+ query: {
2165
+ months: data.months
2166
+ }
2167
+ });
2168
+ }
2169
+ }
2170
+
2171
+ export class ReportingService {
2172
+ /**
2173
+ * Get portfolio value trends
2174
+ *
2175
+ * Returns time series data of portfolio net worth.
2176
+ *
2177
+ * **Multi-currency Support:**
2178
+ * - `series[].byCurrency` - Currency breakdown for each data point
2179
+ * - `byCurrency` - Separate time series grouped by currency
2180
+ * - `warnings` - Exchange rate warnings if conversion failed
2181
+ *
2182
+ * **Parameters:**
2183
+ * - `period`: Time period (1m, 3m, 6m, 1y)
2184
+ * - `granularity`: Data granularity (day, week, month)
2185
+ *
2186
+ * @param data The data for the request.
2187
+ * @param data.region Region code for tenant context
2188
+ * @param data.period Time period
2189
+ * @param data.granularity Data granularity
2190
+ * @returns PortfolioTrendsResponseDto Trends retrieved successfully
2191
+ * @throws ApiError
2192
+ */
2193
+ public static reportingControllerGetPortfolioTrends(
2194
+ data: ReportingControllerGetPortfolioTrendsData
2195
+ ): CancelablePromise<ReportingControllerGetPortfolioTrendsResponse> {
2196
+ return __request(OpenAPI, {
2197
+ method: 'GET',
2198
+ url: '/api/v1/{region}/reporting/portfolio/trends',
2199
+ path: {
2200
+ region: data.region
2201
+ },
2202
+ query: {
2203
+ period: data.period,
2204
+ granularity: data.granularity
2205
+ },
2206
+ errors: {
2207
+ 401: 'User not authenticated'
2208
+ }
2209
+ });
2210
+ }
2211
+
2212
+ /**
2213
+ * Get cash-flow trends
2214
+ *
2215
+ * Monthly income / expense / netSavings over a fixed N-month window
2216
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
2217
+ *
2218
+ * **Parameters:**
2219
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
2220
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
2221
+ *
2222
+ * @param data The data for the request.
2223
+ * @param data.region Region code for tenant context
2224
+ * @param data.period Time period
2225
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
2226
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
2227
+ * @throws ApiError
2228
+ */
2229
+ public static reportingControllerGetCashFlowTrends(
2230
+ data: ReportingControllerGetCashFlowTrendsData
2231
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
2232
+ return __request(OpenAPI, {
2233
+ method: 'GET',
2234
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
2235
+ path: {
2236
+ region: data.region
2237
+ },
2238
+ query: {
2239
+ period: data.period,
2240
+ granularity: data.granularity
2241
+ },
2242
+ errors: {
2243
+ 401: 'User not authenticated'
2244
+ }
2245
+ });
2246
+ }
2247
+
2248
+ /**
2249
+ * Generate portfolio snapshot
2250
+ *
2251
+ * Manually generate a portfolio snapshot for a specific date.
2252
+ *
2253
+ * **Multi-currency Support:**
2254
+ * - Fetches balances grouped by currency
2255
+ * - Uses user's baseCurrency setting for conversion
2256
+ * - Stores exchange rates and warnings
2257
+ *
2258
+ * **Use Cases:**
2259
+ * - Testing snapshot generation
2260
+ * - Force regeneration after data correction
2261
+ * - Initial setup for new users
2262
+ *
2263
+ * @param data The data for the request.
2264
+ * @param data.region Region code for tenant context
2265
+ * @param data.requestBody Optional date (defaults to today)
2266
+ * @returns GenerateSnapshotResponse Snapshot generated successfully
2267
+ * @throws ApiError
2268
+ */
2269
+ public static reportingControllerGenerateSnapshot(
2270
+ data: ReportingControllerGenerateSnapshotData
2271
+ ): CancelablePromise<ReportingControllerGenerateSnapshotResponse> {
2272
+ return __request(OpenAPI, {
2273
+ method: 'POST',
2274
+ url: '/api/v1/{region}/reporting/snapshots/generate',
2275
+ path: {
2276
+ region: data.region
2277
+ },
2278
+ body: data.requestBody,
2279
+ mediaType: 'application/json',
2280
+ errors: {
2281
+ 400: 'Invalid date format',
2282
+ 401: 'User not authenticated'
2283
+ }
2284
+ });
2285
+ }
2286
+
2287
+ /**
2288
+ * Backfill portfolio snapshots
2289
+ *
2290
+ * Generate snapshots for a date range (historical data backfill).
2291
+ *
2292
+ * **Multi-currency Support:**
2293
+ * - Each snapshot includes multi-currency data
2294
+ * - Uses exchange rates available at generation time
2295
+ * - Warnings stored for missing exchange rates
2296
+ *
2297
+ * **Best Practices:**
2298
+ * - Use for initial setup after account configuration
2299
+ * - Run during low-traffic periods for large date ranges
2300
+ * - Existing snapshots are skipped (not regenerated)
2301
+ *
2302
+ * @param data The data for the request.
2303
+ * @param data.region Region code for tenant context
2304
+ * @param data.requestBody
2305
+ * @returns BackfillSnapshotsResponse Backfill completed successfully
2306
+ * @throws ApiError
2307
+ */
2308
+ public static reportingControllerBackfillSnapshots(
2309
+ data: ReportingControllerBackfillSnapshotsData
2310
+ ): CancelablePromise<ReportingControllerBackfillSnapshotsResponse> {
2311
+ return __request(OpenAPI, {
2312
+ method: 'POST',
2313
+ url: '/api/v1/{region}/reporting/snapshots/backfill',
2314
+ path: {
2315
+ region: data.region
2316
+ },
2317
+ body: data.requestBody,
2318
+ mediaType: 'application/json',
2319
+ errors: {
2320
+ 400: 'Invalid date format or range',
2321
+ 401: 'User not authenticated',
2322
+ 409: 'Backfill already in progress for this user'
2323
+ }
2324
+ });
2325
+ }
2326
+ }
2327
+
2328
+ export class UsersService {
2329
+ /**
2330
+ * Delete own user account
2331
+ * @param data The data for the request.
2332
+ * @param data.requestBody
2333
+ * @returns void User deleted successfully
2334
+ * @throws ApiError
2335
+ */
2336
+ public static userControllerDeleteOwnUser(
2337
+ data: UserControllerDeleteOwnUserData
2338
+ ): CancelablePromise<UserControllerDeleteOwnUserResponse> {
2339
+ return __request(OpenAPI, {
2340
+ method: 'DELETE',
2341
+ url: '/api/v1/users',
2342
+ body: data.requestBody,
2343
+ mediaType: 'application/json',
2344
+ errors: {
2345
+ 403: 'Invalid access token'
2346
+ }
2347
+ });
2348
+ }
2349
+
2350
+ /**
2351
+ * Get current authenticated user
2352
+ * @param data The data for the request.
2353
+ * @param data.acceptLanguage
2354
+ * @returns UserResponseDto User retrieved successfully
2355
+ * @throws ApiError
2356
+ */
2357
+ public static userControllerGetUser(
2358
+ data: UserControllerGetUserData
2359
+ ): CancelablePromise<UserControllerGetUserResponse> {
2360
+ return __request(OpenAPI, {
2361
+ method: 'GET',
2362
+ url: '/api/v1/users',
2363
+ headers: {
2364
+ 'accept-language': data.acceptLanguage
2365
+ }
2366
+ });
2367
+ }
2368
+
2369
+ /**
2370
+ * Sign up new user
2371
+ * Create a new account with auto-generated access token. Protected by Cloudflare Turnstile to prevent automated signup (when enabled).
2372
+ * @param data The data for the request.
2373
+ * @param data.requestBody
2374
+ * @returns SignupResponseDto User created successfully
2375
+ * @throws ApiError
2376
+ */
2377
+ public static userControllerSignupUser(
2378
+ data: UserControllerSignupUserData
2379
+ ): CancelablePromise<UserControllerSignupUserResponse> {
2380
+ return __request(OpenAPI, {
2381
+ method: 'POST',
2382
+ url: '/api/v1/users',
2383
+ body: data.requestBody,
2384
+ mediaType: 'application/json',
2385
+ errors: {
2386
+ 400: 'Invalid Turnstile token (when Turnstile is enabled)',
2387
+ 403: 'User signup is disabled'
2388
+ }
2389
+ });
2390
+ }
2391
+
2392
+ /**
2393
+ * Delete user by ID (admin only)
2394
+ * @param data The data for the request.
2395
+ * @param data.id User ID to delete
2396
+ * @returns void User deleted successfully
2397
+ * @throws ApiError
2398
+ */
2399
+ public static userControllerDeleteUser(
2400
+ data: UserControllerDeleteUserData
2401
+ ): CancelablePromise<UserControllerDeleteUserResponse> {
2402
+ return __request(OpenAPI, {
2403
+ method: 'DELETE',
2404
+ url: '/api/v1/users/{id}',
2405
+ path: {
2406
+ id: data.id
2407
+ },
2408
+ errors: {
2409
+ 403: 'Cannot delete own account or insufficient permissions'
2410
+ }
2411
+ });
2412
+ }
2413
+
2414
+ /**
2415
+ * Get user info by user ID
2416
+ * @param data The data for the request.
2417
+ * @param data.id User ID
2418
+ * @returns unknown User info retrieved successfully
2419
+ * @throws ApiError
2420
+ */
2421
+ public static userControllerGetUserInfo(
2422
+ data: UserControllerGetUserInfoData
2423
+ ): CancelablePromise<UserControllerGetUserInfoResponse> {
2424
+ return __request(OpenAPI, {
2425
+ method: 'GET',
2426
+ url: '/api/v1/users/{id}/info',
2427
+ path: {
2428
+ id: data.id
2429
+ },
2430
+ errors: {
2431
+ 403: 'Cannot access other user info without admin permission'
2432
+ }
2433
+ });
2434
+ }
2435
+
2436
+ /**
2437
+ * Update user settings
2438
+ * @param data The data for the request.
2439
+ * @param data.requestBody
2440
+ * @returns unknown Settings updated successfully
2441
+ * @throws ApiError
2442
+ */
2443
+ public static userControllerUpdateUserSetting(
2444
+ data: UserControllerUpdateUserSettingData
2445
+ ): CancelablePromise<UserControllerUpdateUserSettingResponse> {
2446
+ return __request(OpenAPI, {
2447
+ method: 'PUT',
2448
+ url: '/api/v1/users/setting',
2449
+ body: data.requestBody,
2450
+ mediaType: 'application/json',
2451
+ errors: {
2452
+ 403: 'Insufficient permissions'
2453
+ }
2454
+ });
2455
+ }
2456
+
2457
+ /**
2458
+ * Get all user settings paginated (admin only)
2459
+ * @param data The data for the request.
2460
+ * @param data.pageNo Page number
2461
+ * @param data.pageSize Page size
2462
+ * @returns unknown Settings list retrieved successfully
2463
+ * @throws ApiError
2464
+ */
2465
+ public static userControllerGetAllUserSettingsByPage(
2466
+ data: UserControllerGetAllUserSettingsByPageData
2467
+ ): CancelablePromise<UserControllerGetAllUserSettingsByPageResponse> {
2468
+ return __request(OpenAPI, {
2469
+ method: 'GET',
2470
+ url: '/api/v1/users/settings-by-page',
2471
+ query: {
2472
+ pageNo: data.pageNo,
2473
+ pageSize: data.pageSize
2474
+ }
2475
+ });
2476
+ }
2477
+
2478
+ /**
2479
+ * Get asset and liability summary for current user
2480
+ * @returns unknown Summary retrieved successfully
2481
+ * @throws ApiError
2482
+ */
2483
+ public static userControllerGetAssetLiabilitySummary(): CancelablePromise<UserControllerGetAssetLiabilitySummaryResponse> {
2484
+ return __request(OpenAPI, {
2485
+ method: 'GET',
2486
+ url: '/api/v1/users/asset-liability-summary'
2487
+ });
2488
+ }
2489
+ }
2490
+
2491
+ export class PropertiesService {
2492
+ /**
2493
+ * Get all system properties
2494
+ * @returns unknown Properties retrieved successfully
2495
+ * @throws ApiError
2496
+ */
2497
+ public static propertyControllerGetAll(): CancelablePromise<PropertyControllerGetAllResponse> {
2498
+ return __request(OpenAPI, {
2499
+ method: 'GET',
2500
+ url: '/api/v1/admin/properties',
2501
+ errors: {
2502
+ 401: 'Unauthorized',
2503
+ 403: 'Forbidden - insufficient permissions'
2504
+ }
2505
+ });
2506
+ }
2507
+
2508
+ /**
2509
+ * Get property by key
2510
+ * @param data The data for the request.
2511
+ * @param data.key Property key
2512
+ * @returns unknown Property retrieved successfully
2513
+ * @throws ApiError
2514
+ */
2515
+ public static propertyControllerGetByKey(
2516
+ data: PropertyControllerGetByKeyData
2517
+ ): CancelablePromise<PropertyControllerGetByKeyResponse> {
2518
+ return __request(OpenAPI, {
2519
+ method: 'GET',
2520
+ url: '/api/v1/admin/properties/{key}',
2521
+ path: {
2522
+ key: data.key
2523
+ },
2524
+ errors: {
2525
+ 401: 'Unauthorized',
2526
+ 403: 'Forbidden - insufficient permissions',
2527
+ 404: 'Property not found'
2528
+ }
2529
+ });
2530
+ }
2531
+
2532
+ /**
2533
+ * Update a system property
2534
+ * @param data The data for the request.
2535
+ * @param data.key Property key
2536
+ * @param data.requestBody
2537
+ * @returns unknown Property updated successfully
2538
+ * @throws ApiError
2539
+ */
2540
+ public static propertyControllerUpdate(
2541
+ data: PropertyControllerUpdateData
2542
+ ): CancelablePromise<PropertyControllerUpdateResponse> {
2543
+ return __request(OpenAPI, {
2544
+ method: 'PUT',
2545
+ url: '/api/v1/admin/properties/{key}',
2546
+ path: {
2547
+ key: data.key
2548
+ },
2549
+ body: data.requestBody,
2550
+ mediaType: 'application/json',
2551
+ errors: {
2552
+ 401: 'Unauthorized',
2553
+ 403: 'Forbidden - insufficient permissions'
2554
+ }
2555
+ });
2556
+ }
2557
+
2558
+ /**
2559
+ * Delete a system property
2560
+ * @param data The data for the request.
2561
+ * @param data.key Property key
2562
+ * @returns void Property deleted successfully
2563
+ * @throws ApiError
2564
+ */
2565
+ public static propertyControllerDelete(
2566
+ data: PropertyControllerDeleteData
2567
+ ): CancelablePromise<PropertyControllerDeleteResponse> {
2568
+ return __request(OpenAPI, {
2569
+ method: 'DELETE',
2570
+ url: '/api/v1/admin/properties/{key}',
2571
+ path: {
2572
+ key: data.key
2573
+ },
2574
+ errors: {
2575
+ 401: 'Unauthorized',
2576
+ 403: 'Forbidden - insufficient permissions',
2577
+ 404: 'Property not found'
2578
+ }
2579
+ });
2580
+ }
2581
+ }
2582
+
2583
+ export class BeanTransactionRulesService {
2584
+ /**
2585
+ * Create a new transaction rule (or upsert if upsertByPayee=true)
2586
+ * Creates a new rule. If upsertByPayee=true, updates existing rule matching payeeKeywords[0] instead of creating duplicate.
2587
+ * @param data The data for the request.
2588
+ * @param data.region Region code for tenant context
2589
+ * @param data.requestBody
2590
+ * @returns TransactionRuleResponseDto Rule updated successfully (upsert mode)
2591
+ * @throws ApiError
2592
+ */
2593
+ public static transactionRuleControllerCreate(
2594
+ data: TransactionRuleControllerCreateData
2595
+ ): CancelablePromise<TransactionRuleControllerCreateResponse> {
2596
+ return __request(OpenAPI, {
2597
+ method: 'POST',
2598
+ url: '/api/v1/{region}/bean/transaction-rules',
2599
+ path: {
2600
+ region: data.region
2601
+ },
2602
+ body: data.requestBody,
2603
+ mediaType: 'application/json',
2604
+ errors: {
2605
+ 400: 'Validation failed',
2606
+ 401: 'Unauthorized',
2607
+ 409: 'Resource conflict - another process is updating this rule'
2608
+ }
2609
+ });
2610
+ }
2611
+
2612
+ /**
2613
+ * Get all transaction rules for user
2614
+ * @param data The data for the request.
2615
+ * @param data.region Region code for tenant context
2616
+ * @param data.limit Max results per page (default: 20, max: 100)
2617
+ * @param data.offset Pagination offset (default: 0)
2618
+ * @param data.enabled Filter by enabled status
2619
+ * @param data.learningSource Filter by learning source. Omit this parameter or pass empty string to get manually created rules (learningSource is null in database).
2620
+ * @param data.autoApplyEnabled Filter by auto-apply status
2621
+ * @returns TransactionRuleListResponseDto List of rules
2622
+ * @throws ApiError
2623
+ */
2624
+ public static transactionRuleControllerList(
2625
+ data: TransactionRuleControllerListData
2626
+ ): CancelablePromise<TransactionRuleControllerListResponse> {
2627
+ return __request(OpenAPI, {
2628
+ method: 'GET',
2629
+ url: '/api/v1/{region}/bean/transaction-rules',
2630
+ path: {
2631
+ region: data.region
2632
+ },
2633
+ query: {
2634
+ limit: data.limit,
2635
+ offset: data.offset,
2636
+ enabled: data.enabled,
2637
+ learningSource: data.learningSource,
2638
+ autoApplyEnabled: data.autoApplyEnabled
2639
+ },
2640
+ errors: {
2641
+ 401: 'Unauthorized'
2642
+ }
2643
+ });
2644
+ }
2645
+
2646
+ /**
2647
+ * Validate transaction rule configuration
2648
+ * @param data The data for the request.
2649
+ * @param data.region Region code for tenant context
2650
+ * @param data.requestBody
2651
+ * @returns ValidateRuleResponseDto Validation result
2652
+ * @throws ApiError
2653
+ */
2654
+ public static transactionRuleControllerValidate(
2655
+ data: TransactionRuleControllerValidateData
2656
+ ): CancelablePromise<TransactionRuleControllerValidateResponse> {
2657
+ return __request(OpenAPI, {
2658
+ method: 'POST',
2659
+ url: '/api/v1/{region}/bean/transaction-rules/validate',
2660
+ path: {
2661
+ region: data.region
2662
+ },
2663
+ body: data.requestBody,
2664
+ mediaType: 'application/json',
2665
+ errors: {
2666
+ 400: 'Validation failed',
2667
+ 401: 'Unauthorized'
2668
+ }
2669
+ });
2670
+ }
2671
+
2672
+ /**
2673
+ * Bulk create transaction rules
2674
+ * @param data The data for the request.
2675
+ * @param data.region Region code for tenant context
2676
+ * @param data.requestBody
2677
+ * @returns BulkCreateRulesResponseDto Bulk create completed
2678
+ * @throws ApiError
2679
+ */
2680
+ public static transactionRuleControllerBulkCreate(
2681
+ data: TransactionRuleControllerBulkCreateData
2682
+ ): CancelablePromise<TransactionRuleControllerBulkCreateResponse> {
2683
+ return __request(OpenAPI, {
2684
+ method: 'POST',
2685
+ url: '/api/v1/{region}/bean/transaction-rules/bulk',
2686
+ path: {
2687
+ region: data.region
2688
+ },
2689
+ body: data.requestBody,
2690
+ mediaType: 'application/json',
2691
+ errors: {
2692
+ 400: 'Invalid bulk create data',
2693
+ 401: 'Unauthorized'
2694
+ }
2695
+ });
2696
+ }
2697
+
2698
+ /**
2699
+ * Export transaction rules
2700
+ * @param data The data for the request.
2701
+ * @param data.format Export format (currently only JSON supported)
2702
+ * @param data.region Region code for tenant context
2703
+ * @returns ExportRulesResponseDto Exported rules
2704
+ * @throws ApiError
2705
+ */
2706
+ public static transactionRuleControllerExport(
2707
+ data: TransactionRuleControllerExportData
2708
+ ): CancelablePromise<TransactionRuleControllerExportResponse> {
2709
+ return __request(OpenAPI, {
2710
+ method: 'GET',
2711
+ url: '/api/v1/{region}/bean/transaction-rules/export/{format}',
2712
+ path: {
2713
+ format: data.format,
2714
+ region: data.region
2715
+ },
2716
+ errors: {
2717
+ 400: 'Unsupported format',
2718
+ 401: 'Unauthorized'
2719
+ }
2720
+ });
2721
+ }
2722
+
2723
+ /**
2724
+ * Get transaction rule statistics
2725
+ * @param data The data for the request.
2726
+ * @param data.period Statistics time period
2727
+ * @param data.region Region code for tenant context
2728
+ * @returns RuleStatisticsResponseDto Rule statistics
2729
+ * @throws ApiError
2730
+ */
2731
+ public static transactionRuleControllerGetStatistics(
2732
+ data: TransactionRuleControllerGetStatisticsData
2733
+ ): CancelablePromise<TransactionRuleControllerGetStatisticsResponse> {
2734
+ return __request(OpenAPI, {
2735
+ method: 'GET',
2736
+ url: '/api/v1/{region}/bean/transaction-rules/statistics/{period}',
2737
+ path: {
2738
+ period: data.period,
2739
+ region: data.region
2740
+ },
2741
+ errors: {
2742
+ 401: 'Unauthorized'
2743
+ }
2744
+ });
2745
+ }
2746
+
2747
+ /**
2748
+ * Get transaction rule detail
2749
+ * @param data The data for the request.
2750
+ * @param data.ruleId Rule ID
2751
+ * @param data.region Region code for tenant context
2752
+ * @returns TransactionRuleResponseDto Rule details
2753
+ * @throws ApiError
2754
+ */
2755
+ public static transactionRuleControllerGetDetail(
2756
+ data: TransactionRuleControllerGetDetailData
2757
+ ): CancelablePromise<TransactionRuleControllerGetDetailResponse> {
2758
+ return __request(OpenAPI, {
2759
+ method: 'GET',
2760
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2761
+ path: {
2762
+ ruleId: data.ruleId,
2763
+ region: data.region
2764
+ },
2765
+ errors: {
2766
+ 401: 'Unauthorized',
2767
+ 403: 'Forbidden - not owner of rule',
2768
+ 404: 'Rule not found'
2769
+ }
2770
+ });
2771
+ }
2772
+
2773
+ /**
2774
+ * Update a transaction rule
2775
+ * @param data The data for the request.
2776
+ * @param data.ruleId Rule ID to update
2777
+ * @param data.region Region code for tenant context
2778
+ * @param data.requestBody
2779
+ * @returns TransactionRuleResponseDto Rule updated successfully
2780
+ * @throws ApiError
2781
+ */
2782
+ public static transactionRuleControllerUpdate(
2783
+ data: TransactionRuleControllerUpdateData
2784
+ ): CancelablePromise<TransactionRuleControllerUpdateResponse> {
2785
+ return __request(OpenAPI, {
2786
+ method: 'PUT',
2787
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2788
+ path: {
2789
+ ruleId: data.ruleId,
2790
+ region: data.region
2791
+ },
2792
+ body: data.requestBody,
2793
+ mediaType: 'application/json',
2794
+ errors: {
2795
+ 400: 'Validation failed',
2796
+ 401: 'Unauthorized',
2797
+ 403: 'Forbidden - not owner of rule',
2798
+ 404: 'Rule not found',
2799
+ 409: 'Resource conflict - rule is being modified by another process'
2800
+ }
2801
+ });
2802
+ }
2803
+
2804
+ /**
2805
+ * Delete a transaction rule
2806
+ * @param data The data for the request.
2807
+ * @param data.ruleId Rule ID to delete
2808
+ * @param data.region Region code for tenant context
2809
+ * @returns void Rule deleted successfully
2810
+ * @throws ApiError
2811
+ */
2812
+ public static transactionRuleControllerDelete(
2813
+ data: TransactionRuleControllerDeleteData
2814
+ ): CancelablePromise<TransactionRuleControllerDeleteResponse> {
2815
+ return __request(OpenAPI, {
2816
+ method: 'DELETE',
2817
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}',
2818
+ path: {
2819
+ ruleId: data.ruleId,
2820
+ region: data.region
2821
+ },
2822
+ errors: {
2823
+ 401: 'Unauthorized',
2824
+ 403: 'Forbidden - not owner of rule',
2825
+ 404: 'Rule not found',
2826
+ 409: 'Resource conflict - rule is being modified by another process'
2827
+ }
2828
+ });
2829
+ }
2830
+
2831
+ /**
2832
+ * Test rule matching
2833
+ * @param data The data for the request.
2834
+ * @param data.ruleId Rule ID to test
2835
+ * @param data.region Region code for tenant context
2836
+ * @param data.requestBody
2837
+ * @returns TestRuleResponseDto Test result
2838
+ * @throws ApiError
2839
+ */
2840
+ public static transactionRuleControllerTest(
2841
+ data: TransactionRuleControllerTestData
2842
+ ): CancelablePromise<TransactionRuleControllerTestResponse> {
2843
+ return __request(OpenAPI, {
2844
+ method: 'POST',
2845
+ url: '/api/v1/{region}/bean/transaction-rules/{ruleId}/test',
2846
+ path: {
2847
+ ruleId: data.ruleId,
2848
+ region: data.region
2849
+ },
2850
+ body: data.requestBody,
2851
+ mediaType: 'application/json',
2852
+ errors: {
2853
+ 401: 'Unauthorized',
2854
+ 403: 'Forbidden - not owner of rule',
2855
+ 404: 'Rule not found'
2856
+ }
2857
+ });
2858
+ }
2859
+ }
2860
+
2861
+ export class BeanCategoryCatalogService {
2862
+ /**
2863
+ * List category catalog for a region
2864
+ * Returns the region-scoped category slugs (expense/income/investment/banking/transfer/payment) for the NLP result picker. CN-exclusive payment instruments (huabei/baitiao) appear only under /cn.
2865
+ * @param data The data for the request.
2866
+ * @param data.region Region code for tenant context
2867
+ * @param data.scenario Filter by scenario
2868
+ * @param data.routeBearing Filter by routeBearing (entity-router route() consumes it)
2869
+ * @returns CategoryCatalogListResponseDto Category catalog retrieved successfully
2870
+ * @throws ApiError
2871
+ */
2872
+ public static categoryCatalogControllerList(
2873
+ data: CategoryCatalogControllerListData
2874
+ ): CancelablePromise<CategoryCatalogControllerListResponse> {
2875
+ return __request(OpenAPI, {
2876
+ method: 'GET',
2877
+ url: '/api/v1/{region}/bean/categories',
2878
+ path: {
2879
+ region: data.region
2880
+ },
2881
+ query: {
2882
+ scenario: data.scenario,
2883
+ routeBearing: data.routeBearing
2884
+ }
2885
+ });
2886
+ }
2887
+ }
2888
+
2889
+ export class LifeEventsService {
2890
+ /**
2891
+ * Create a new life event
2892
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2893
+ * @param data The data for the request.
2894
+ * @param data.region Region code for tenant context (decorative for life events)
2895
+ * @param data.requestBody
2896
+ * @returns EventResponseDto Life event created successfully
2897
+ * @throws ApiError
2898
+ */
2899
+ public static eventControllerCreate(
2900
+ data: EventControllerCreateData
2901
+ ): CancelablePromise<EventControllerCreateResponse> {
2902
+ return __request(OpenAPI, {
2903
+ method: 'POST',
2904
+ url: '/api/v1/{region}/bean/events',
2905
+ path: {
2906
+ region: data.region
2907
+ },
2908
+ body: data.requestBody,
2909
+ mediaType: 'application/json',
2910
+ errors: {
2911
+ 409: 'Life event already exists for this (userId, type, date) combination'
2912
+ }
2913
+ });
2914
+ }
2915
+
2916
+ /**
2917
+ * List user life events
2918
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2919
+ * @param data The data for the request.
2920
+ * @param data.region Region code for tenant context (decorative for life events)
2921
+ * @param data.type Filter by life event type (exact match)
2922
+ * @param data.q Search term for description (case-insensitive partial match)
2923
+ * @param data.from Filter life events from this date (ISO 8601 format)
2924
+ * @param data.to Filter life events to this date (ISO 8601 format)
2925
+ * @param data.page Page number for pagination (default: 1)
2926
+ * @param data.limit Number of items per page (default: 20, max: 100)
2927
+ * @returns EventListResponseDto Life events retrieved successfully
2928
+ * @throws ApiError
2929
+ */
2930
+ public static eventControllerFindAll(
2931
+ data: EventControllerFindAllData
2932
+ ): CancelablePromise<EventControllerFindAllResponse> {
2933
+ return __request(OpenAPI, {
2934
+ method: 'GET',
2935
+ url: '/api/v1/{region}/bean/events',
2936
+ path: {
2937
+ region: data.region
2938
+ },
2939
+ query: {
2940
+ type: data.type,
2941
+ q: data.q,
2942
+ from: data.from,
2943
+ to: data.to,
2944
+ page: data.page,
2945
+ limit: data.limit
2946
+ }
2947
+ });
2948
+ }
2949
+
2950
+ /**
2951
+ * Get life event by ID
2952
+ * Returns a single life event by its ID. Returns ETag header.
2953
+ * @param data The data for the request.
2954
+ * @param data.id Life event ID
2955
+ * @param data.region Region code for tenant context (decorative for life events)
2956
+ * @returns EventResponseDto Life event retrieved successfully
2957
+ * @throws ApiError
2958
+ */
2959
+ public static eventControllerFindOne(
2960
+ data: EventControllerFindOneData
2961
+ ): CancelablePromise<EventControllerFindOneResponse> {
2962
+ return __request(OpenAPI, {
2963
+ method: 'GET',
2964
+ url: '/api/v1/{region}/bean/events/{id}',
2965
+ path: {
2966
+ id: data.id,
2967
+ region: data.region
2968
+ },
2969
+ errors: {
2970
+ 404: 'Life event not found'
2971
+ }
2972
+ });
2973
+ }
2974
+
2975
+ /**
2976
+ * Update a life event
2977
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2978
+ * @param data The data for the request.
2979
+ * @param data.id Life event ID
2980
+ * @param data.region Region code for tenant context (decorative for life events)
2981
+ * @param data.requestBody
2982
+ * @returns EventResponseDto Life event updated successfully
2983
+ * @throws ApiError
2984
+ */
2985
+ public static eventControllerUpdate(
2986
+ data: EventControllerUpdateData
2987
+ ): CancelablePromise<EventControllerUpdateResponse> {
2988
+ return __request(OpenAPI, {
2989
+ method: 'PUT',
2990
+ url: '/api/v1/{region}/bean/events/{id}',
2991
+ path: {
2992
+ id: data.id,
2993
+ region: data.region
2994
+ },
2995
+ body: data.requestBody,
2996
+ mediaType: 'application/json',
2997
+ errors: {
2998
+ 400: 'If-Match header is not a valid ISO 8601 date',
2999
+ 404: 'Life event not found',
3000
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
3001
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
3002
+ }
3003
+ });
3004
+ }
3005
+
3006
+ /**
3007
+ * Delete a life event
3008
+ * Deletes a life event entry (hard delete). Returns 204.
3009
+ * @param data The data for the request.
3010
+ * @param data.id Life event ID
3011
+ * @param data.region Region code for tenant context (decorative for life events)
3012
+ * @returns void Life event deleted successfully
3013
+ * @throws ApiError
3014
+ */
3015
+ public static eventControllerDelete(
3016
+ data: EventControllerDeleteData
3017
+ ): CancelablePromise<EventControllerDeleteResponse> {
3018
+ return __request(OpenAPI, {
3019
+ method: 'DELETE',
3020
+ url: '/api/v1/{region}/bean/events/{id}',
3021
+ path: {
3022
+ id: data.id,
3023
+ region: data.region
3024
+ },
3025
+ errors: {
3026
+ 404: 'Life event not found'
3027
+ }
3028
+ });
3029
+ }
3030
+
3031
+ /**
3032
+ * Slice time-series by a life event (Phase 79)
3033
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
3034
+ * @param data The data for the request.
3035
+ * @param data.id Life event ID
3036
+ * @param data.accountPattern
3037
+ * @param data.granularity
3038
+ * @param data.region Region code for tenant context (decorative for life events)
3039
+ * @returns unknown Time-series sliced by the life event range
3040
+ * @throws ApiError
3041
+ */
3042
+ public static eventControllerGetSlice(
3043
+ data: EventControllerGetSliceData
3044
+ ): CancelablePromise<EventControllerGetSliceResponse> {
3045
+ return __request(OpenAPI, {
3046
+ method: 'GET',
3047
+ url: '/api/v1/{region}/bean/events/{id}/slice',
3048
+ path: {
3049
+ id: data.id,
3050
+ region: data.region
3051
+ },
3052
+ query: {
3053
+ accountPattern: data.accountPattern,
3054
+ granularity: data.granularity
3055
+ },
3056
+ errors: {
3057
+ 400: 'accountPattern query param is empty',
3058
+ 404: 'Life event not found'
3059
+ }
3060
+ });
3061
+ }
3062
+ }
3063
+
3064
+ export class OnboardingService {
3065
+ /**
3066
+ * Bootstrap core accounts + register asset accounts with opening balances (ADR-0113)
3067
+ * @param data The data for the request.
3068
+ * @param data.region Region code for tenant context
3069
+ * @param data.requestBody
3070
+ * @returns unknown Onboarding bootstrap result.
3071
+ * @throws ApiError
3072
+ */
3073
+ public static onboardingControllerBootstrap(
3074
+ data: OnboardingControllerBootstrapData
3075
+ ): CancelablePromise<OnboardingControllerBootstrapResponse> {
3076
+ return __request(OpenAPI, {
3077
+ method: 'POST',
3078
+ url: '/api/v1/{region}/bean/onboarding',
3079
+ path: {
3080
+ region: data.region
3081
+ },
3082
+ body: data.requestBody,
3083
+ mediaType: 'application/json',
3084
+ errors: {
3085
+ 422: 'Invalid region/account path/duplicate paths.'
3086
+ }
3087
+ });
3088
+ }
3089
+ }
3090
+
3091
+ export class BalanceReconciliationService {
3092
+ /**
3093
+ * Preview reconciliation (book vs actual)
3094
+ * Computes book balance, diff, Beancount-inferred tolerance, and suggested action without persisting.
3095
+ * @param data The data for the request.
3096
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3097
+ * @param data.requestBody
3098
+ * @returns ReconciliationComputeResultDto Reconciliation preview
3099
+ * @throws ApiError
3100
+ */
3101
+ public static reconciliationControllerCompute(
3102
+ data: ReconciliationControllerComputeData
3103
+ ): CancelablePromise<ReconciliationControllerComputeResponse> {
3104
+ return __request(OpenAPI, {
3105
+ method: 'POST',
3106
+ url: '/api/v1/{region}/bean/reconciliations',
3107
+ path: {
3108
+ region: data.region
3109
+ },
3110
+ body: data.requestBody,
3111
+ mediaType: 'application/json',
3112
+ errors: {
3113
+ 404: 'Account not found'
3114
+ }
3115
+ });
3116
+ }
3117
+
3118
+ /**
3119
+ * Record a balance assertion
3120
+ * Persists the reconciliation as a BeanBalance assertion (amount = actual, diffAmount = book − actual). Re-reconciling the same day/currency upserts.
3121
+ * @param data The data for the request.
3122
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3123
+ * @param data.requestBody
3124
+ * @returns ReconciliationRecordDto Balance assertion recorded
3125
+ * @throws ApiError
3126
+ */
3127
+ public static reconciliationControllerAssert(
3128
+ data: ReconciliationControllerAssertData
3129
+ ): CancelablePromise<ReconciliationControllerAssertResponse> {
3130
+ return __request(OpenAPI, {
3131
+ method: 'POST',
3132
+ url: '/api/v1/{region}/bean/reconciliations/assert',
3133
+ path: {
3134
+ region: data.region
3135
+ },
3136
+ body: data.requestBody,
3137
+ mediaType: 'application/json',
3138
+ errors: {
3139
+ 404: 'Account not found'
3140
+ }
3141
+ });
3142
+ }
3143
+
3144
+ /**
3145
+ * Generate a pad adjusting entry
3146
+ * When book is outside tolerance, synthesizes a Beancount pad transaction (flag P) booking the diff from source_account and persists it. Source defaults to Equity:Opening-Balances.
3147
+ * @param data The data for the request.
3148
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3149
+ * @param data.requestBody
3150
+ * @returns PadResultDto Pad adjusting entry generated
3151
+ * @throws ApiError
3152
+ */
3153
+ public static reconciliationControllerPad(
3154
+ data: ReconciliationControllerPadData
3155
+ ): CancelablePromise<ReconciliationControllerPadResponse> {
3156
+ return __request(OpenAPI, {
3157
+ method: 'POST',
3158
+ url: '/api/v1/{region}/bean/reconciliations/pad',
3159
+ path: {
3160
+ region: data.region
3161
+ },
3162
+ body: data.requestBody,
3163
+ mediaType: 'application/json',
3164
+ errors: {
3165
+ 400: 'Book already within tolerance — no pad needed',
3166
+ 404: 'Account not found'
3167
+ }
3168
+ });
3169
+ }
3170
+
3171
+ /**
3172
+ * List reconciliation history for an account
3173
+ * Returns recorded balance assertions (most recent first). The latest drives the account-detail "Last <date>" badge.
3174
+ * @param data The data for the request.
3175
+ * @param data.accountId BeanAccount id
3176
+ * @param data.region Region code for tenant context (decorative for reconciliation)
3177
+ * @returns ReconciliationRecordDto Reconciliation history
3178
+ * @throws ApiError
3179
+ */
3180
+ public static reconciliationControllerHistory(
3181
+ data: ReconciliationControllerHistoryData
3182
+ ): CancelablePromise<ReconciliationControllerHistoryResponse> {
3183
+ return __request(OpenAPI, {
3184
+ method: 'GET',
3185
+ url: '/api/v1/{region}/bean/accounts/{accountId}/reconciliations',
3186
+ path: {
3187
+ accountId: data.accountId,
3188
+ region: data.region
3189
+ },
3190
+ errors: {
3191
+ 404: 'Account not found'
3192
+ }
3193
+ });
3194
+ }
3195
+ }
3196
+
3197
+ export class BeanExportService {
3198
+ /**
3199
+ * Export Beancount ledger as ZIP
3200
+ * Export all user Beancount data as a ZIP file containing ledger.beancount and yearly files in community format.
3201
+ * @returns unknown
3202
+ * @throws ApiError
3203
+ */
3204
+ public static exportControllerExportBeancount(): CancelablePromise<ExportControllerExportBeancountResponse> {
3205
+ return __request(OpenAPI, {
3206
+ method: 'GET',
3207
+ url: '/api/v1/{region}/bean/export/beancount'
3208
+ });
3209
+ }
3210
+ }
3211
+
3212
+ export class BeanImportService {
3213
+ /**
3214
+ * Import a bill file
3215
+ * Upload and process a bill file (CSV, PDF, OFX, etc.). The system automatically identifies the file type, extracts transactions, validates them, and stores only validated transactions to the database. Maximum file size: 50MB. Only 1 import per user at a time (concurrent imports rejected with 429).
3216
+ * @param data The data for the request.
3217
+ * @param data.region Region code for tenant context
3218
+ * @param data.formData Bill file to import
3219
+ * @returns ImportResultDto File imported successfully
3220
+ * @throws ApiError
3221
+ */
3222
+ public static fileImportControllerImportFile(
3223
+ data: FileImportControllerImportFileData
3224
+ ): CancelablePromise<FileImportControllerImportFileResponse> {
3225
+ return __request(OpenAPI, {
3226
+ method: 'POST',
3227
+ url: '/api/v1/{region}/bean/import/file',
3228
+ path: {
3229
+ region: data.region
3230
+ },
3231
+ formData: data.formData,
3232
+ mediaType: 'multipart/form-data',
3233
+ errors: {
3234
+ 400: 'Bad request - file-format-unsupported or file-import-failed',
3235
+ 413: 'Payload too large - file exceeds 50MB limit',
3236
+ 429: 'Too many requests - user already has import in progress',
3237
+ 500: 'Internal server error - DATABASE_ERROR'
3238
+ }
3239
+ });
3240
+ }
3241
+
3242
+ /**
3243
+ * Identify file type
3244
+ * Upload a file to check if it can be processed by any registered importer. Does not perform actual import - useful for pre-validation. Uses user-specific importer configuration.
3245
+ * @param data The data for the request.
3246
+ * @param data.region Region code for tenant context
3247
+ * @param data.formData File to identify
3248
+ * @returns IdentifyResultDto File identification result
3249
+ * @throws ApiError
3250
+ */
3251
+ public static fileImportControllerIdentifyFile(
3252
+ data: FileImportControllerIdentifyFileData
3253
+ ): CancelablePromise<FileImportControllerIdentifyFileResponse> {
3254
+ return __request(OpenAPI, {
3255
+ method: 'POST',
3256
+ url: '/api/v1/{region}/bean/import/identify',
3257
+ path: {
3258
+ region: data.region
3259
+ },
3260
+ formData: data.formData,
3261
+ mediaType: 'multipart/form-data',
3262
+ errors: {
3263
+ 400: 'Bad request - No file uploaded'
3264
+ }
3265
+ });
3266
+ }
3267
+
3268
+ /**
3269
+ * Import a Beancount file in community format
3270
+ * Upload a .beancount file to import. The system parses community-format paths, converts to internal format using category metadata, auto-creates accounts, and imports transactions with deduplication. Maximum file size: 50MB. Only 1 import per user at a time.
3271
+ * @param data The data for the request.
3272
+ * @param data.region Region code for tenant context
3273
+ * @param data.formData Beancount file to import
3274
+ * @returns unknown Beancount file imported successfully
3275
+ * @throws ApiError
3276
+ */
3277
+ public static fileImportControllerImportBeancount(
3278
+ data: FileImportControllerImportBeancountData
3279
+ ): CancelablePromise<FileImportControllerImportBeancountResponse> {
3280
+ return __request(OpenAPI, {
3281
+ method: 'POST',
3282
+ url: '/api/v1/{region}/bean/import/beancount',
3283
+ path: {
3284
+ region: data.region
3285
+ },
3286
+ formData: data.formData,
3287
+ mediaType: 'multipart/form-data',
3288
+ errors: {
3289
+ 400: 'Bad request - invalid file or no file uploaded'
3290
+ }
3291
+ });
3292
+ }
3293
+
3294
+ /**
3295
+ * Get importer configuration
3296
+ * Returns the current configuration for the specified importer. Creates default configuration if none exists.
3297
+ * @param data The data for the request.
3298
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3299
+ * @param data.region Region code for tenant context
3300
+ * @returns ImporterConfigDto Configuration retrieved successfully
3301
+ * @throws ApiError
3302
+ */
3303
+ public static importerConfigControllerGetConfig(
3304
+ data: ImporterConfigControllerGetConfigData
3305
+ ): CancelablePromise<ImporterConfigControllerGetConfigResponse> {
3306
+ return __request(OpenAPI, {
3307
+ method: 'GET',
3308
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3309
+ path: {
3310
+ importerId: data.importerId,
3311
+ region: data.region
3312
+ },
3313
+ errors: {
3314
+ 400: 'Invalid input - Unsupported importer',
3315
+ 401: 'Unauthorized - Authentication required'
3316
+ }
3317
+ });
3318
+ }
3319
+
3320
+ /**
3321
+ * Update importer configuration
3322
+ * Updates the configuration for the specified importer. Partial updates are supported.
3323
+ * @param data The data for the request.
3324
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3325
+ * @param data.region Region code for tenant context
3326
+ * @param data.requestBody Partial configuration update. Only provided fields will be updated.
3327
+ * @returns ImporterConfigDto Configuration updated successfully
3328
+ * @throws ApiError
3329
+ */
3330
+ public static importerConfigControllerUpdateConfig(
3331
+ data: ImporterConfigControllerUpdateConfigData
3332
+ ): CancelablePromise<ImporterConfigControllerUpdateConfigResponse> {
3333
+ return __request(OpenAPI, {
3334
+ method: 'PUT',
3335
+ url: '/api/v1/{region}/bean/import/config/{importerId}',
3336
+ path: {
3337
+ importerId: data.importerId,
3338
+ region: data.region
3339
+ },
3340
+ body: data.requestBody,
3341
+ mediaType: 'application/json',
3342
+ errors: {
3343
+ 400: 'Invalid input - Validation failed',
3344
+ 404: 'Configuration not found'
3345
+ }
3346
+ });
3347
+ }
3348
+
3349
+ /**
3350
+ * Reset configuration to default
3351
+ * Resets the configuration for the specified importer to default values. This operation overwrites all existing configuration.
3352
+ * @param data The data for the request.
3353
+ * @param data.importerId Importer identifier. Supported importers: alipay, alipay-web, wechat, boc, boc-credit, ccb, cmb, cmbc, cmbc-credit, icbc, icbc-credit, hsbc-hk-credit, hsbc-hk-debit
3354
+ * @param data.region Region code for tenant context
3355
+ * @returns ImporterConfigDto Configuration reset successfully
3356
+ * @throws ApiError
3357
+ */
3358
+ public static importerConfigControllerResetConfig(
3359
+ data: ImporterConfigControllerResetConfigData
3360
+ ): CancelablePromise<ImporterConfigControllerResetConfigResponse> {
3361
+ return __request(OpenAPI, {
3362
+ method: 'POST',
3363
+ url: '/api/v1/{region}/bean/import/config/{importerId}/reset',
3364
+ path: {
3365
+ importerId: data.importerId,
3366
+ region: data.region
3367
+ },
3368
+ errors: {
3369
+ 400: 'Invalid input - Unsupported importer'
3370
+ }
3371
+ });
3372
+ }
3373
+ }
3374
+
3375
+ export class ProviderSyncService {
3376
+ /**
3377
+ * Sync transactions from financial data provider
3378
+ *
3379
+ * Accepts raw transactions from external financial data providers, transforms them to Beancount format, and processes them through the ingestion pipeline.
3380
+ *
3381
+ * **Supported Providers:**
3382
+ * - **plaid**: Plaid API (US, Canada, Europe)
3383
+ * - **teller**: Teller API (US)
3384
+ * - **truelayer**: TrueLayer Open Banking (UK, Europe)
3385
+ * - **gocardless**: GoCardless Bank Account Data (Europe)
3386
+ * - **simplefin**: SimpleFIN (Self-hosted)
3387
+ * - **yodlee**: Yodlee (Global)
3388
+ * - **beancount-direct**: Beancount format transactions
3389
+ * - **parsed-bill**: Client-side parsed bill transactions
3390
+ *
3391
+ * **Processing Flow:**
3392
+ * 1. Transform raw data via provider adapter
3393
+ * 2. Validate transaction format
3394
+ * 3. Deduplicate using originalId
3395
+ * 4. Classify using rule engine
3396
+ * 5. Route low-confidence to Review Center
3397
+ * 6. Persist validated transactions
3398
+ *
3399
+ * @param data The data for the request.
3400
+ * @param data.providerName Provider name
3401
+ * @param data.region Region code for tenant context
3402
+ * @param data.requestBody
3403
+ * @returns ProviderSyncResponseDto Sync completed successfully
3404
+ * @throws ApiError
3405
+ */
3406
+ public static providerSyncControllerSync(
3407
+ data: ProviderSyncControllerSyncData
3408
+ ): CancelablePromise<ProviderSyncControllerSyncResponse> {
3409
+ return __request(OpenAPI, {
3410
+ method: 'POST',
3411
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/sync',
3412
+ path: {
3413
+ providerName: data.providerName,
3414
+ region: data.region
3415
+ },
3416
+ body: data.requestBody,
3417
+ mediaType: 'application/json',
3418
+ errors: {
3419
+ 400: 'Invalid request data',
3420
+ 401: 'Missing or invalid authentication',
3421
+ 404: 'Provider not supported'
3422
+ }
3423
+ });
3424
+ }
3425
+
3426
+ /**
3427
+ * Get supported providers
3428
+ * Returns a list of all providers supported by the sync endpoint.
3429
+ * @param data The data for the request.
3430
+ * @param data.region Region code for tenant context
3431
+ * @returns SupportedProvidersResponseDto List of supported providers
3432
+ * @throws ApiError
3433
+ */
3434
+ public static providerSyncControllerGetSupportedProviders(
3435
+ data: ProviderSyncControllerGetSupportedProvidersData
3436
+ ): CancelablePromise<ProviderSyncControllerGetSupportedProvidersResponse> {
3437
+ return __request(OpenAPI, {
3438
+ method: 'GET',
3439
+ url: '/api/v1/{region}/bean/import/provider/supported',
3440
+ path: {
3441
+ region: data.region
3442
+ },
3443
+ errors: {
3444
+ 401: 'Missing or invalid authentication'
3445
+ }
3446
+ });
3447
+ }
3448
+
3449
+ /**
3450
+ * Check if provider is supported
3451
+ * Returns whether a specific provider is supported.
3452
+ * @param data The data for the request.
3453
+ * @param data.providerName Provider name to check
3454
+ * @param data.region Region code for tenant context
3455
+ * @returns unknown Provider support status
3456
+ * @throws ApiError
3457
+ */
3458
+ public static providerSyncControllerIsProviderSupported(
3459
+ data: ProviderSyncControllerIsProviderSupportedData
3460
+ ): CancelablePromise<ProviderSyncControllerIsProviderSupportedResponse> {
3461
+ return __request(OpenAPI, {
3462
+ method: 'GET',
3463
+ url: '/api/v1/{region}/bean/import/provider/{providerName}/supported',
3464
+ path: {
3465
+ providerName: data.providerName,
3466
+ region: data.region
3467
+ },
3468
+ errors: {
3469
+ 401: 'Missing or invalid authentication'
3470
+ }
3471
+ });
3472
+ }
3473
+ }
3474
+
3475
+ export class ExternalAccountLinksService {
3476
+ /**
3477
+ * Create an external account → BeanAccount mapping (ADR-0113)
3478
+ * @param data The data for the request.
3479
+ * @param data.region Region code for tenant context
3480
+ * @param data.requestBody
3481
+ * @returns ExternalAccountLinkResponseDto Link created.
3482
+ * @throws ApiError
3483
+ */
3484
+ public static externalAccountLinkControllerCreate(
3485
+ data: ExternalAccountLinkControllerCreateData
3486
+ ): CancelablePromise<ExternalAccountLinkControllerCreateResponse> {
3487
+ return __request(OpenAPI, {
3488
+ method: 'POST',
3489
+ url: '/api/v1/{region}/bean/external-account-links',
3490
+ path: {
3491
+ region: data.region
3492
+ },
3493
+ body: data.requestBody,
3494
+ mediaType: 'application/json',
3495
+ errors: {
3496
+ 422: 'beanAccountId not owned, or an active link already exists.'
3497
+ }
3498
+ });
3499
+ }
3500
+
3501
+ /**
3502
+ * List the user's active external account links
3503
+ * @param data The data for the request.
3504
+ * @param data.provider
3505
+ * @param data.region Region code for tenant context
3506
+ * @returns ExternalAccountLinkListResponseDto Links retrieved.
3507
+ * @throws ApiError
3508
+ */
3509
+ public static externalAccountLinkControllerFindAll(
3510
+ data: ExternalAccountLinkControllerFindAllData
3511
+ ): CancelablePromise<ExternalAccountLinkControllerFindAllResponse> {
3512
+ return __request(OpenAPI, {
3513
+ method: 'GET',
3514
+ url: '/api/v1/{region}/bean/external-account-links',
3515
+ path: {
3516
+ region: data.region
3517
+ },
3518
+ query: {
3519
+ provider: data.provider
3520
+ }
3521
+ });
3522
+ }
3523
+
3524
+ /**
3525
+ * Get a single external account link
3526
+ * @param data The data for the request.
3527
+ * @param data.id
3528
+ * @param data.region Region code for tenant context
3529
+ * @returns ExternalAccountLinkResponseDto Link retrieved.
3530
+ * @throws ApiError
3531
+ */
3532
+ public static externalAccountLinkControllerFindOne(
3533
+ data: ExternalAccountLinkControllerFindOneData
3534
+ ): CancelablePromise<ExternalAccountLinkControllerFindOneResponse> {
3535
+ return __request(OpenAPI, {
3536
+ method: 'GET',
3537
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3538
+ path: {
3539
+ id: data.id,
3540
+ region: data.region
3541
+ },
3542
+ errors: {
3543
+ 422: 'Link not found or not owned by the user.'
3544
+ }
3545
+ });
3546
+ }
3547
+
3548
+ /**
3549
+ * Soft-delete (disconnect) an external account link
3550
+ * @param data The data for the request.
3551
+ * @param data.id
3552
+ * @param data.region Region code for tenant context
3553
+ * @returns void Link soft-deleted; historical transactions are unaffected.
3554
+ * @throws ApiError
3555
+ */
3556
+ public static externalAccountLinkControllerRemove(
3557
+ data: ExternalAccountLinkControllerRemoveData
3558
+ ): CancelablePromise<ExternalAccountLinkControllerRemoveResponse> {
3559
+ return __request(OpenAPI, {
3560
+ method: 'DELETE',
3561
+ url: '/api/v1/{region}/bean/external-account-links/{id}',
3562
+ path: {
3563
+ id: data.id,
3564
+ region: data.region
3565
+ }
3566
+ });
3567
+ }
3568
+ }
3569
+
3570
+ export class ImportTelemetryService {
3571
+ /**
3572
+ * Receive anonymous parser failure telemetry
3573
+ * @param data The data for the request.
3574
+ * @param data.region Region code for tenant context
3575
+ * @param data.requestBody
3576
+ * @returns unknown Telemetry report received
3577
+ * @throws ApiError
3578
+ */
3579
+ public static telemetryControllerReportTelemetry(
3580
+ data: TelemetryControllerReportTelemetryData
3581
+ ): CancelablePromise<TelemetryControllerReportTelemetryResponse> {
3582
+ return __request(OpenAPI, {
3583
+ method: 'POST',
3584
+ url: '/api/v1/{region}/bean/import/parser-telemetry',
3585
+ path: {
3586
+ region: data.region
3587
+ },
3588
+ body: data.requestBody,
3589
+ mediaType: 'application/json',
3590
+ errors: {
3591
+ 401: 'Unauthorized'
3592
+ }
3593
+ });
3594
+ }
3595
+
3596
+ /**
3597
+ * Receive anonymous zero-hit coverage miss report
3598
+ * @param data The data for the request.
3599
+ * @param data.region Region code for tenant context
3600
+ * @param data.requestBody
3601
+ * @returns unknown Coverage miss report received
3602
+ * @throws ApiError
3603
+ */
3604
+ public static telemetryControllerReportCoverageMiss(
3605
+ data: TelemetryControllerReportCoverageMissData
3606
+ ): CancelablePromise<TelemetryControllerReportCoverageMissResponse> {
3607
+ return __request(OpenAPI, {
3608
+ method: 'POST',
3609
+ url: '/api/v1/{region}/bean/import/parser-coverage-miss',
3610
+ path: {
3611
+ region: data.region
3612
+ },
3613
+ body: data.requestBody,
3614
+ mediaType: 'application/json',
3615
+ errors: {
3616
+ 401: 'Unauthorized'
3617
+ }
3618
+ });
3619
+ }
3620
+
3621
+ /**
3622
+ * Coverage metrics (uncovered format aggregation)
3623
+ * @param data The data for the request.
3624
+ * @param data.region Region code for tenant context
3625
+ * @param data.topN Top-N uncovered formats (default 10)
3626
+ * @returns unknown Coverage metrics
3627
+ * @throws ApiError
3628
+ */
3629
+ public static telemetryControllerGetCoverageMetrics(
3630
+ data: TelemetryControllerGetCoverageMetricsData
3631
+ ): CancelablePromise<TelemetryControllerGetCoverageMetricsResponse> {
3632
+ return __request(OpenAPI, {
3633
+ method: 'GET',
3634
+ url: '/api/v1/{region}/bean/import/parser-coverage-metrics',
3635
+ path: {
3636
+ region: data.region
3637
+ },
3638
+ query: {
3639
+ topN: data.topN
3640
+ }
3641
+ });
3642
+ }
3643
+ }
3644
+
3645
+ export class BeanNlpService {
3646
+ /**
3647
+ * Process natural language input
3648
+ * Parse natural language text (Chinese/English) describing a transaction. Supports multi-turn dialogue for collecting missing information. When confidence < 0.75, returns "confirm" action requiring user verification. User can reply with confirmation words (确认/yes/ok) or provide corrections. Examples: "yesterday Starbucks spent 35 yuan", "today lunch 28 yuan", "spent $50 at Walmart"
3649
+ * @param data The data for the request.
3650
+ * @param data.region Region code for tenant context
3651
+ * @param data.requestBody Natural language transaction input with optional session ID
3652
+ * @returns NlpResponseDto NLP processing result - either created transaction or asking for more info
3653
+ * @throws ApiError
3654
+ */
3655
+ public static nlpControllerProcessNaturalLanguage(
3656
+ data: NlpControllerProcessNaturalLanguageData
3657
+ ): CancelablePromise<NlpControllerProcessNaturalLanguageResponse> {
3658
+ return __request(OpenAPI, {
3659
+ method: 'POST',
3660
+ url: '/api/v1/{region}/bean/nlp/process',
3661
+ path: {
3662
+ region: data.region
3663
+ },
3664
+ body: data.requestBody,
3665
+ mediaType: 'application/json',
3666
+ errors: {
3667
+ 400: 'Invalid input',
3668
+ 401: 'Unauthorized'
3669
+ }
3670
+ });
3671
+ }
3672
+
3673
+ /**
3674
+ * Clear dialogue session
3675
+ * Clear the current NLP dialogue session. Use this to cancel an ongoing multi-turn dialogue.
3676
+ * @param data The data for the request.
3677
+ * @param data.region Region code for tenant context
3678
+ * @param data.sessionId Specific session ID to clear (defaults to user session)
3679
+ * @returns void Session cleared successfully
3680
+ * @throws ApiError
3681
+ */
3682
+ public static nlpControllerClearSession(
3683
+ data: NlpControllerClearSessionData
3684
+ ): CancelablePromise<NlpControllerClearSessionResponse> {
3685
+ return __request(OpenAPI, {
3686
+ method: 'DELETE',
3687
+ url: '/api/v1/{region}/bean/nlp/session',
3688
+ path: {
3689
+ region: data.region
3690
+ },
3691
+ query: {
3692
+ sessionId: data.sessionId
3693
+ },
3694
+ errors: {
3695
+ 401: 'Unauthorized'
3696
+ }
3697
+ });
3698
+ }
3699
+
3700
+ /**
3701
+ * Get current session state
3702
+ * Get the current NLP dialogue session state. Useful for debugging and displaying session context in UI.
3703
+ * @param data The data for the request.
3704
+ * @param data.region Region code for tenant context
3705
+ * @param data.sessionId Specific session ID to get (defaults to user session)
3706
+ * @returns unknown Current session state (or null if no active session)
3707
+ * @throws ApiError
3708
+ */
3709
+ public static nlpControllerGetSession(
3710
+ data: NlpControllerGetSessionData
3711
+ ): CancelablePromise<NlpControllerGetSessionResponse> {
3712
+ return __request(OpenAPI, {
3713
+ method: 'GET',
3714
+ url: '/api/v1/{region}/bean/nlp/session',
3715
+ path: {
3716
+ region: data.region
3717
+ },
3718
+ query: {
3719
+ sessionId: data.sessionId
3720
+ },
3721
+ errors: {
3722
+ 401: 'Unauthorized'
3723
+ }
3724
+ });
3725
+ }
3726
+ }
3727
+
3728
+ export class BeanPlatformsService {
3729
+ /**
3730
+ * Get all platforms with statistics
3731
+ * @returns unknown List of platforms with binding and account counts
3732
+ * @throws ApiError
3733
+ */
3734
+ public static platformControllerFindAll(): CancelablePromise<PlatformControllerFindAllResponse> {
3735
+ return __request(OpenAPI, {
3736
+ method: 'GET',
3737
+ url: '/api/v1/bean/platforms'
3738
+ });
3739
+ }
3740
+
3741
+ /**
3742
+ * Create a new platform
3743
+ * @param data The data for the request.
3744
+ * @param data.requestBody
3745
+ * @returns unknown Platform created successfully
3746
+ * @throws ApiError
3747
+ */
3748
+ public static platformControllerCreate(
3749
+ data: PlatformControllerCreateData
3750
+ ): CancelablePromise<PlatformControllerCreateResponse> {
3751
+ return __request(OpenAPI, {
3752
+ method: 'POST',
3753
+ url: '/api/v1/bean/platforms',
3754
+ body: data.requestBody,
3755
+ mediaType: 'application/json',
3756
+ errors: {
3757
+ 409: 'Platform already exists'
3758
+ }
3759
+ });
3760
+ }
3761
+
3762
+ /**
3763
+ * Get platform list for current user
3764
+ * @param data The data for the request.
3765
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-type-bucket ordering (local-region platforms first). Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3766
+ * @returns PlatformListItemDto List of platforms with user binding status
3767
+ * @throws ApiError
3768
+ */
3769
+ public static platformControllerGetPlatformList(
3770
+ data: PlatformControllerGetPlatformListData = {}
3771
+ ): CancelablePromise<PlatformControllerGetPlatformListResponse> {
3772
+ return __request(OpenAPI, {
3773
+ method: 'GET',
3774
+ url: '/api/v1/bean/platforms/list',
3775
+ query: {
3776
+ region: data.region
3777
+ }
3778
+ });
3779
+ }
3780
+
3781
+ /**
3782
+ * Match platforms by name or alias
3783
+ * @param data The data for the request.
3784
+ * @param data.q Search query — Chinese name, English name, or abbreviation
3785
+ * @param data.region Region code (ISO 3166-1 alpha-2) that biases within-tier ordering (local-region platforms first); also the intended categoryOverrides key. Case-insensitive — stored/compared UPPERCASE ("cn" == "CN").
3786
+ * @returns PlatformMatchResponseDto Matching platforms with overall match type and truncation flag
3787
+ * @throws ApiError
3788
+ */
3789
+ public static platformControllerMatchPlatforms(
3790
+ data: PlatformControllerMatchPlatformsData
3791
+ ): CancelablePromise<PlatformControllerMatchPlatformsResponse> {
3792
+ return __request(OpenAPI, {
3793
+ method: 'GET',
3794
+ url: '/api/v1/bean/platforms/match',
3795
+ query: {
3796
+ q: data.q,
3797
+ region: data.region
3798
+ }
3799
+ });
3800
+ }
3801
+
3802
+ /**
3803
+ * Update a platform
3804
+ * @param data The data for the request.
3805
+ * @param data.id Platform ID
3806
+ * @param data.requestBody
3807
+ * @returns unknown Platform updated successfully
3808
+ * @throws ApiError
3809
+ */
3810
+ public static platformControllerUpdate(
3811
+ data: PlatformControllerUpdateData
3812
+ ): CancelablePromise<PlatformControllerUpdateResponse> {
3813
+ return __request(OpenAPI, {
3814
+ method: 'PUT',
3815
+ url: '/api/v1/bean/platforms/{id}',
3816
+ path: {
3817
+ id: data.id
3818
+ },
3819
+ body: data.requestBody,
3820
+ mediaType: 'application/json',
3821
+ errors: {
3822
+ 404: 'Platform not found'
3823
+ }
3824
+ });
3825
+ }
3826
+
3827
+ /**
3828
+ * Delete a platform
3829
+ * @param data The data for the request.
3830
+ * @param data.id Platform ID
3831
+ * @returns void Platform deleted successfully
3832
+ * @throws ApiError
3833
+ */
3834
+ public static platformControllerDelete(
3835
+ data: PlatformControllerDeleteData
3836
+ ): CancelablePromise<PlatformControllerDeleteResponse> {
3837
+ return __request(OpenAPI, {
3838
+ method: 'DELETE',
3839
+ url: '/api/v1/bean/platforms/{id}',
3840
+ path: {
3841
+ id: data.id
3842
+ },
3843
+ errors: {
3844
+ 404: 'Platform not found'
3845
+ }
3846
+ });
3847
+ }
3848
+ }
3849
+
3850
+ export class DashboardService {
3851
+ /**
3852
+ * Get net worth overview
3853
+ * Returns total net worth with breakdown of assets and liabilities
3854
+ * @param data The data for the request.
3855
+ * @param data.region Region code for tenant context
3856
+ * @param data.date Date for balance calculation (ISO 8601 format)
3857
+ * @returns NetWorthResponseDto Net worth retrieved successfully
3858
+ * @throws ApiError
3859
+ */
3860
+ public static dashboardControllerGetNetWorth(
3861
+ data: DashboardControllerGetNetWorthData
3862
+ ): CancelablePromise<DashboardControllerGetNetWorthResponse> {
3863
+ return __request(OpenAPI, {
3864
+ method: 'GET',
3865
+ url: '/api/v1/{region}/dashboard/net-worth',
3866
+ path: {
3867
+ region: data.region
3868
+ },
3869
+ query: {
3870
+ date: data.date
3871
+ },
3872
+ errors: {
3873
+ 401: 'User not authenticated'
3874
+ }
3875
+ });
3876
+ }
3877
+
3878
+ /**
3879
+ * Get accounts grouped by platform
3880
+ * Returns accounts with balances grouped by financial platform
3881
+ * @param data The data for the request.
3882
+ * @param data.region Region code for tenant context
3883
+ * @param data.groupBy Grouping strategy
3884
+ * @param data.date Date for balance calculation (ISO 8601 format)
3885
+ * @param data.accountId Scope to a single account (only valid with groupBy=holdingAssetClass, ADR-0105 §6)
3886
+ * @returns unknown Accounts retrieved successfully. Response type depends on groupBy parameter.
3887
+ * @throws ApiError
3888
+ */
3889
+ public static dashboardControllerGetAccounts(
3890
+ data: DashboardControllerGetAccountsData
3891
+ ): CancelablePromise<DashboardControllerGetAccountsResponse> {
3892
+ return __request(OpenAPI, {
3893
+ method: 'GET',
3894
+ url: '/api/v1/{region}/dashboard/accounts',
3895
+ path: {
3896
+ region: data.region
3897
+ },
3898
+ query: {
3899
+ groupBy: data.groupBy,
3900
+ date: data.date,
3901
+ accountId: data.accountId
3902
+ },
3903
+ errors: {
3904
+ 401: 'User not authenticated'
3905
+ }
3906
+ });
3907
+ }
3908
+
3909
+ /**
3910
+ * Get cash flow summary
3911
+ * Returns income, expenses, and savings for a monthly period
3912
+ * @param data The data for the request.
3913
+ * @param data.period Period in YYYY-MM format
3914
+ * @param data.region Region code for tenant context
3915
+ * @returns CashFlowResponseDto Cash flow retrieved successfully
3916
+ * @throws ApiError
3917
+ */
3918
+ public static dashboardControllerGetCashFlow(
3919
+ data: DashboardControllerGetCashFlowData
3920
+ ): CancelablePromise<DashboardControllerGetCashFlowResponse> {
3921
+ return __request(OpenAPI, {
3922
+ method: 'GET',
3923
+ url: '/api/v1/{region}/dashboard/cash-flow',
3924
+ path: {
3925
+ region: data.region
3926
+ },
3927
+ query: {
3928
+ period: data.period
3929
+ },
3930
+ errors: {
3931
+ 400: 'Invalid period format',
3932
+ 401: 'User not authenticated'
3933
+ }
3934
+ });
3935
+ }
3936
+
3937
+ /**
3938
+ * Get expenses/income grouped by functional category
3939
+ * Returns amounts pre-aggregated by functional category (account-path Group segment) with server-side multi-currency conversion. flow=expense (default) aggregates ^Expenses: accounts; flow=income aggregates ^Income: accounts (issue #518)
3940
+ * @param data The data for the request.
3941
+ * @param data.region Region code for tenant context
3942
+ * @param data.groupBy Grouping strategy
3943
+ * @param data.period Time window (1m = current calendar month)
3944
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3945
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3946
+ * @throws ApiError
3947
+ */
3948
+ public static dashboardControllerGetExpenses(
3949
+ data: DashboardControllerGetExpensesData
3950
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3951
+ return __request(OpenAPI, {
3952
+ method: 'GET',
3953
+ url: '/api/v1/{region}/dashboard/expenses',
3954
+ path: {
3955
+ region: data.region
3956
+ },
3957
+ query: {
3958
+ groupBy: data.groupBy,
3959
+ period: data.period,
3960
+ flow: data.flow
3961
+ },
3962
+ errors: {
3963
+ 400: 'Invalid groupBy or period',
3964
+ 401: 'User not authenticated'
3965
+ }
3966
+ });
3967
+ }
3968
+ }
3969
+
3970
+ export class InvestmentService {
3971
+ /**
3972
+ * Get per-holding unrealized + realized P&L
3973
+ * Average-cost unrealized P&L per account × commodity, plus cumulative realized P&L on sold lots (method = FIFO | average, default average).
3974
+ * @param data The data for the request.
3975
+ * @param data.region Region code for tenant context
3976
+ * @param data.asOf As-of date (ISO 8601), defaults to today
3977
+ * @param data.accountId Scope to a single account
3978
+ * @param data.method Realized-P&L lot-matching method (default average). Does not affect the average-cost unrealized basis.
3979
+ * @returns HoldingPnlResponseDto Holding P&L retrieved successfully
3980
+ * @throws ApiError
3981
+ */
3982
+ public static holdingPnlControllerGetHoldingPnl(
3983
+ data: HoldingPnlControllerGetHoldingPnlData
3984
+ ): CancelablePromise<HoldingPnlControllerGetHoldingPnlResponse> {
3985
+ return __request(OpenAPI, {
3986
+ method: 'GET',
3987
+ url: '/api/v1/{region}/investment/holdings/pnl',
3988
+ path: {
3989
+ region: data.region
3990
+ },
3991
+ query: {
3992
+ asOf: data.asOf,
3993
+ accountId: data.accountId,
3994
+ method: data.method
3995
+ },
3996
+ errors: {
3997
+ 400: 'Invalid asOf format/value/future date, invalid accountId format, or unsupported method',
3998
+ 401: 'User not authenticated'
3999
+ }
4000
+ });
4001
+ }
4002
+ }
4003
+
4004
+ export class ApiKeysService {
4005
+ /**
4006
+ * Create API key
4007
+ * Generates a new API key for the authenticated user
4008
+ * @returns unknown API key created successfully
4009
+ * @throws ApiError
4010
+ */
4011
+ public static apiKeysControllerCreateApiKey(): CancelablePromise<ApiKeysControllerCreateApiKeyResponse> {
4012
+ return __request(OpenAPI, {
4013
+ method: 'POST',
4014
+ url: '/api/v1/auth/api-keys',
4015
+ errors: {
4016
+ 403: 'Insufficient permissions to create API key'
4017
+ }
4018
+ });
4019
+ }
4020
+ }
4021
+
4022
+ export class AuthService {
4023
+ /**
4024
+ * Anonymous login with access token
4025
+ * @param data The data for the request.
4026
+ * @param data.requestBody
4027
+ * @returns AnonymousLoginResponseDto Login successful
4028
+ * @throws ApiError
4029
+ */
4030
+ public static authControllerAccessTokenLogin(
4031
+ data: AuthControllerAccessTokenLoginData
4032
+ ): CancelablePromise<AuthControllerAccessTokenLoginResponse> {
4033
+ return __request(OpenAPI, {
4034
+ method: 'POST',
4035
+ url: '/api/v1/auth/sessions/anonymous',
4036
+ body: data.requestBody,
4037
+ mediaType: 'application/json',
4038
+ errors: {
4039
+ 401: 'Invalid access token'
4040
+ }
4041
+ });
4042
+ }
4043
+ }
4044
+
4045
+ export class DefaultService {
4046
+ /**
4047
+ * @returns unknown
4048
+ * @throws ApiError
4049
+ */
4050
+ public static cacheControllerFlushCache(): CancelablePromise<CacheControllerFlushCacheResponse> {
4051
+ return __request(OpenAPI, {
4052
+ method: 'POST',
4053
+ url: '/api/v1/cache/flush'
4054
+ });
4055
+ }
4056
+ }
4057
+
4058
+ export class ExchangeRateService {
4059
+ /**
4060
+ * Get exchange rate for currency pair
4061
+ * Retrieves historical exchange rate for a specific date and currency pair
4062
+ * @param data The data for the request.
4063
+ * @param data.symbol Currency pair symbol (e.g., USDCNY, EURUSD)
4064
+ * @param data.dateString Date in ISO format (YYYY-MM-DD)
4065
+ * @returns unknown Exchange rate retrieved successfully
4066
+ * @throws ApiError
4067
+ */
4068
+ public static exchangeRateControllerGetExchangeRate(
4069
+ data: ExchangeRateControllerGetExchangeRateData
4070
+ ): CancelablePromise<ExchangeRateControllerGetExchangeRateResponse> {
4071
+ return __request(OpenAPI, {
4072
+ method: 'GET',
4073
+ url: '/api/v1/market/exchange-rates/{symbol}/{dateString}',
4074
+ path: {
4075
+ symbol: data.symbol,
4076
+ dateString: data.dateString
4077
+ },
4078
+ errors: {
4079
+ 404: 'Exchange rate not found for the specified currency pair and date'
4080
+ }
4081
+ });
4082
+ }
4083
+ }
4084
+
4085
+ export class HealthService {
4086
+ /**
4087
+ * Basic health check for K8s/load balancer probes
4088
+ * @returns unknown Service is healthy
4089
+ * @throws ApiError
4090
+ */
4091
+ public static healthControllerGetHealth(): CancelablePromise<HealthControllerGetHealthResponse> {
4092
+ return __request(OpenAPI, {
4093
+ method: 'GET',
4094
+ url: '/api/v1/health',
4095
+ errors: {
4096
+ 503: 'Service unavailable'
4097
+ }
4098
+ });
4099
+ }
4100
+
4101
+ /**
4102
+ * Check database connection health
4103
+ * @returns unknown Database is healthy
4104
+ * @throws ApiError
4105
+ */
4106
+ public static healthControllerCheckDatabase(): CancelablePromise<HealthControllerCheckDatabaseResponse> {
4107
+ return __request(OpenAPI, {
4108
+ method: 'GET',
4109
+ url: '/api/v1/health/database',
4110
+ errors: {
4111
+ 503: 'Database unavailable'
4112
+ }
4113
+ });
4114
+ }
4115
+
4116
+ /**
4117
+ * Check OpenBB schema status
4118
+ * @returns unknown OpenBB status
4119
+ * @throws ApiError
4120
+ */
4121
+ public static healthControllerCheckOpenBb(): CancelablePromise<HealthControllerCheckOpenBbResponse> {
4122
+ return __request(OpenAPI, {
4123
+ method: 'GET',
4124
+ url: '/api/v1/health/openbb',
4125
+ errors: {
4126
+ 503: 'OpenBB unavailable'
4127
+ }
4128
+ });
4129
+ }
4130
+
4131
+ /**
4132
+ * Check Redis connection health
4133
+ * @returns unknown Redis is healthy
4134
+ * @throws ApiError
4135
+ */
4136
+ public static healthControllerCheckRedis(): CancelablePromise<HealthControllerCheckRedisResponse> {
4137
+ return __request(OpenAPI, {
4138
+ method: 'GET',
4139
+ url: '/api/v1/health/redis',
4140
+ errors: {
4141
+ 503: 'Redis unavailable'
4142
+ }
4143
+ });
4144
+ }
4145
+
4146
+ /**
4147
+ * Get status of all circuit breakers
4148
+ * @returns unknown Circuit breaker status
4149
+ * @throws ApiError
4150
+ */
4151
+ public static healthControllerGetCircuitBreakersHealth(): CancelablePromise<HealthControllerGetCircuitBreakersHealthResponse> {
4152
+ return __request(OpenAPI, {
4153
+ method: 'GET',
4154
+ url: '/api/v1/health/circuit-breakers',
4155
+ errors: {
4156
+ 401: 'Unauthorized',
4157
+ 500: 'Internal error'
4158
+ }
4159
+ });
4160
+ }
4161
+
4162
+ /**
4163
+ * Reset a circuit breaker to CLOSED state
4164
+ * @param data The data for the request.
4165
+ * @param data.name Circuit breaker name to reset
4166
+ * @returns unknown Circuit breaker reset successfully
4167
+ * @throws ApiError
4168
+ */
4169
+ public static healthControllerResetCircuitBreaker(
4170
+ data: HealthControllerResetCircuitBreakerData
4171
+ ): CancelablePromise<HealthControllerResetCircuitBreakerResponse> {
4172
+ return __request(OpenAPI, {
4173
+ method: 'POST',
4174
+ url: '/api/v1/health/circuit-breakers/{name}/reset',
4175
+ path: {
4176
+ name: data.name
4177
+ },
4178
+ errors: {
4179
+ 401: 'Unauthorized',
4180
+ 404: 'Circuit breaker not found'
4181
+ }
4182
+ });
4183
+ }
4184
+
4185
+ /**
4186
+ * Get health check metrics and statistics
4187
+ * @returns unknown Health metrics
4188
+ * @throws ApiError
4189
+ */
4190
+ public static healthControllerGetMetrics(): CancelablePromise<HealthControllerGetMetricsResponse> {
4191
+ return __request(OpenAPI, {
4192
+ method: 'GET',
4193
+ url: '/api/v1/health/metrics',
4194
+ errors: {
4195
+ 401: 'Unauthorized'
4196
+ }
4197
+ });
4198
+ }
4199
+ }
4200
+
4201
+ export class InfoService {
4202
+ /**
4203
+ * Get system information
4204
+ * @returns unknown System information retrieved successfully
4205
+ * @throws ApiError
4206
+ */
4207
+ public static infoControllerGetInfo(): CancelablePromise<InfoControllerGetInfoResponse> {
4208
+ return __request(OpenAPI, {
4209
+ method: 'GET',
4210
+ url: '/api/v1/system/info'
4211
+ });
4212
+ }
4213
+ }
4214
+
4215
+ export class MarketDataService {
4216
+ /**
4217
+ * Search market symbols by name or code
4218
+ * Ranked search over the openbb catalog. Empty `q` returns [].
4219
+ * @param data The data for the request.
4220
+ * @param data.q Search term — matched against symbol and instrument name. Empty string returns [].
4221
+ * @param data.limit Maximum number of results (clamped 1..50)
4222
+ * @param data.exchange Filter by exchange code (e.g. US, HK, SS, SZ)
4223
+ * @param data.assetType Filter by OpenBB asset_type (e.g. stock, etf)
4224
+ * @returns SymbolSearchResultDto Ranked search results
4225
+ * @throws ApiError
4226
+ */
4227
+ public static symbolControllerSearch(
4228
+ data: SymbolControllerSearchData
4229
+ ): CancelablePromise<SymbolControllerSearchResponse> {
4230
+ return __request(OpenAPI, {
4231
+ method: 'GET',
4232
+ url: '/api/v1/market/symbols/search',
4233
+ query: {
4234
+ q: data.q,
4235
+ limit: data.limit,
4236
+ exchange: data.exchange,
4237
+ assetType: data.assetType
4238
+ }
4239
+ });
4240
+ }
4241
+
4242
+ /**
4243
+ * Get a market symbol quote
4244
+ * @param data The data for the request.
4245
+ * @param data.symbol
4246
+ * @returns SymbolQuoteDto Symbol quote
4247
+ * @throws ApiError
4248
+ */
4249
+ public static symbolControllerGetQuote(
4250
+ data: SymbolControllerGetQuoteData
4251
+ ): CancelablePromise<SymbolControllerGetQuoteResponse> {
4252
+ return __request(OpenAPI, {
4253
+ method: 'GET',
4254
+ url: '/api/v1/market/symbols/{symbol}/quote',
4255
+ path: {
4256
+ symbol: data.symbol
4257
+ },
4258
+ errors: {
4259
+ 404: 'Symbol not found in the openbb catalog'
4260
+ }
4261
+ });
4262
+ }
4263
+ }