@firela/api-types 0.0.0-canary.8a8b3972 → 0.0.0-canary.8c68ebbe

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,16 @@ 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,
174
184
  ExportControllerExportBeancountResponse,
175
185
  FileImportControllerImportFileData,
176
186
  FileImportControllerImportFileResponse,
@@ -2460,6 +2470,149 @@ export class PropertiesService {
2460
2470
  }
2461
2471
  }
2462
2472
 
2473
+ export class LifeEventsService {
2474
+ /**
2475
+ * Create a new life event
2476
+ * Creates a new life event entry for the authenticated user. Returns ETag header carrying the row updatedAt.
2477
+ * @param data The data for the request.
2478
+ * @param data.region Region code for tenant context (decorative for life events)
2479
+ * @param data.requestBody
2480
+ * @returns EventResponseDto Life event created successfully
2481
+ * @throws ApiError
2482
+ */
2483
+ public static eventControllerCreate(
2484
+ data: EventControllerCreateData
2485
+ ): CancelablePromise<EventControllerCreateResponse> {
2486
+ return __request(OpenAPI, {
2487
+ method: 'POST',
2488
+ url: '/api/v1/{region}/bean/events',
2489
+ path: {
2490
+ region: data.region
2491
+ },
2492
+ body: data.requestBody,
2493
+ mediaType: 'application/json',
2494
+ errors: {
2495
+ 409: 'Life event already exists for this (userId, type, date) combination'
2496
+ }
2497
+ });
2498
+ }
2499
+
2500
+ /**
2501
+ * List user life events
2502
+ * Returns life events for the authenticated user with optional filtering by type, description search, and date range.
2503
+ * @param data The data for the request.
2504
+ * @param data.region Region code for tenant context (decorative for life events)
2505
+ * @param data.type Filter by life event type (exact match)
2506
+ * @param data.q Search term for description (case-insensitive partial match)
2507
+ * @param data.from Filter life events from this date (ISO 8601 format)
2508
+ * @param data.to Filter life events to this date (ISO 8601 format)
2509
+ * @param data.page Page number for pagination (default: 1)
2510
+ * @param data.limit Number of items per page (default: 20, max: 100)
2511
+ * @returns EventListResponseDto Life events retrieved successfully
2512
+ * @throws ApiError
2513
+ */
2514
+ public static eventControllerFindAll(
2515
+ data: EventControllerFindAllData
2516
+ ): CancelablePromise<EventControllerFindAllResponse> {
2517
+ return __request(OpenAPI, {
2518
+ method: 'GET',
2519
+ url: '/api/v1/{region}/bean/events',
2520
+ path: {
2521
+ region: data.region
2522
+ },
2523
+ query: {
2524
+ type: data.type,
2525
+ q: data.q,
2526
+ from: data.from,
2527
+ to: data.to,
2528
+ page: data.page,
2529
+ limit: data.limit
2530
+ }
2531
+ });
2532
+ }
2533
+
2534
+ /**
2535
+ * Get life event by ID
2536
+ * Returns a single life event by its ID. Returns ETag header.
2537
+ * @param data The data for the request.
2538
+ * @param data.id Life event ID
2539
+ * @param data.region Region code for tenant context (decorative for life events)
2540
+ * @returns EventResponseDto Life event retrieved successfully
2541
+ * @throws ApiError
2542
+ */
2543
+ public static eventControllerFindOne(
2544
+ data: EventControllerFindOneData
2545
+ ): CancelablePromise<EventControllerFindOneResponse> {
2546
+ return __request(OpenAPI, {
2547
+ method: 'GET',
2548
+ url: '/api/v1/{region}/bean/events/{id}',
2549
+ path: {
2550
+ id: data.id,
2551
+ region: data.region
2552
+ },
2553
+ errors: {
2554
+ 404: 'Life event not found'
2555
+ }
2556
+ });
2557
+ }
2558
+
2559
+ /**
2560
+ * Update a life event
2561
+ * Updates an existing life event. If If-Match header is provided, performs optimistic concurrency check; mismatched updatedAt returns 412.
2562
+ * @param data The data for the request.
2563
+ * @param data.id Life event ID
2564
+ * @param data.region Region code for tenant context (decorative for life events)
2565
+ * @param data.requestBody
2566
+ * @returns EventResponseDto Life event updated successfully
2567
+ * @throws ApiError
2568
+ */
2569
+ public static eventControllerUpdate(
2570
+ data: EventControllerUpdateData
2571
+ ): CancelablePromise<EventControllerUpdateResponse> {
2572
+ return __request(OpenAPI, {
2573
+ method: 'PUT',
2574
+ url: '/api/v1/{region}/bean/events/{id}',
2575
+ path: {
2576
+ id: data.id,
2577
+ region: data.region
2578
+ },
2579
+ body: data.requestBody,
2580
+ mediaType: 'application/json',
2581
+ errors: {
2582
+ 400: 'If-Match header is not a valid ISO 8601 date',
2583
+ 404: 'Life event not found',
2584
+ 409: 'Updated event conflicts with an existing (userId, type, date) combination',
2585
+ 412: 'If-Match precondition failed (updatedAt mismatch)'
2586
+ }
2587
+ });
2588
+ }
2589
+
2590
+ /**
2591
+ * Delete a life event
2592
+ * Deletes a life event entry (hard delete). Returns 204.
2593
+ * @param data The data for the request.
2594
+ * @param data.id Life event ID
2595
+ * @param data.region Region code for tenant context (decorative for life events)
2596
+ * @returns void Life event deleted successfully
2597
+ * @throws ApiError
2598
+ */
2599
+ public static eventControllerDelete(
2600
+ data: EventControllerDeleteData
2601
+ ): CancelablePromise<EventControllerDeleteResponse> {
2602
+ return __request(OpenAPI, {
2603
+ method: 'DELETE',
2604
+ url: '/api/v1/{region}/bean/events/{id}',
2605
+ path: {
2606
+ id: data.id,
2607
+ region: data.region
2608
+ },
2609
+ errors: {
2610
+ 404: 'Life event not found'
2611
+ }
2612
+ });
2613
+ }
2614
+ }
2615
+
2463
2616
  export class BeanExportService {
2464
2617
  /**
2465
2618
  * Export Beancount ledger as ZIP
@@ -442,6 +442,25 @@ export type CreateTransactionDto = {
442
442
  */
443
443
  export type flag = '*' | '!';
444
444
 
445
+ export type CostDetailDto = {
446
+ /**
447
+ * Per-unit cost basis (mirrors engine Cost.number)
448
+ */
449
+ number?: string;
450
+ /**
451
+ * Cost currency
452
+ */
453
+ currency?: string;
454
+ /**
455
+ * Lot acquisition date (ISO yyyy-mm-dd)
456
+ */
457
+ date?: string;
458
+ /**
459
+ * Lot label
460
+ */
461
+ label?: string;
462
+ };
463
+
445
464
  export type PostingResponseDto = {
446
465
  /**
447
466
  * Account name
@@ -455,6 +474,10 @@ export type PostingResponseDto = {
455
474
  * Currency
456
475
  */
457
476
  currency?: string;
477
+ /**
478
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
479
+ */
480
+ cost?: CostDetailDto;
458
481
  };
459
482
 
460
483
  export type RecurringSuggestionDto = {
@@ -698,6 +721,10 @@ export type PostingDetailDto = {
698
721
  * Cost date
699
722
  */
700
723
  costDate?: string;
724
+ /**
725
+ * Booking-resolved cost (mirrors engine Cost). Undefined when the posting has no cost basis.
726
+ */
727
+ cost?: CostDetailDto;
701
728
  /**
702
729
  * Price amount
703
730
  */
@@ -1297,17 +1324,17 @@ export type ResolveResultDto = {
1297
1324
  [key: string]: string;
1298
1325
  };
1299
1326
  /**
1300
- * Resolution ID for undo
1327
+ * Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).
1301
1328
  */
1302
- resolutionId: string;
1329
+ resolutionId?: string;
1303
1330
  /**
1304
1331
  * Whether this decision can be undone
1305
1332
  */
1306
- canUndo: boolean;
1333
+ canUndo?: boolean;
1307
1334
  /**
1308
1335
  * Deadline for undo (24h from resolution)
1309
1336
  */
1310
- undoDeadline: string;
1337
+ undoDeadline?: string;
1311
1338
  /**
1312
1339
  * Rule ID if learning was triggered (ACCEPT_AND_LEARN actions). Use this to deep-link to the rule management page.
1313
1340
  */
@@ -3002,6 +3029,96 @@ export type UpdatePropertyDto = {
3002
3029
  value: string;
3003
3030
  };
3004
3031
 
3032
+ export type CreateBeanEventDto = {
3033
+ /**
3034
+ * Life event date (ISO 8601)
3035
+ */
3036
+ date: string;
3037
+ /**
3038
+ * Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer
3039
+ */
3040
+ type: string;
3041
+ /**
3042
+ * Life event description. Empty string is a VALID value (distinct from absence).
3043
+ */
3044
+ description: string;
3045
+ /**
3046
+ * Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)
3047
+ */
3048
+ meta?: {
3049
+ [key: string]: unknown;
3050
+ };
3051
+ };
3052
+
3053
+ export type EventResponseDto = {
3054
+ /**
3055
+ * Unique identifier
3056
+ */
3057
+ id: string;
3058
+ /**
3059
+ * User ID (owner of the life event)
3060
+ */
3061
+ userId: string;
3062
+ /**
3063
+ * Life event date (ISO 8601 format)
3064
+ */
3065
+ date: string;
3066
+ /**
3067
+ * Life event type (user-defined, e.g., "employer", "location")
3068
+ */
3069
+ type: string;
3070
+ /**
3071
+ * Life event description. May be an empty string (a valid value distinct from absence).
3072
+ */
3073
+ description: string;
3074
+ /**
3075
+ * Product-side metadata (free-form JSON)
3076
+ */
3077
+ meta: {
3078
+ [key: string]: unknown;
3079
+ };
3080
+ /**
3081
+ * Creation timestamp
3082
+ */
3083
+ createdAt: string;
3084
+ /**
3085
+ * Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.
3086
+ */
3087
+ updatedAt: string;
3088
+ };
3089
+
3090
+ export type EventListResponseDto = {
3091
+ /**
3092
+ * List of life events
3093
+ */
3094
+ items: Array<EventResponseDto>;
3095
+ /**
3096
+ * Total number of life events matching the query
3097
+ */
3098
+ total: number;
3099
+ };
3100
+
3101
+ export type UpdateBeanEventDto = {
3102
+ /**
3103
+ * Life event date (ISO 8601)
3104
+ */
3105
+ date?: string;
3106
+ /**
3107
+ * Life event type (user-defined)
3108
+ */
3109
+ type?: string;
3110
+ /**
3111
+ * Life event description. Empty string is a VALID value (distinct from absence).
3112
+ */
3113
+ description?: string;
3114
+ /**
3115
+ * Product-side metadata (free-form JSON)
3116
+ */
3117
+ meta?: {
3118
+ [key: string]: unknown;
3119
+ };
3120
+ };
3121
+
3005
3122
  export type FileImportDto = {
3006
3123
  /**
3007
3124
  * Bill file to import (CSV, PDF, OFX, etc.)
@@ -6069,6 +6186,89 @@ export type PropertyControllerDeleteData = {
6069
6186
 
6070
6187
  export type PropertyControllerDeleteResponse = void;
6071
6188
 
6189
+ export type EventControllerCreateData = {
6190
+ /**
6191
+ * Region code for tenant context (decorative for life events)
6192
+ */
6193
+ region: 'cn' | 'us' | 'de' | 'gb';
6194
+ requestBody: CreateBeanEventDto;
6195
+ };
6196
+
6197
+ export type EventControllerCreateResponse = EventResponseDto;
6198
+
6199
+ export type EventControllerFindAllData = {
6200
+ /**
6201
+ * Filter life events from this date (ISO 8601 format)
6202
+ */
6203
+ from?: string;
6204
+ /**
6205
+ * Number of items per page (default: 20, max: 100)
6206
+ */
6207
+ limit?: number;
6208
+ /**
6209
+ * Page number for pagination (default: 1)
6210
+ */
6211
+ page?: number;
6212
+ /**
6213
+ * Search term for description (case-insensitive partial match)
6214
+ */
6215
+ q?: string;
6216
+ /**
6217
+ * Region code for tenant context (decorative for life events)
6218
+ */
6219
+ region: 'cn' | 'us' | 'de' | 'gb';
6220
+ /**
6221
+ * Filter life events to this date (ISO 8601 format)
6222
+ */
6223
+ to?: string;
6224
+ /**
6225
+ * Filter by life event type (exact match)
6226
+ */
6227
+ type?: string;
6228
+ };
6229
+
6230
+ export type EventControllerFindAllResponse = EventListResponseDto;
6231
+
6232
+ export type EventControllerFindOneData = {
6233
+ /**
6234
+ * Life event ID
6235
+ */
6236
+ id: string;
6237
+ /**
6238
+ * Region code for tenant context (decorative for life events)
6239
+ */
6240
+ region: 'cn' | 'us' | 'de' | 'gb';
6241
+ };
6242
+
6243
+ export type EventControllerFindOneResponse = EventResponseDto;
6244
+
6245
+ export type EventControllerUpdateData = {
6246
+ /**
6247
+ * Life event ID
6248
+ */
6249
+ id: string;
6250
+ /**
6251
+ * Region code for tenant context (decorative for life events)
6252
+ */
6253
+ region: 'cn' | 'us' | 'de' | 'gb';
6254
+ requestBody: UpdateBeanEventDto;
6255
+ };
6256
+
6257
+ export type EventControllerUpdateResponse = EventResponseDto;
6258
+
6259
+ export type EventControllerDeleteData = {
6260
+ /**
6261
+ * Life event ID
6262
+ */
6263
+ id: string;
6264
+ /**
6265
+ * Region code for tenant context (decorative for life events)
6266
+ */
6267
+ region: 'cn' | 'us' | 'de' | 'gb';
6268
+ };
6269
+
6270
+ export type EventControllerDeleteResponse = void;
6271
+
6072
6272
  export type ExportControllerExportBeancountResponse = unknown;
6073
6273
 
6074
6274
  export type FileImportControllerImportFileData = {
@@ -7941,6 +8141,83 @@ export type $OpenApiTs = {
7941
8141
  };
7942
8142
  };
7943
8143
  };
8144
+ '/api/v1/{region}/bean/events': {
8145
+ post: {
8146
+ req: EventControllerCreateData;
8147
+ res: {
8148
+ /**
8149
+ * Life event created successfully
8150
+ */
8151
+ 201: EventResponseDto;
8152
+ /**
8153
+ * Life event already exists for this (userId, type, date) combination
8154
+ */
8155
+ 409: unknown;
8156
+ };
8157
+ };
8158
+ get: {
8159
+ req: EventControllerFindAllData;
8160
+ res: {
8161
+ /**
8162
+ * Life events retrieved successfully
8163
+ */
8164
+ 200: EventListResponseDto;
8165
+ };
8166
+ };
8167
+ };
8168
+ '/api/v1/{region}/bean/events/{id}': {
8169
+ get: {
8170
+ req: EventControllerFindOneData;
8171
+ res: {
8172
+ /**
8173
+ * Life event retrieved successfully
8174
+ */
8175
+ 200: EventResponseDto;
8176
+ /**
8177
+ * Life event not found
8178
+ */
8179
+ 404: unknown;
8180
+ };
8181
+ };
8182
+ put: {
8183
+ req: EventControllerUpdateData;
8184
+ res: {
8185
+ /**
8186
+ * Life event updated successfully
8187
+ */
8188
+ 200: EventResponseDto;
8189
+ /**
8190
+ * If-Match header is not a valid ISO 8601 date
8191
+ */
8192
+ 400: unknown;
8193
+ /**
8194
+ * Life event not found
8195
+ */
8196
+ 404: unknown;
8197
+ /**
8198
+ * Updated event conflicts with an existing (userId, type, date) combination
8199
+ */
8200
+ 409: unknown;
8201
+ /**
8202
+ * If-Match precondition failed (updatedAt mismatch)
8203
+ */
8204
+ 412: unknown;
8205
+ };
8206
+ };
8207
+ delete: {
8208
+ req: EventControllerDeleteData;
8209
+ res: {
8210
+ /**
8211
+ * Life event deleted successfully
8212
+ */
8213
+ 204: void;
8214
+ /**
8215
+ * Life event not found
8216
+ */
8217
+ 404: unknown;
8218
+ };
8219
+ };
8220
+ };
7944
8221
  '/api/v1/{region}/bean/export/beancount': {
7945
8222
  get: {
7946
8223
  res: {