@firela/api-types 0.0.0-canary.792fa5f1 → 0.0.0-canary.7a8f5374

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.
@@ -171,6 +171,18 @@ import type {
171
171
  PropertyControllerUpdateResponse,
172
172
  PropertyControllerDeleteData,
173
173
  PropertyControllerDeleteResponse,
174
+ EventControllerCreateData,
175
+ EventControllerCreateResponse,
176
+ EventControllerFindAllData,
177
+ EventControllerFindAllResponse,
178
+ EventControllerFindOneData,
179
+ EventControllerFindOneResponse,
180
+ EventControllerUpdateData,
181
+ EventControllerUpdateResponse,
182
+ EventControllerDeleteData,
183
+ EventControllerDeleteResponse,
184
+ EventControllerGetSliceData,
185
+ EventControllerGetSliceResponse,
174
186
  ExportControllerExportBeancountResponse,
175
187
  FileImportControllerImportFileData,
176
188
  FileImportControllerImportFileResponse,
@@ -218,6 +230,8 @@ import type {
218
230
  DashboardControllerGetAccountsResponse,
219
231
  DashboardControllerGetCashFlowData,
220
232
  DashboardControllerGetCashFlowResponse,
233
+ DashboardControllerGetExpensesData,
234
+ DashboardControllerGetExpensesResponse,
221
235
  HoldingPnlControllerGetHoldingPnlData,
222
236
  HoldingPnlControllerGetHoldingPnlResponse,
223
237
  PriceControllerCreateData,
@@ -234,6 +248,8 @@ import type {
234
248
  PriceControllerBulkCreateResponse,
235
249
  ReportingControllerGetPortfolioTrendsData,
236
250
  ReportingControllerGetPortfolioTrendsResponse,
251
+ ReportingControllerGetCashFlowTrendsData,
252
+ ReportingControllerGetCashFlowTrendsResponse,
237
253
  ReportingControllerGenerateSnapshotData,
238
254
  ReportingControllerGenerateSnapshotResponse,
239
255
  ReportingControllerBackfillSnapshotsData,
@@ -569,6 +585,7 @@ export class BeanTransactionsService {
569
585
  * @param data.status Filter by transaction status
570
586
  * @param data.search Search in narration and payee fields (max 200 chars)
571
587
  * @param data.accountId Filter by account ID (transactions with postings to this account)
588
+ * @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
572
589
  * @returns TransactionListResponseDto Transaction list
573
590
  * @throws ApiError
574
591
  */
@@ -588,7 +605,8 @@ export class BeanTransactionsService {
588
605
  dateTo: data.dateTo,
589
606
  status: data.status,
590
607
  search: data.search,
591
- accountId: data.accountId
608
+ accountId: data.accountId,
609
+ category: data.category
592
610
  },
593
611
  errors: {
594
612
  400: 'Validation failed',
@@ -2460,6 +2478,181 @@ export class PropertiesService {
2460
2478
  }
2461
2479
  }
2462
2480
 
2481
+ export class LifeEventsService {
2482
+ /**
2483
+ * Create a new life event
2484
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2485
+ * @param data The data for the request.
2486
+ * @param data.region Region code for tenant context (decorative for life events)
2487
+ * @param data.requestBody
2488
+ * @returns EventResponseDto Life event created successfully
2489
+ * @throws ApiError
2490
+ */
2491
+ public static eventControllerCreate(
2492
+ data: EventControllerCreateData
2493
+ ): CancelablePromise<EventControllerCreateResponse> {
2494
+ return __request(OpenAPI, {
2495
+ method: 'POST',
2496
+ url: '/api/v1/{region}/bean/events',
2497
+ path: {
2498
+ region: data.region
2499
+ },
2500
+ body: data.requestBody,
2501
+ mediaType: 'application/json',
2502
+ errors: {
2503
+ 409: 'Life event already exists for this (userId, type, date) combination'
2504
+ }
2505
+ });
2506
+ }
2507
+
2508
+ /**
2509
+ * List user life events
2510
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2511
+ * @param data The data for the request.
2512
+ * @param data.region Region code for tenant context (decorative for life events)
2513
+ * @param data.type Filter by life event type (exact match)
2514
+ * @param data.q Search term for description (case-insensitive partial match)
2515
+ * @param data.from Filter life events from this date (ISO 8601 format)
2516
+ * @param data.to Filter life events to this date (ISO 8601 format)
2517
+ * @param data.page Page number for pagination (default: 1)
2518
+ * @param data.limit Number of items per page (default: 20, max: 100)
2519
+ * @returns EventListResponseDto Life events retrieved successfully
2520
+ * @throws ApiError
2521
+ */
2522
+ public static eventControllerFindAll(
2523
+ data: EventControllerFindAllData
2524
+ ): CancelablePromise<EventControllerFindAllResponse> {
2525
+ return __request(OpenAPI, {
2526
+ method: 'GET',
2527
+ url: '/api/v1/{region}/bean/events',
2528
+ path: {
2529
+ region: data.region
2530
+ },
2531
+ query: {
2532
+ type: data.type,
2533
+ q: data.q,
2534
+ from: data.from,
2535
+ to: data.to,
2536
+ page: data.page,
2537
+ limit: data.limit
2538
+ }
2539
+ });
2540
+ }
2541
+
2542
+ /**
2543
+ * Get life event by ID
2544
+ * Returns a single life event by its ID. Returns ETag header.
2545
+ * @param data The data for the request.
2546
+ * @param data.id Life event ID
2547
+ * @param data.region Region code for tenant context (decorative for life events)
2548
+ * @returns EventResponseDto Life event retrieved successfully
2549
+ * @throws ApiError
2550
+ */
2551
+ public static eventControllerFindOne(
2552
+ data: EventControllerFindOneData
2553
+ ): CancelablePromise<EventControllerFindOneResponse> {
2554
+ return __request(OpenAPI, {
2555
+ method: 'GET',
2556
+ url: '/api/v1/{region}/bean/events/{id}',
2557
+ path: {
2558
+ id: data.id,
2559
+ region: data.region
2560
+ },
2561
+ errors: {
2562
+ 404: 'Life event not found'
2563
+ }
2564
+ });
2565
+ }
2566
+
2567
+ /**
2568
+ * Update a life event
2569
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2570
+ * @param data The data for the request.
2571
+ * @param data.id Life event ID
2572
+ * @param data.region Region code for tenant context (decorative for life events)
2573
+ * @param data.requestBody
2574
+ * @returns EventResponseDto Life event updated successfully
2575
+ * @throws ApiError
2576
+ */
2577
+ public static eventControllerUpdate(
2578
+ data: EventControllerUpdateData
2579
+ ): CancelablePromise<EventControllerUpdateResponse> {
2580
+ return __request(OpenAPI, {
2581
+ method: 'PUT',
2582
+ url: '/api/v1/{region}/bean/events/{id}',
2583
+ path: {
2584
+ id: data.id,
2585
+ region: data.region
2586
+ },
2587
+ body: data.requestBody,
2588
+ mediaType: 'application/json',
2589
+ errors: {
2590
+ 400: 'If-Match header is not a valid ISO 8601 date',
2591
+ 404: 'Life event not found',
2592
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
2593
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2594
+ }
2595
+ });
2596
+ }
2597
+
2598
+ /**
2599
+ * Delete a life event
2600
+ * Deletes a life event entry (hard delete). Returns 204.
2601
+ * @param data The data for the request.
2602
+ * @param data.id Life event ID
2603
+ * @param data.region Region code for tenant context (decorative for life events)
2604
+ * @returns void Life event deleted successfully
2605
+ * @throws ApiError
2606
+ */
2607
+ public static eventControllerDelete(
2608
+ data: EventControllerDeleteData
2609
+ ): CancelablePromise<EventControllerDeleteResponse> {
2610
+ return __request(OpenAPI, {
2611
+ method: 'DELETE',
2612
+ url: '/api/v1/{region}/bean/events/{id}',
2613
+ path: {
2614
+ id: data.id,
2615
+ region: data.region
2616
+ },
2617
+ errors: {
2618
+ 404: 'Life event not found'
2619
+ }
2620
+ });
2621
+ }
2622
+
2623
+ /**
2624
+ * Slice time-series by a life event (Phase 79)
2625
+ * Returns aggregated time-series for postings matching accountPattern within the half-open date range of the given life event.
2626
+ * @param data The data for the request.
2627
+ * @param data.id Life event ID
2628
+ * @param data.accountPattern
2629
+ * @param data.granularity
2630
+ * @param data.region Region code for tenant context (decorative for life events)
2631
+ * @returns unknown Time-series sliced by the life event range
2632
+ * @throws ApiError
2633
+ */
2634
+ public static eventControllerGetSlice(
2635
+ data: EventControllerGetSliceData
2636
+ ): CancelablePromise<EventControllerGetSliceResponse> {
2637
+ return __request(OpenAPI, {
2638
+ method: 'GET',
2639
+ url: '/api/v1/{region}/bean/events/{id}/slice',
2640
+ path: {
2641
+ id: data.id,
2642
+ region: data.region
2643
+ },
2644
+ query: {
2645
+ accountPattern: data.accountPattern,
2646
+ granularity: data.granularity
2647
+ },
2648
+ errors: {
2649
+ 400: 'accountPattern query param is empty',
2650
+ 404: 'Life event not found'
2651
+ }
2652
+ });
2653
+ }
2654
+ }
2655
+
2463
2656
  export class BeanExportService {
2464
2657
  /**
2465
2658
  * Export Beancount ledger as ZIP
@@ -3097,6 +3290,38 @@ export class DashboardService {
3097
3290
  }
3098
3291
  });
3099
3292
  }
3293
+
3294
+ /**
3295
+ * Get expenses/income grouped by functional category
3296
+ * 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)
3297
+ * @param data The data for the request.
3298
+ * @param data.region Region code for tenant context
3299
+ * @param data.groupBy Grouping strategy
3300
+ * @param data.period Time window (1m = current calendar month)
3301
+ * @param data.flow Account root to aggregate (expense → ^Expenses:, income → ^Income:)
3302
+ * @returns ExpensesByCategoryResponseDto Expenses retrieved successfully
3303
+ * @throws ApiError
3304
+ */
3305
+ public static dashboardControllerGetExpenses(
3306
+ data: DashboardControllerGetExpensesData
3307
+ ): CancelablePromise<DashboardControllerGetExpensesResponse> {
3308
+ return __request(OpenAPI, {
3309
+ method: 'GET',
3310
+ url: '/api/v1/{region}/dashboard/expenses',
3311
+ path: {
3312
+ region: data.region
3313
+ },
3314
+ query: {
3315
+ groupBy: data.groupBy,
3316
+ period: data.period,
3317
+ flow: data.flow
3318
+ },
3319
+ errors: {
3320
+ 400: 'Invalid groupBy or period',
3321
+ 401: 'User not authenticated'
3322
+ }
3323
+ });
3324
+ }
3100
3325
  }
3101
3326
 
3102
3327
  export class InvestmentService {
@@ -3341,6 +3566,42 @@ export class ReportingService {
3341
3566
  });
3342
3567
  }
3343
3568
 
3569
+ /**
3570
+ * Get cash-flow trends
3571
+ *
3572
+ * Monthly income / expense / netSavings over a fixed N-month window
3573
+ * (current month + N−1 prior). Missing months are zero-filled (flow metric).
3574
+ *
3575
+ * **Parameters:**
3576
+ * - `period`: 1m | 3m | 6m | 1y (default 6m)
3577
+ * - `granularity`: accepted for API symmetry; v1 returns month buckets
3578
+ *
3579
+ * @param data The data for the request.
3580
+ * @param data.region Region code for tenant context
3581
+ * @param data.period Time period
3582
+ * @param data.granularity Data granularity (accepted for API symmetry; v1 returns month buckets)
3583
+ * @returns CashFlowTrendsResponseDto Cash-flow trends retrieved successfully
3584
+ * @throws ApiError
3585
+ */
3586
+ public static reportingControllerGetCashFlowTrends(
3587
+ data: ReportingControllerGetCashFlowTrendsData
3588
+ ): CancelablePromise<ReportingControllerGetCashFlowTrendsResponse> {
3589
+ return __request(OpenAPI, {
3590
+ method: 'GET',
3591
+ url: '/api/v1/{region}/reporting/cash-flow/trends',
3592
+ path: {
3593
+ region: data.region
3594
+ },
3595
+ query: {
3596
+ period: data.period,
3597
+ granularity: data.granularity
3598
+ },
3599
+ errors: {
3600
+ 401: 'User not authenticated'
3601
+ }
3602
+ });
3603
+ }
3604
+
3344
3605
  /**
3345
3606
  * Generate portfolio snapshot
3346
3607
  *