@firela/api-types 0.0.0-canary.5c1ed455 → 0.0.0-canary.5fa96f73
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.
- package/dist/index.d.mts +555 -48
- package/dist/index.d.ts +555 -48
- package/dist/index.js +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +501 -73
- package/src/generated/services.gen.ts +262 -1
- package/src/generated/types.gen.ts +585 -50
package/dist/index.js
CHANGED
|
@@ -670,6 +670,7 @@ var BeanTransactionsService = class {
|
|
|
670
670
|
* @param data.status Filter by transaction status
|
|
671
671
|
* @param data.search Search in narration and payee fields (max 200 chars)
|
|
672
672
|
* @param data.accountId Filter by account ID (transactions with postings to this account)
|
|
673
|
+
* @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
|
|
673
674
|
* @returns TransactionListResponseDto Transaction list
|
|
674
675
|
* @throws ApiError
|
|
675
676
|
*/
|
|
@@ -687,7 +688,8 @@ var BeanTransactionsService = class {
|
|
|
687
688
|
dateTo: data.dateTo,
|
|
688
689
|
status: data.status,
|
|
689
690
|
search: data.search,
|
|
690
|
-
accountId: data.accountId
|
|
691
|
+
accountId: data.accountId,
|
|
692
|
+
category: data.category
|
|
691
693
|
},
|
|
692
694
|
errors: {
|
|
693
695
|
400: "Validation failed",
|
package/dist/index.mjs
CHANGED
|
@@ -638,6 +638,7 @@ var BeanTransactionsService = class {
|
|
|
638
638
|
* @param data.status Filter by transaction status
|
|
639
639
|
* @param data.search Search in narration and payee fields (max 200 chars)
|
|
640
640
|
* @param data.accountId Filter by account ID (transactions with postings to this account)
|
|
641
|
+
* @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
|
|
641
642
|
* @returns TransactionListResponseDto Transaction list
|
|
642
643
|
* @throws ApiError
|
|
643
644
|
*/
|
|
@@ -655,7 +656,8 @@ var BeanTransactionsService = class {
|
|
|
655
656
|
dateTo: data.dateTo,
|
|
656
657
|
status: data.status,
|
|
657
658
|
search: data.search,
|
|
658
|
-
accountId: data.accountId
|
|
659
|
+
accountId: data.accountId,
|
|
660
|
+
category: data.category
|
|
659
661
|
},
|
|
660
662
|
errors: {
|
|
661
663
|
400: "Validation failed",
|
package/package.json
CHANGED
|
@@ -1247,6 +1247,77 @@ export const $TransactionDetailDto = {
|
|
|
1247
1247
|
]
|
|
1248
1248
|
} as const;
|
|
1249
1249
|
|
|
1250
|
+
export const $BalanceByCurrencyDto = {
|
|
1251
|
+
type: 'object',
|
|
1252
|
+
properties: {
|
|
1253
|
+
currency: {
|
|
1254
|
+
type: 'string',
|
|
1255
|
+
description: 'ISO 4217 currency code',
|
|
1256
|
+
example: 'CNY'
|
|
1257
|
+
},
|
|
1258
|
+
balance: {
|
|
1259
|
+
type: 'string',
|
|
1260
|
+
description: 'Balance amount',
|
|
1261
|
+
example: '50000.00'
|
|
1262
|
+
}
|
|
1263
|
+
},
|
|
1264
|
+
required: ['currency', 'balance']
|
|
1265
|
+
} as const;
|
|
1266
|
+
|
|
1267
|
+
export const $ExchangeRateWarningDto = {
|
|
1268
|
+
type: 'object',
|
|
1269
|
+
properties: {
|
|
1270
|
+
type: {
|
|
1271
|
+
type: 'string',
|
|
1272
|
+
description: 'Warning type',
|
|
1273
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
1274
|
+
},
|
|
1275
|
+
currency: {
|
|
1276
|
+
type: 'string',
|
|
1277
|
+
description: 'Currency without exchange rate',
|
|
1278
|
+
example: 'EUR'
|
|
1279
|
+
},
|
|
1280
|
+
totalAmount: {
|
|
1281
|
+
type: 'string',
|
|
1282
|
+
description: 'Total amount affected',
|
|
1283
|
+
example: '1000.00'
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
required: ['type', 'currency', 'totalAmount']
|
|
1287
|
+
} as const;
|
|
1288
|
+
|
|
1289
|
+
export const $TransactionListSummaryDto = {
|
|
1290
|
+
type: 'object',
|
|
1291
|
+
properties: {
|
|
1292
|
+
totalAmount: {
|
|
1293
|
+
type: 'string',
|
|
1294
|
+
description:
|
|
1295
|
+
'Partial converted total in base currency (rated currencies only, raw Beancount sign). When warnings is non-empty this excludes currencies missing an FX rate; may be "0.00" if ALL non-base currencies lack a rate. Converted at the dateTo (or current) available rate.',
|
|
1296
|
+
example: '-6000.00'
|
|
1297
|
+
},
|
|
1298
|
+
currency: {
|
|
1299
|
+
type: 'string',
|
|
1300
|
+
description: 'Base currency (ISO 4217)',
|
|
1301
|
+
example: 'CNY'
|
|
1302
|
+
},
|
|
1303
|
+
balanceByCurrency: {
|
|
1304
|
+
description: 'Raw (unconverted) balance per currency',
|
|
1305
|
+
type: 'array',
|
|
1306
|
+
items: {
|
|
1307
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
1308
|
+
}
|
|
1309
|
+
},
|
|
1310
|
+
warnings: {
|
|
1311
|
+
description: 'Currencies missing an FX rate (omitted when empty)',
|
|
1312
|
+
type: 'array',
|
|
1313
|
+
items: {
|
|
1314
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
required: ['totalAmount', 'currency', 'balanceByCurrency']
|
|
1319
|
+
} as const;
|
|
1320
|
+
|
|
1250
1321
|
export const $TransactionListResponseDto = {
|
|
1251
1322
|
type: 'object',
|
|
1252
1323
|
properties: {
|
|
@@ -1271,6 +1342,15 @@ export const $TransactionListResponseDto = {
|
|
|
1271
1342
|
type: 'number',
|
|
1272
1343
|
description: 'Number of items skipped',
|
|
1273
1344
|
example: 0
|
|
1345
|
+
},
|
|
1346
|
+
summary: {
|
|
1347
|
+
description:
|
|
1348
|
+
'Amount summary for the full filtered set (#514). Present only when the request has a single account OR category viewpoint; omitted for search-only / plain-list / dual-perspective requests.',
|
|
1349
|
+
allOf: [
|
|
1350
|
+
{
|
|
1351
|
+
$ref: '#/components/schemas/TransactionListSummaryDto'
|
|
1352
|
+
}
|
|
1353
|
+
]
|
|
1274
1354
|
}
|
|
1275
1355
|
},
|
|
1276
1356
|
required: ['data', 'total', 'limit', 'offset']
|
|
@@ -1855,7 +1935,8 @@ export const $ResolveResultDto = {
|
|
|
1855
1935
|
},
|
|
1856
1936
|
resolutionId: {
|
|
1857
1937
|
type: 'string',
|
|
1858
|
-
description:
|
|
1938
|
+
description:
|
|
1939
|
+
'Resolution ID for undo. Absent when the resolver rejected the decision (review stayed PENDING).'
|
|
1859
1940
|
},
|
|
1860
1941
|
canUndo: {
|
|
1861
1942
|
type: 'boolean',
|
|
@@ -1873,7 +1954,7 @@ export const $ResolveResultDto = {
|
|
|
1873
1954
|
example: 'rule_01HXK5V8N2M3P4Q5R6S7T8U9V0'
|
|
1874
1955
|
}
|
|
1875
1956
|
},
|
|
1876
|
-
required: ['success'
|
|
1957
|
+
required: ['success']
|
|
1877
1958
|
} as const;
|
|
1878
1959
|
|
|
1879
1960
|
export const $UndoResultDto = {
|
|
@@ -4311,6 +4392,144 @@ export const $UpdatePropertyDto = {
|
|
|
4311
4392
|
required: ['value']
|
|
4312
4393
|
} as const;
|
|
4313
4394
|
|
|
4395
|
+
export const $CreateBeanEventDto = {
|
|
4396
|
+
type: 'object',
|
|
4397
|
+
properties: {
|
|
4398
|
+
date: {
|
|
4399
|
+
type: 'string',
|
|
4400
|
+
description: 'Life event date (ISO 8601)',
|
|
4401
|
+
example: '2024-03-15'
|
|
4402
|
+
},
|
|
4403
|
+
type: {
|
|
4404
|
+
type: 'string',
|
|
4405
|
+
description:
|
|
4406
|
+
'Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer',
|
|
4407
|
+
example: 'employer'
|
|
4408
|
+
},
|
|
4409
|
+
description: {
|
|
4410
|
+
type: 'string',
|
|
4411
|
+
description:
|
|
4412
|
+
'Life event description. Empty string is a VALID value (distinct from absence).',
|
|
4413
|
+
example: 'Acme Corp'
|
|
4414
|
+
},
|
|
4415
|
+
meta: {
|
|
4416
|
+
type: 'object',
|
|
4417
|
+
description:
|
|
4418
|
+
'Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)',
|
|
4419
|
+
example: {
|
|
4420
|
+
note: 'Promotion'
|
|
4421
|
+
}
|
|
4422
|
+
}
|
|
4423
|
+
},
|
|
4424
|
+
required: ['date', 'type', 'description']
|
|
4425
|
+
} as const;
|
|
4426
|
+
|
|
4427
|
+
export const $EventResponseDto = {
|
|
4428
|
+
type: 'object',
|
|
4429
|
+
properties: {
|
|
4430
|
+
id: {
|
|
4431
|
+
type: 'string',
|
|
4432
|
+
description: 'Unique identifier',
|
|
4433
|
+
example: 'uuid-123-456'
|
|
4434
|
+
},
|
|
4435
|
+
userId: {
|
|
4436
|
+
type: 'string',
|
|
4437
|
+
description: 'User ID (owner of the life event)',
|
|
4438
|
+
example: 'user-123'
|
|
4439
|
+
},
|
|
4440
|
+
date: {
|
|
4441
|
+
type: 'string',
|
|
4442
|
+
description: 'Life event date (ISO 8601 format)',
|
|
4443
|
+
example: '2024-03-15',
|
|
4444
|
+
format: 'date'
|
|
4445
|
+
},
|
|
4446
|
+
type: {
|
|
4447
|
+
type: 'string',
|
|
4448
|
+
description:
|
|
4449
|
+
'Life event type (user-defined, e.g., "employer", "location")',
|
|
4450
|
+
example: 'employer'
|
|
4451
|
+
},
|
|
4452
|
+
description: {
|
|
4453
|
+
type: 'string',
|
|
4454
|
+
description:
|
|
4455
|
+
'Life event description. May be an empty string (a valid value distinct from absence).',
|
|
4456
|
+
example: 'Acme Corp'
|
|
4457
|
+
},
|
|
4458
|
+
meta: {
|
|
4459
|
+
type: 'object',
|
|
4460
|
+
description: 'Product-side metadata (free-form JSON)',
|
|
4461
|
+
example: {
|
|
4462
|
+
note: 'Promotion'
|
|
4463
|
+
}
|
|
4464
|
+
},
|
|
4465
|
+
createdAt: {
|
|
4466
|
+
format: 'date-time',
|
|
4467
|
+
type: 'string',
|
|
4468
|
+
description: 'Creation timestamp',
|
|
4469
|
+
example: '2024-03-15T10:00:00Z'
|
|
4470
|
+
},
|
|
4471
|
+
updatedAt: {
|
|
4472
|
+
format: 'date-time',
|
|
4473
|
+
type: 'string',
|
|
4474
|
+
description:
|
|
4475
|
+
'Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.',
|
|
4476
|
+
example: '2024-03-15T10:00:00Z'
|
|
4477
|
+
}
|
|
4478
|
+
},
|
|
4479
|
+
required: [
|
|
4480
|
+
'id',
|
|
4481
|
+
'userId',
|
|
4482
|
+
'date',
|
|
4483
|
+
'type',
|
|
4484
|
+
'description',
|
|
4485
|
+
'meta',
|
|
4486
|
+
'createdAt',
|
|
4487
|
+
'updatedAt'
|
|
4488
|
+
]
|
|
4489
|
+
} as const;
|
|
4490
|
+
|
|
4491
|
+
export const $EventListResponseDto = {
|
|
4492
|
+
type: 'object',
|
|
4493
|
+
properties: {
|
|
4494
|
+
items: {
|
|
4495
|
+
description: 'List of life events',
|
|
4496
|
+
type: 'array',
|
|
4497
|
+
items: {
|
|
4498
|
+
$ref: '#/components/schemas/EventResponseDto'
|
|
4499
|
+
}
|
|
4500
|
+
},
|
|
4501
|
+
total: {
|
|
4502
|
+
type: 'number',
|
|
4503
|
+
description: 'Total number of life events matching the query',
|
|
4504
|
+
example: 42
|
|
4505
|
+
}
|
|
4506
|
+
},
|
|
4507
|
+
required: ['items', 'total']
|
|
4508
|
+
} as const;
|
|
4509
|
+
|
|
4510
|
+
export const $UpdateBeanEventDto = {
|
|
4511
|
+
type: 'object',
|
|
4512
|
+
properties: {
|
|
4513
|
+
date: {
|
|
4514
|
+
type: 'string',
|
|
4515
|
+
description: 'Life event date (ISO 8601)'
|
|
4516
|
+
},
|
|
4517
|
+
type: {
|
|
4518
|
+
type: 'string',
|
|
4519
|
+
description: 'Life event type (user-defined)'
|
|
4520
|
+
},
|
|
4521
|
+
description: {
|
|
4522
|
+
type: 'string',
|
|
4523
|
+
description:
|
|
4524
|
+
'Life event description. Empty string is a VALID value (distinct from absence).'
|
|
4525
|
+
},
|
|
4526
|
+
meta: {
|
|
4527
|
+
type: 'object',
|
|
4528
|
+
description: 'Product-side metadata (free-form JSON)'
|
|
4529
|
+
}
|
|
4530
|
+
}
|
|
4531
|
+
} as const;
|
|
4532
|
+
|
|
4314
4533
|
export const $FileImportDto = {
|
|
4315
4534
|
type: 'object',
|
|
4316
4535
|
properties: {
|
|
@@ -5790,23 +6009,6 @@ export const $NlpResponseDto = {
|
|
|
5790
6009
|
required: ['status', 'action']
|
|
5791
6010
|
} as const;
|
|
5792
6011
|
|
|
5793
|
-
export const $BalanceByCurrencyDto = {
|
|
5794
|
-
type: 'object',
|
|
5795
|
-
properties: {
|
|
5796
|
-
currency: {
|
|
5797
|
-
type: 'string',
|
|
5798
|
-
description: 'ISO 4217 currency code',
|
|
5799
|
-
example: 'CNY'
|
|
5800
|
-
},
|
|
5801
|
-
balance: {
|
|
5802
|
-
type: 'string',
|
|
5803
|
-
description: 'Balance amount',
|
|
5804
|
-
example: '50000.00'
|
|
5805
|
-
}
|
|
5806
|
-
},
|
|
5807
|
-
required: ['currency', 'balance']
|
|
5808
|
-
} as const;
|
|
5809
|
-
|
|
5810
6012
|
export const $NetWorthByCurrencyDto = {
|
|
5811
6013
|
type: 'object',
|
|
5812
6014
|
properties: {
|
|
@@ -5876,28 +6078,6 @@ export const $ConvertedNetWorthDto = {
|
|
|
5876
6078
|
]
|
|
5877
6079
|
} as const;
|
|
5878
6080
|
|
|
5879
|
-
export const $ExchangeRateWarningDto = {
|
|
5880
|
-
type: 'object',
|
|
5881
|
-
properties: {
|
|
5882
|
-
type: {
|
|
5883
|
-
type: 'string',
|
|
5884
|
-
description: 'Warning type',
|
|
5885
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
5886
|
-
},
|
|
5887
|
-
currency: {
|
|
5888
|
-
type: 'string',
|
|
5889
|
-
description: 'Currency without exchange rate',
|
|
5890
|
-
example: 'EUR'
|
|
5891
|
-
},
|
|
5892
|
-
totalAmount: {
|
|
5893
|
-
type: 'string',
|
|
5894
|
-
description: 'Total amount affected',
|
|
5895
|
-
example: '1000.00'
|
|
5896
|
-
}
|
|
5897
|
-
},
|
|
5898
|
-
required: ['type', 'currency', 'totalAmount']
|
|
5899
|
-
} as const;
|
|
5900
|
-
|
|
5901
6081
|
export const $NetWorthResponseDto = {
|
|
5902
6082
|
type: 'object',
|
|
5903
6083
|
properties: {
|
|
@@ -6025,11 +6205,66 @@ export const $PlatformGroupDto = {
|
|
|
6025
6205
|
},
|
|
6026
6206
|
totalBalance: {
|
|
6027
6207
|
type: 'string',
|
|
6028
|
-
description: '
|
|
6208
|
+
description: 'FX-converted total balance in base currency',
|
|
6209
|
+
example: '100000.00'
|
|
6210
|
+
},
|
|
6211
|
+
balanceByCurrency: {
|
|
6212
|
+
description: 'Raw (unconverted) balances grouped by currency',
|
|
6213
|
+
type: 'array',
|
|
6214
|
+
items: {
|
|
6215
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
6216
|
+
}
|
|
6217
|
+
},
|
|
6218
|
+
convertedBalance: {
|
|
6219
|
+
type: 'string',
|
|
6220
|
+
description:
|
|
6221
|
+
'Converted balance in base currency (omitted when no currency is convertible)',
|
|
6029
6222
|
example: '100000.00'
|
|
6223
|
+
},
|
|
6224
|
+
sharePct: {
|
|
6225
|
+
type: 'number',
|
|
6226
|
+
description:
|
|
6227
|
+
'Share of the grand converted total (0-100); 0 when grand total is 0',
|
|
6228
|
+
example: 42.5
|
|
6030
6229
|
}
|
|
6031
6230
|
},
|
|
6032
|
-
required: [
|
|
6231
|
+
required: [
|
|
6232
|
+
'platformId',
|
|
6233
|
+
'platformName',
|
|
6234
|
+
'accounts',
|
|
6235
|
+
'totalBalance',
|
|
6236
|
+
'balanceByCurrency',
|
|
6237
|
+
'sharePct'
|
|
6238
|
+
]
|
|
6239
|
+
} as const;
|
|
6240
|
+
|
|
6241
|
+
export const $AccountExchangeRateWarningDto = {
|
|
6242
|
+
type: 'object',
|
|
6243
|
+
properties: {
|
|
6244
|
+
type: {
|
|
6245
|
+
type: 'string',
|
|
6246
|
+
description: 'Warning type',
|
|
6247
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
6248
|
+
},
|
|
6249
|
+
currency: {
|
|
6250
|
+
type: 'string',
|
|
6251
|
+
description: 'Currency without exchange rate',
|
|
6252
|
+
example: 'USD'
|
|
6253
|
+
},
|
|
6254
|
+
accounts: {
|
|
6255
|
+
description: 'Affected account paths',
|
|
6256
|
+
type: 'array',
|
|
6257
|
+
items: {
|
|
6258
|
+
type: 'string'
|
|
6259
|
+
}
|
|
6260
|
+
},
|
|
6261
|
+
totalAmount: {
|
|
6262
|
+
type: 'string',
|
|
6263
|
+
description: 'Total amount in this currency',
|
|
6264
|
+
example: '5000.00'
|
|
6265
|
+
}
|
|
6266
|
+
},
|
|
6267
|
+
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
6033
6268
|
} as const;
|
|
6034
6269
|
|
|
6035
6270
|
export const $AccountsSummaryDto = {
|
|
@@ -6042,9 +6277,21 @@ export const $AccountsSummaryDto = {
|
|
|
6042
6277
|
totalPlatforms: {
|
|
6043
6278
|
type: 'number',
|
|
6044
6279
|
description: 'Total number of platforms'
|
|
6280
|
+
},
|
|
6281
|
+
baseCurrency: {
|
|
6282
|
+
type: 'string',
|
|
6283
|
+
description: 'Base currency for conversion',
|
|
6284
|
+
example: 'CNY'
|
|
6285
|
+
},
|
|
6286
|
+
warnings: {
|
|
6287
|
+
description: 'Per-account exchange rate warnings',
|
|
6288
|
+
type: 'array',
|
|
6289
|
+
items: {
|
|
6290
|
+
$ref: '#/components/schemas/AccountExchangeRateWarningDto'
|
|
6291
|
+
}
|
|
6045
6292
|
}
|
|
6046
6293
|
},
|
|
6047
|
-
required: ['totalAccounts', 'totalPlatforms']
|
|
6294
|
+
required: ['totalAccounts', 'totalPlatforms', 'baseCurrency']
|
|
6048
6295
|
} as const;
|
|
6049
6296
|
|
|
6050
6297
|
export const $AccountsResponseDto = {
|
|
@@ -6175,35 +6422,6 @@ export const $AssetClassGroupDto = {
|
|
|
6175
6422
|
required: ['assetClass', 'accounts', 'balanceByCurrency']
|
|
6176
6423
|
} as const;
|
|
6177
6424
|
|
|
6178
|
-
export const $AccountExchangeRateWarningDto = {
|
|
6179
|
-
type: 'object',
|
|
6180
|
-
properties: {
|
|
6181
|
-
type: {
|
|
6182
|
-
type: 'string',
|
|
6183
|
-
description: 'Warning type',
|
|
6184
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
6185
|
-
},
|
|
6186
|
-
currency: {
|
|
6187
|
-
type: 'string',
|
|
6188
|
-
description: 'Currency without exchange rate',
|
|
6189
|
-
example: 'USD'
|
|
6190
|
-
},
|
|
6191
|
-
accounts: {
|
|
6192
|
-
description: 'Affected account paths',
|
|
6193
|
-
type: 'array',
|
|
6194
|
-
items: {
|
|
6195
|
-
type: 'string'
|
|
6196
|
-
}
|
|
6197
|
-
},
|
|
6198
|
-
totalAmount: {
|
|
6199
|
-
type: 'string',
|
|
6200
|
-
description: 'Total amount in this currency',
|
|
6201
|
-
example: '5000.00'
|
|
6202
|
-
}
|
|
6203
|
-
},
|
|
6204
|
-
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
6205
|
-
} as const;
|
|
6206
|
-
|
|
6207
6425
|
export const $AssetClassSummaryDto = {
|
|
6208
6426
|
type: 'object',
|
|
6209
6427
|
properties: {
|
|
@@ -6483,6 +6701,101 @@ export const $CashFlowResponseDto = {
|
|
|
6483
6701
|
]
|
|
6484
6702
|
} as const;
|
|
6485
6703
|
|
|
6704
|
+
export const $CategoryGroupDto = {
|
|
6705
|
+
type: 'object',
|
|
6706
|
+
properties: {
|
|
6707
|
+
category: {
|
|
6708
|
+
type: 'string',
|
|
6709
|
+
description:
|
|
6710
|
+
'Functional category (account-path Group segment); regional and universal account paths merge under it',
|
|
6711
|
+
example: 'Food'
|
|
6712
|
+
},
|
|
6713
|
+
totalExpense: {
|
|
6714
|
+
type: 'string',
|
|
6715
|
+
description:
|
|
6716
|
+
'Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)',
|
|
6717
|
+
example: '1200.00'
|
|
6718
|
+
},
|
|
6719
|
+
sharePct: {
|
|
6720
|
+
type: 'number',
|
|
6721
|
+
description: 'Share of grand total (0-100); 0 when grand total is 0',
|
|
6722
|
+
example: 42.5
|
|
6723
|
+
},
|
|
6724
|
+
balanceByCurrency: {
|
|
6725
|
+
description: 'Raw (unconverted) expense per currency',
|
|
6726
|
+
type: 'array',
|
|
6727
|
+
items: {
|
|
6728
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
6729
|
+
}
|
|
6730
|
+
},
|
|
6731
|
+
convertedBalance: {
|
|
6732
|
+
type: 'string',
|
|
6733
|
+
description:
|
|
6734
|
+
'Converted total in base currency (omitted when FX missing for all currencies in this category)',
|
|
6735
|
+
example: '1200.00'
|
|
6736
|
+
}
|
|
6737
|
+
},
|
|
6738
|
+
required: ['category', 'totalExpense', 'sharePct', 'balanceByCurrency']
|
|
6739
|
+
} as const;
|
|
6740
|
+
|
|
6741
|
+
export const $ExpensesByCategorySummaryDto = {
|
|
6742
|
+
type: 'object',
|
|
6743
|
+
properties: {
|
|
6744
|
+
totalExpense: {
|
|
6745
|
+
type: 'string',
|
|
6746
|
+
description:
|
|
6747
|
+
'Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income',
|
|
6748
|
+
example: '5000.00'
|
|
6749
|
+
},
|
|
6750
|
+
categoryCount: {
|
|
6751
|
+
type: 'number',
|
|
6752
|
+
description: 'Number of categories',
|
|
6753
|
+
example: 8
|
|
6754
|
+
}
|
|
6755
|
+
},
|
|
6756
|
+
required: ['totalExpense', 'categoryCount']
|
|
6757
|
+
} as const;
|
|
6758
|
+
|
|
6759
|
+
export const $ExpensesByCategoryResponseDto = {
|
|
6760
|
+
type: 'object',
|
|
6761
|
+
properties: {
|
|
6762
|
+
period: {
|
|
6763
|
+
type: 'string',
|
|
6764
|
+
description: 'Period requested',
|
|
6765
|
+
example: '1m'
|
|
6766
|
+
},
|
|
6767
|
+
baseCurrency: {
|
|
6768
|
+
type: 'string',
|
|
6769
|
+
description: 'Base currency for converted values',
|
|
6770
|
+
example: 'CNY'
|
|
6771
|
+
},
|
|
6772
|
+
groups: {
|
|
6773
|
+
description:
|
|
6774
|
+
'Expense groups by functional category, sorted by converted total desc',
|
|
6775
|
+
type: 'array',
|
|
6776
|
+
items: {
|
|
6777
|
+
$ref: '#/components/schemas/CategoryGroupDto'
|
|
6778
|
+
}
|
|
6779
|
+
},
|
|
6780
|
+
summary: {
|
|
6781
|
+
description: 'Summary statistics',
|
|
6782
|
+
allOf: [
|
|
6783
|
+
{
|
|
6784
|
+
$ref: '#/components/schemas/ExpensesByCategorySummaryDto'
|
|
6785
|
+
}
|
|
6786
|
+
]
|
|
6787
|
+
},
|
|
6788
|
+
warnings: {
|
|
6789
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
6790
|
+
type: 'array',
|
|
6791
|
+
items: {
|
|
6792
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
6793
|
+
}
|
|
6794
|
+
}
|
|
6795
|
+
},
|
|
6796
|
+
required: ['period', 'baseCurrency', 'groups', 'summary']
|
|
6797
|
+
} as const;
|
|
6798
|
+
|
|
6486
6799
|
export const $MonetaryDto = {
|
|
6487
6800
|
type: 'object',
|
|
6488
6801
|
properties: {
|
|
@@ -6964,6 +7277,16 @@ export const $TimeSeriesPointDto = {
|
|
|
6964
7277
|
description: 'Change from previous point',
|
|
6965
7278
|
example: '5000.00'
|
|
6966
7279
|
},
|
|
7280
|
+
assets: {
|
|
7281
|
+
type: 'string',
|
|
7282
|
+
description: 'Total assets at this date (in base currency)',
|
|
7283
|
+
example: '494338.00'
|
|
7284
|
+
},
|
|
7285
|
+
liabilities: {
|
|
7286
|
+
type: 'string',
|
|
7287
|
+
description: 'Total liabilities at this date (in base currency)',
|
|
7288
|
+
example: '310098.00'
|
|
7289
|
+
},
|
|
6967
7290
|
byCurrency: {
|
|
6968
7291
|
description: 'Multi-currency breakdown for this point',
|
|
6969
7292
|
type: 'array',
|
|
@@ -7073,6 +7396,111 @@ export const $PortfolioTrendsResponseDto = {
|
|
|
7073
7396
|
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
7074
7397
|
} as const;
|
|
7075
7398
|
|
|
7399
|
+
export const $CashFlowPointDto = {
|
|
7400
|
+
type: 'object',
|
|
7401
|
+
properties: {
|
|
7402
|
+
month: {
|
|
7403
|
+
type: 'string',
|
|
7404
|
+
description: 'Month key (YYYY-MM)',
|
|
7405
|
+
example: '2024-03'
|
|
7406
|
+
},
|
|
7407
|
+
income: {
|
|
7408
|
+
type: 'string',
|
|
7409
|
+
description: 'Income in base currency (absolute, converted)',
|
|
7410
|
+
example: '10000.00'
|
|
7411
|
+
},
|
|
7412
|
+
expense: {
|
|
7413
|
+
type: 'string',
|
|
7414
|
+
description: 'Expense in base currency (absolute, converted)',
|
|
7415
|
+
example: '5000.00'
|
|
7416
|
+
},
|
|
7417
|
+
netSavings: {
|
|
7418
|
+
type: 'string',
|
|
7419
|
+
description: 'netSavings = income − expense (savings positive)',
|
|
7420
|
+
example: '5000.00'
|
|
7421
|
+
}
|
|
7422
|
+
},
|
|
7423
|
+
required: ['month', 'income', 'expense', 'netSavings']
|
|
7424
|
+
} as const;
|
|
7425
|
+
|
|
7426
|
+
export const $CashFlowTrendSummaryDto = {
|
|
7427
|
+
type: 'object',
|
|
7428
|
+
properties: {
|
|
7429
|
+
totalIncome: {
|
|
7430
|
+
type: 'string',
|
|
7431
|
+
description: 'Total income across the period',
|
|
7432
|
+
example: '60000.00'
|
|
7433
|
+
},
|
|
7434
|
+
totalExpense: {
|
|
7435
|
+
type: 'string',
|
|
7436
|
+
description: 'Total expense across the period',
|
|
7437
|
+
example: '30000.00'
|
|
7438
|
+
},
|
|
7439
|
+
totalNetSavings: {
|
|
7440
|
+
type: 'string',
|
|
7441
|
+
description: 'income − expense across the period',
|
|
7442
|
+
example: '30000.00'
|
|
7443
|
+
},
|
|
7444
|
+
averageMonthlyNetSavings: {
|
|
7445
|
+
type: 'string',
|
|
7446
|
+
description:
|
|
7447
|
+
'totalNetSavings divided by the window length (N months, incl. zero-filled)',
|
|
7448
|
+
example: '5000.00'
|
|
7449
|
+
}
|
|
7450
|
+
},
|
|
7451
|
+
required: [
|
|
7452
|
+
'totalIncome',
|
|
7453
|
+
'totalExpense',
|
|
7454
|
+
'totalNetSavings',
|
|
7455
|
+
'averageMonthlyNetSavings'
|
|
7456
|
+
]
|
|
7457
|
+
} as const;
|
|
7458
|
+
|
|
7459
|
+
export const $CashFlowTrendsResponseDto = {
|
|
7460
|
+
type: 'object',
|
|
7461
|
+
properties: {
|
|
7462
|
+
series: {
|
|
7463
|
+
description:
|
|
7464
|
+
'Monthly cash-flow series (fixed N-month window, zero-filled)',
|
|
7465
|
+
type: 'array',
|
|
7466
|
+
items: {
|
|
7467
|
+
$ref: '#/components/schemas/CashFlowPointDto'
|
|
7468
|
+
}
|
|
7469
|
+
},
|
|
7470
|
+
summary: {
|
|
7471
|
+
description: 'Period totals',
|
|
7472
|
+
allOf: [
|
|
7473
|
+
{
|
|
7474
|
+
$ref: '#/components/schemas/CashFlowTrendSummaryDto'
|
|
7475
|
+
}
|
|
7476
|
+
]
|
|
7477
|
+
},
|
|
7478
|
+
period: {
|
|
7479
|
+
type: 'string',
|
|
7480
|
+
description: 'Period requested',
|
|
7481
|
+
example: '6m'
|
|
7482
|
+
},
|
|
7483
|
+
granularity: {
|
|
7484
|
+
type: 'string',
|
|
7485
|
+
description: 'Data granularity (v1 returns month buckets)',
|
|
7486
|
+
example: 'month'
|
|
7487
|
+
},
|
|
7488
|
+
currency: {
|
|
7489
|
+
type: 'string',
|
|
7490
|
+
description: 'Base currency for converted values',
|
|
7491
|
+
example: 'CNY'
|
|
7492
|
+
},
|
|
7493
|
+
warnings: {
|
|
7494
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
7495
|
+
type: 'array',
|
|
7496
|
+
items: {
|
|
7497
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
7498
|
+
}
|
|
7499
|
+
}
|
|
7500
|
+
},
|
|
7501
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
7502
|
+
} as const;
|
|
7503
|
+
|
|
7076
7504
|
export const $GenerateSnapshotBody = {
|
|
7077
7505
|
type: 'object',
|
|
7078
7506
|
properties: {}
|