@firela/api-types 0.0.0-canary.a7bda42 → 0.0.0-canary.a90ce0e4

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