@firela/api-types 0.0.0-canary.09a8ff4c → 0.0.0-canary.0f069763
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 +1285 -621
- package/dist/index.d.ts +1285 -621
- package/dist/index.js +31 -3
- package/dist/index.mjs +31 -3
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +1239 -558
- package/src/generated/services.gen.ts +675 -362
- package/src/generated/types.gen.ts +1401 -664
|
@@ -6,18 +6,12 @@ export const $CreateAccountDto = {
|
|
|
6
6
|
path: {
|
|
7
7
|
type: 'string',
|
|
8
8
|
description: 'Account path (hierarchical, colon-separated)',
|
|
9
|
-
example: 'Assets:CN:
|
|
10
|
-
},
|
|
11
|
-
displayName: {
|
|
12
|
-
type: 'string',
|
|
13
|
-
description:
|
|
14
|
-
'Display name to distinguish accounts at the same path (default: "")',
|
|
15
|
-
example: '工资卡'
|
|
9
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
16
10
|
},
|
|
17
11
|
openDate: {
|
|
18
12
|
format: 'date-time',
|
|
19
13
|
type: 'string',
|
|
20
|
-
description: 'Account open date',
|
|
14
|
+
description: 'Account open date (server defaults to today)',
|
|
21
15
|
example: '2024-01-01'
|
|
22
16
|
},
|
|
23
17
|
currencies: {
|
|
@@ -45,26 +39,22 @@ export const $CreateAccountDto = {
|
|
|
45
39
|
templatePath: {
|
|
46
40
|
type: 'string',
|
|
47
41
|
description: 'Reference to account-standards template path',
|
|
48
|
-
example: 'Assets:CN:
|
|
42
|
+
example: 'Assets:CN:Checking'
|
|
49
43
|
},
|
|
50
44
|
isCustom: {
|
|
51
45
|
type: 'boolean',
|
|
52
46
|
description: 'Whether this is a custom (user-created) account',
|
|
53
47
|
default: false
|
|
54
48
|
},
|
|
55
|
-
i18nKey: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
description: 'i18n key for display name (overrides template)',
|
|
58
|
-
example: 'account.custom.mybank'
|
|
59
|
-
},
|
|
60
49
|
icon: {
|
|
61
50
|
type: 'string',
|
|
62
51
|
description: 'Icon identifier (overrides template)',
|
|
63
52
|
example: 'bank-custom'
|
|
64
53
|
},
|
|
65
|
-
|
|
54
|
+
openDirectiveMeta: {
|
|
66
55
|
type: 'object',
|
|
67
|
-
description:
|
|
56
|
+
description:
|
|
57
|
+
'Open directive metadata (NOT an opening-balance amount — use the opening-balance endpoint)',
|
|
68
58
|
example: {
|
|
69
59
|
branch: 'Downtown',
|
|
70
60
|
accountNumber: '1234'
|
|
@@ -76,7 +66,7 @@ export const $CreateAccountDto = {
|
|
|
76
66
|
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
77
67
|
}
|
|
78
68
|
},
|
|
79
|
-
required: ['path'
|
|
69
|
+
required: ['path']
|
|
80
70
|
} as const;
|
|
81
71
|
|
|
82
72
|
export const $AccountResponseDto = {
|
|
@@ -90,13 +80,7 @@ export const $AccountResponseDto = {
|
|
|
90
80
|
path: {
|
|
91
81
|
type: 'string',
|
|
92
82
|
description: 'Account path (hierarchical, colon-separated)',
|
|
93
|
-
example: 'Assets:CN:
|
|
94
|
-
},
|
|
95
|
-
displayName: {
|
|
96
|
-
type: 'string',
|
|
97
|
-
description:
|
|
98
|
-
'Display name distinguishing multiple accounts at the same path',
|
|
99
|
-
example: '工资卡'
|
|
83
|
+
example: 'Assets:CN:ICBC:Checking'
|
|
100
84
|
},
|
|
101
85
|
type: {
|
|
102
86
|
type: 'string',
|
|
@@ -145,26 +129,26 @@ export const $AccountResponseDto = {
|
|
|
145
129
|
templatePath: {
|
|
146
130
|
type: 'string',
|
|
147
131
|
description: 'Template path reference',
|
|
148
|
-
example: 'Assets:CN:
|
|
132
|
+
example: 'Assets:CN:Checking'
|
|
149
133
|
},
|
|
150
134
|
isCustom: {
|
|
151
135
|
type: 'boolean',
|
|
152
136
|
description: 'Whether this is a custom (user-created) account',
|
|
153
137
|
example: false
|
|
154
138
|
},
|
|
155
|
-
|
|
139
|
+
displayName: {
|
|
156
140
|
type: 'string',
|
|
157
|
-
description: '
|
|
158
|
-
example: '
|
|
141
|
+
description: 'Localized display name (ADR-0114, read-time projection)',
|
|
142
|
+
example: 'Checking'
|
|
159
143
|
},
|
|
160
144
|
icon: {
|
|
161
145
|
type: 'string',
|
|
162
146
|
description: 'Icon identifier',
|
|
163
147
|
example: 'bank-icbc'
|
|
164
148
|
},
|
|
165
|
-
|
|
149
|
+
openDirectiveMeta: {
|
|
166
150
|
type: 'object',
|
|
167
|
-
description: '
|
|
151
|
+
description: 'Open directive metadata (ADR-0115 Decision 9)',
|
|
168
152
|
example: {
|
|
169
153
|
branch: 'Downtown'
|
|
170
154
|
}
|
|
@@ -192,7 +176,6 @@ export const $AccountResponseDto = {
|
|
|
192
176
|
required: [
|
|
193
177
|
'id',
|
|
194
178
|
'path',
|
|
195
|
-
'displayName',
|
|
196
179
|
'type',
|
|
197
180
|
'status',
|
|
198
181
|
'openDate',
|
|
@@ -225,11 +208,6 @@ export const $AccountListResponseDto = {
|
|
|
225
208
|
export const $UpdateAccountDto = {
|
|
226
209
|
type: 'object',
|
|
227
210
|
properties: {
|
|
228
|
-
displayName: {
|
|
229
|
-
type: 'string',
|
|
230
|
-
description: 'Display name to distinguish accounts at the same path',
|
|
231
|
-
example: '招行工资卡'
|
|
232
|
-
},
|
|
233
211
|
currencies: {
|
|
234
212
|
description: 'Allowed currencies (null = no restriction)',
|
|
235
213
|
example: ['CNY', 'USD'],
|
|
@@ -251,19 +229,15 @@ export const $UpdateAccountDto = {
|
|
|
251
229
|
'NONE'
|
|
252
230
|
]
|
|
253
231
|
},
|
|
254
|
-
i18nKey: {
|
|
255
|
-
type: 'string',
|
|
256
|
-
description: 'i18n key for display name',
|
|
257
|
-
example: 'account.custom.mybank'
|
|
258
|
-
},
|
|
259
232
|
icon: {
|
|
260
233
|
type: 'string',
|
|
261
234
|
description: 'Icon identifier',
|
|
262
235
|
example: 'bank-custom'
|
|
263
236
|
},
|
|
264
|
-
|
|
237
|
+
openDirectiveMeta: {
|
|
265
238
|
type: 'object',
|
|
266
|
-
description:
|
|
239
|
+
description:
|
|
240
|
+
'Open directive metadata (merged with existing; NOT an opening-balance amount)',
|
|
267
241
|
example: {
|
|
268
242
|
branch: 'Uptown'
|
|
269
243
|
}
|
|
@@ -310,13 +284,47 @@ export const $ReopenAccountDto = {
|
|
|
310
284
|
}
|
|
311
285
|
} as const;
|
|
312
286
|
|
|
287
|
+
export const $CreateOpeningBalanceDto = {
|
|
288
|
+
type: 'object',
|
|
289
|
+
properties: {
|
|
290
|
+
amount: {
|
|
291
|
+
type: 'number',
|
|
292
|
+
description: 'Opening balance amount (non-negative)',
|
|
293
|
+
example: 1000
|
|
294
|
+
},
|
|
295
|
+
currency: {
|
|
296
|
+
type: 'string',
|
|
297
|
+
description: 'Currency code',
|
|
298
|
+
example: 'CNY'
|
|
299
|
+
},
|
|
300
|
+
date: {
|
|
301
|
+
format: 'date-time',
|
|
302
|
+
type: 'string',
|
|
303
|
+
description: 'Opening-balance date (defaults to now)',
|
|
304
|
+
example: '2024-01-01'
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
required: ['amount', 'currency']
|
|
308
|
+
} as const;
|
|
309
|
+
|
|
310
|
+
export const $OpeningBalanceResultDto = {
|
|
311
|
+
type: 'object',
|
|
312
|
+
properties: {
|
|
313
|
+
transactionId: {
|
|
314
|
+
type: 'string',
|
|
315
|
+
description: 'Created opening-balance transaction id.'
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
required: ['transactionId']
|
|
319
|
+
} as const;
|
|
320
|
+
|
|
313
321
|
export const $AccountStandardResponseDto = {
|
|
314
322
|
type: 'object',
|
|
315
323
|
properties: {
|
|
316
324
|
path: {
|
|
317
325
|
type: 'string',
|
|
318
326
|
description: 'Account path (hierarchical, colon-separated)',
|
|
319
|
-
example: 'Assets:CN:
|
|
327
|
+
example: 'Assets:CN:Checking'
|
|
320
328
|
},
|
|
321
329
|
type: {
|
|
322
330
|
type: 'string',
|
|
@@ -324,11 +332,6 @@ export const $AccountStandardResponseDto = {
|
|
|
324
332
|
enum: ['Assets', 'Liabilities', 'Income', 'Expenses', 'Equity'],
|
|
325
333
|
example: 'Assets'
|
|
326
334
|
},
|
|
327
|
-
i18nKey: {
|
|
328
|
-
type: 'string',
|
|
329
|
-
description: 'i18n key for localized display name',
|
|
330
|
-
example: 'account.assets.cn.bank.icbc.checking'
|
|
331
|
-
},
|
|
332
335
|
name: {
|
|
333
336
|
type: 'string',
|
|
334
337
|
description: 'Short localized display name',
|
|
@@ -353,7 +356,7 @@ export const $AccountStandardResponseDto = {
|
|
|
353
356
|
example: 'bank-icbc'
|
|
354
357
|
}
|
|
355
358
|
},
|
|
356
|
-
required: ['path', 'type', '
|
|
359
|
+
required: ['path', 'type', 'description', 'tags', 'icon']
|
|
357
360
|
} as const;
|
|
358
361
|
|
|
359
362
|
export const $AccountStandardListResponseDto = {
|
|
@@ -383,18 +386,13 @@ export const $AccountStandardListResponseDto = {
|
|
|
383
386
|
export const $TemplateMetadataDto = {
|
|
384
387
|
type: 'object',
|
|
385
388
|
properties: {
|
|
386
|
-
extendable: {
|
|
387
|
-
type: 'boolean',
|
|
388
|
-
description: 'Whether this path can be extended',
|
|
389
|
-
example: true
|
|
390
|
-
},
|
|
391
389
|
rootType: {
|
|
392
390
|
type: 'string',
|
|
393
391
|
description: 'Root account type',
|
|
394
392
|
example: 'Assets'
|
|
395
393
|
}
|
|
396
394
|
},
|
|
397
|
-
required: ['
|
|
395
|
+
required: ['rootType']
|
|
398
396
|
} as const;
|
|
399
397
|
|
|
400
398
|
export const $TemplateMetadataResponseDto = {
|
|
@@ -533,7 +531,7 @@ export const $CreatePostingDto = {
|
|
|
533
531
|
type: 'string',
|
|
534
532
|
description:
|
|
535
533
|
'Account name in Beancount format (must start with uppercase, colon-separated)',
|
|
536
|
-
example: 'Assets:
|
|
534
|
+
example: 'Assets:Checking'
|
|
537
535
|
},
|
|
538
536
|
units: {
|
|
539
537
|
type: 'string',
|
|
@@ -692,7 +690,7 @@ export const $PostingResponseDto = {
|
|
|
692
690
|
account: {
|
|
693
691
|
type: 'string',
|
|
694
692
|
description: 'Account name',
|
|
695
|
-
example: 'Assets:
|
|
693
|
+
example: 'Assets:Checking'
|
|
696
694
|
},
|
|
697
695
|
units: {
|
|
698
696
|
type: 'string',
|
|
@@ -1058,7 +1056,7 @@ export const $PostingDetailDto = {
|
|
|
1058
1056
|
account: {
|
|
1059
1057
|
type: 'string',
|
|
1060
1058
|
description: 'Fully-qualified Beancount account path',
|
|
1061
|
-
example: 'Assets:
|
|
1059
|
+
example: 'Assets:Checking'
|
|
1062
1060
|
},
|
|
1063
1061
|
units: {
|
|
1064
1062
|
type: 'string',
|
|
@@ -1247,6 +1245,77 @@ export const $TransactionDetailDto = {
|
|
|
1247
1245
|
]
|
|
1248
1246
|
} as const;
|
|
1249
1247
|
|
|
1248
|
+
export const $BalanceByCurrencyDto = {
|
|
1249
|
+
type: 'object',
|
|
1250
|
+
properties: {
|
|
1251
|
+
currency: {
|
|
1252
|
+
type: 'string',
|
|
1253
|
+
description: 'ISO 4217 currency code',
|
|
1254
|
+
example: 'CNY'
|
|
1255
|
+
},
|
|
1256
|
+
balance: {
|
|
1257
|
+
type: 'string',
|
|
1258
|
+
description: 'Balance amount',
|
|
1259
|
+
example: '50000.00'
|
|
1260
|
+
}
|
|
1261
|
+
},
|
|
1262
|
+
required: ['currency', 'balance']
|
|
1263
|
+
} as const;
|
|
1264
|
+
|
|
1265
|
+
export const $ExchangeRateWarningDto = {
|
|
1266
|
+
type: 'object',
|
|
1267
|
+
properties: {
|
|
1268
|
+
type: {
|
|
1269
|
+
type: 'string',
|
|
1270
|
+
description: 'Warning type',
|
|
1271
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
1272
|
+
},
|
|
1273
|
+
currency: {
|
|
1274
|
+
type: 'string',
|
|
1275
|
+
description: 'Currency without exchange rate',
|
|
1276
|
+
example: 'EUR'
|
|
1277
|
+
},
|
|
1278
|
+
totalAmount: {
|
|
1279
|
+
type: 'string',
|
|
1280
|
+
description: 'Total amount affected',
|
|
1281
|
+
example: '1000.00'
|
|
1282
|
+
}
|
|
1283
|
+
},
|
|
1284
|
+
required: ['type', 'currency', 'totalAmount']
|
|
1285
|
+
} as const;
|
|
1286
|
+
|
|
1287
|
+
export const $TransactionListSummaryDto = {
|
|
1288
|
+
type: 'object',
|
|
1289
|
+
properties: {
|
|
1290
|
+
totalAmount: {
|
|
1291
|
+
type: 'string',
|
|
1292
|
+
description:
|
|
1293
|
+
'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.',
|
|
1294
|
+
example: '-6000.00'
|
|
1295
|
+
},
|
|
1296
|
+
currency: {
|
|
1297
|
+
type: 'string',
|
|
1298
|
+
description: 'Base currency (ISO 4217)',
|
|
1299
|
+
example: 'CNY'
|
|
1300
|
+
},
|
|
1301
|
+
balanceByCurrency: {
|
|
1302
|
+
description: 'Raw (unconverted) balance per currency',
|
|
1303
|
+
type: 'array',
|
|
1304
|
+
items: {
|
|
1305
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
1306
|
+
}
|
|
1307
|
+
},
|
|
1308
|
+
warnings: {
|
|
1309
|
+
description: 'Currencies missing an FX rate (omitted when empty)',
|
|
1310
|
+
type: 'array',
|
|
1311
|
+
items: {
|
|
1312
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
required: ['totalAmount', 'currency', 'balanceByCurrency']
|
|
1317
|
+
} as const;
|
|
1318
|
+
|
|
1250
1319
|
export const $TransactionListResponseDto = {
|
|
1251
1320
|
type: 'object',
|
|
1252
1321
|
properties: {
|
|
@@ -1271,6 +1340,15 @@ export const $TransactionListResponseDto = {
|
|
|
1271
1340
|
type: 'number',
|
|
1272
1341
|
description: 'Number of items skipped',
|
|
1273
1342
|
example: 0
|
|
1343
|
+
},
|
|
1344
|
+
summary: {
|
|
1345
|
+
description:
|
|
1346
|
+
'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.',
|
|
1347
|
+
allOf: [
|
|
1348
|
+
{
|
|
1349
|
+
$ref: '#/components/schemas/TransactionListSummaryDto'
|
|
1350
|
+
}
|
|
1351
|
+
]
|
|
1274
1352
|
}
|
|
1275
1353
|
},
|
|
1276
1354
|
required: ['data', 'total', 'limit', 'offset']
|
|
@@ -1370,7 +1448,7 @@ export const $BalanceResponseDto = {
|
|
|
1370
1448
|
account: {
|
|
1371
1449
|
type: 'string',
|
|
1372
1450
|
description: 'Account name',
|
|
1373
|
-
example: 'Assets:
|
|
1451
|
+
example: 'Assets:Checking'
|
|
1374
1452
|
},
|
|
1375
1453
|
balance: {
|
|
1376
1454
|
type: 'string',
|
|
@@ -1397,7 +1475,7 @@ export const $MultiCurrencyBalanceResponseDto = {
|
|
|
1397
1475
|
account: {
|
|
1398
1476
|
type: 'string',
|
|
1399
1477
|
description: 'Account name',
|
|
1400
|
-
example: 'Assets:
|
|
1478
|
+
example: 'Assets:Checking'
|
|
1401
1479
|
},
|
|
1402
1480
|
balances: {
|
|
1403
1481
|
type: 'object',
|
|
@@ -1453,7 +1531,7 @@ export const $TransactionSummaryDto = {
|
|
|
1453
1531
|
accountName: {
|
|
1454
1532
|
type: 'string',
|
|
1455
1533
|
description: 'Source account name (first posting)',
|
|
1456
|
-
example: 'Assets:
|
|
1534
|
+
example: 'Assets:Checking'
|
|
1457
1535
|
},
|
|
1458
1536
|
sourceType: {
|
|
1459
1537
|
type: 'string',
|
|
@@ -2745,127 +2823,284 @@ export const $UpdateCommodityDto = {
|
|
|
2745
2823
|
}
|
|
2746
2824
|
} as const;
|
|
2747
2825
|
|
|
2748
|
-
export const $
|
|
2826
|
+
export const $CreateBeanPriceDto = {
|
|
2749
2827
|
type: 'object',
|
|
2750
2828
|
properties: {
|
|
2751
|
-
name: {
|
|
2752
|
-
type: 'string',
|
|
2753
|
-
description: 'Rule name (unique per user)',
|
|
2754
|
-
maxLength: 100
|
|
2755
|
-
},
|
|
2756
|
-
icon: {
|
|
2757
|
-
type: 'string',
|
|
2758
|
-
description: 'Icon emoji',
|
|
2759
|
-
maxLength: 10
|
|
2760
|
-
},
|
|
2761
|
-
frequency: {
|
|
2762
|
-
type: 'string',
|
|
2763
|
-
description: 'Recurring frequency',
|
|
2764
|
-
enum: [
|
|
2765
|
-
'WEEKLY',
|
|
2766
|
-
'BIWEEKLY',
|
|
2767
|
-
'MONTHLY',
|
|
2768
|
-
'BIMONTHLY',
|
|
2769
|
-
'QUARTERLY',
|
|
2770
|
-
'YEARLY',
|
|
2771
|
-
'CUSTOM'
|
|
2772
|
-
]
|
|
2773
|
-
},
|
|
2774
|
-
expectedAmount: {
|
|
2775
|
-
type: 'number',
|
|
2776
|
-
description: 'Expected amount (positive number)',
|
|
2777
|
-
minimum: 0
|
|
2778
|
-
},
|
|
2779
|
-
expectedDay: {
|
|
2780
|
-
type: 'number',
|
|
2781
|
-
description: 'Expected day of month (1-31)',
|
|
2782
|
-
minimum: 1,
|
|
2783
|
-
maximum: 31
|
|
2784
|
-
},
|
|
2785
|
-
customIntervalDays: {
|
|
2786
|
-
type: 'number',
|
|
2787
|
-
description: 'Custom interval in days (required for CUSTOM frequency)',
|
|
2788
|
-
minimum: 1
|
|
2789
|
-
},
|
|
2790
2829
|
currency: {
|
|
2791
2830
|
type: 'string',
|
|
2792
|
-
description: 'Currency
|
|
2793
|
-
|
|
2794
|
-
maxLength: 10
|
|
2831
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2832
|
+
example: 'USD'
|
|
2795
2833
|
},
|
|
2796
|
-
|
|
2834
|
+
quoteCurrency: {
|
|
2797
2835
|
type: 'string',
|
|
2798
|
-
description: '
|
|
2799
|
-
|
|
2836
|
+
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
2837
|
+
example: 'CNY'
|
|
2800
2838
|
},
|
|
2801
|
-
|
|
2839
|
+
amount: {
|
|
2802
2840
|
type: 'number',
|
|
2803
|
-
description:
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
},
|
|
2808
|
-
defaultExpenseAccount: {
|
|
2809
|
-
type: 'string',
|
|
2810
|
-
description: 'Default expense account for auto-create',
|
|
2811
|
-
maxLength: 200
|
|
2812
|
-
},
|
|
2813
|
-
defaultPaymentAccount: {
|
|
2814
|
-
type: 'string',
|
|
2815
|
-
description: 'Default payment account for auto-create',
|
|
2816
|
-
maxLength: 200
|
|
2817
|
-
},
|
|
2818
|
-
defaultPayee: {
|
|
2819
|
-
type: 'string',
|
|
2820
|
-
description: 'Default payee for auto-create',
|
|
2821
|
-
maxLength: 200
|
|
2822
|
-
},
|
|
2823
|
-
autoCreate: {
|
|
2824
|
-
type: 'boolean',
|
|
2825
|
-
description: 'Auto-create transaction when expected date arrives',
|
|
2826
|
-
default: false
|
|
2841
|
+
description:
|
|
2842
|
+
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
2843
|
+
example: 175.5,
|
|
2844
|
+
minimum: 0
|
|
2827
2845
|
},
|
|
2828
|
-
|
|
2846
|
+
date: {
|
|
2829
2847
|
type: 'string',
|
|
2830
|
-
description: '
|
|
2848
|
+
description: 'Price date (ISO 8601 format)',
|
|
2849
|
+
example: '2024-11-05'
|
|
2831
2850
|
},
|
|
2832
|
-
|
|
2833
|
-
type: '
|
|
2834
|
-
description:
|
|
2851
|
+
metadata: {
|
|
2852
|
+
type: 'object',
|
|
2853
|
+
description:
|
|
2854
|
+
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
2855
|
+
example: {
|
|
2856
|
+
source: 'MANUAL',
|
|
2857
|
+
note: 'Bank valuation report',
|
|
2858
|
+
confidence: 0.95
|
|
2859
|
+
}
|
|
2835
2860
|
}
|
|
2836
2861
|
},
|
|
2837
|
-
required: [
|
|
2838
|
-
'name',
|
|
2839
|
-
'frequency',
|
|
2840
|
-
'expectedAmount',
|
|
2841
|
-
'currency',
|
|
2842
|
-
'matchAmountTolerance',
|
|
2843
|
-
'autoCreate'
|
|
2844
|
-
]
|
|
2862
|
+
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
2845
2863
|
} as const;
|
|
2846
2864
|
|
|
2847
|
-
export const $
|
|
2865
|
+
export const $PriceResponseDto = {
|
|
2848
2866
|
type: 'object',
|
|
2849
2867
|
properties: {
|
|
2850
2868
|
id: {
|
|
2851
2869
|
type: 'string',
|
|
2852
|
-
description: '
|
|
2870
|
+
description: 'Unique identifier',
|
|
2871
|
+
example: 'uuid-123-456'
|
|
2853
2872
|
},
|
|
2854
2873
|
userId: {
|
|
2855
2874
|
type: 'string',
|
|
2856
|
-
description: 'User ID'
|
|
2875
|
+
description: 'User ID (owner of the price)',
|
|
2876
|
+
example: 'user-123'
|
|
2857
2877
|
},
|
|
2858
|
-
|
|
2878
|
+
currency: {
|
|
2859
2879
|
type: 'string',
|
|
2860
|
-
description: '
|
|
2861
|
-
|
|
2862
|
-
icon: {
|
|
2863
|
-
type: 'object',
|
|
2864
|
-
description: 'Icon emoji'
|
|
2880
|
+
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
2881
|
+
example: 'BTC'
|
|
2865
2882
|
},
|
|
2866
|
-
|
|
2883
|
+
quoteCurrency: {
|
|
2867
2884
|
type: 'string',
|
|
2868
|
-
description: '
|
|
2885
|
+
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
2886
|
+
example: 'USD'
|
|
2887
|
+
},
|
|
2888
|
+
amount: {
|
|
2889
|
+
type: 'number',
|
|
2890
|
+
description:
|
|
2891
|
+
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
2892
|
+
example: 50000
|
|
2893
|
+
},
|
|
2894
|
+
date: {
|
|
2895
|
+
type: 'string',
|
|
2896
|
+
description:
|
|
2897
|
+
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
2898
|
+
example: '2024-01-01',
|
|
2899
|
+
format: 'date'
|
|
2900
|
+
},
|
|
2901
|
+
meta: {
|
|
2902
|
+
type: 'object',
|
|
2903
|
+
description:
|
|
2904
|
+
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
2905
|
+
example: {
|
|
2906
|
+
source: 'MANUAL',
|
|
2907
|
+
note: 'User-defined price',
|
|
2908
|
+
confidence: 1
|
|
2909
|
+
}
|
|
2910
|
+
},
|
|
2911
|
+
createdAt: {
|
|
2912
|
+
format: 'date-time',
|
|
2913
|
+
type: 'string',
|
|
2914
|
+
description: 'Creation timestamp',
|
|
2915
|
+
example: '2024-11-03T10:00:00Z'
|
|
2916
|
+
},
|
|
2917
|
+
updatedAt: {
|
|
2918
|
+
format: 'date-time',
|
|
2919
|
+
type: 'string',
|
|
2920
|
+
description: 'Last update timestamp',
|
|
2921
|
+
example: '2024-11-03T10:00:00Z'
|
|
2922
|
+
}
|
|
2923
|
+
},
|
|
2924
|
+
required: [
|
|
2925
|
+
'id',
|
|
2926
|
+
'userId',
|
|
2927
|
+
'currency',
|
|
2928
|
+
'quoteCurrency',
|
|
2929
|
+
'amount',
|
|
2930
|
+
'date',
|
|
2931
|
+
'meta',
|
|
2932
|
+
'createdAt',
|
|
2933
|
+
'updatedAt'
|
|
2934
|
+
]
|
|
2935
|
+
} as const;
|
|
2936
|
+
|
|
2937
|
+
export const $PriceListResponseDto = {
|
|
2938
|
+
type: 'object',
|
|
2939
|
+
properties: {
|
|
2940
|
+
items: {
|
|
2941
|
+
description: 'List of prices',
|
|
2942
|
+
type: 'array',
|
|
2943
|
+
items: {
|
|
2944
|
+
$ref: '#/components/schemas/PriceResponseDto'
|
|
2945
|
+
}
|
|
2946
|
+
},
|
|
2947
|
+
total: {
|
|
2948
|
+
type: 'number',
|
|
2949
|
+
description: 'Total number of prices',
|
|
2950
|
+
example: 42
|
|
2951
|
+
}
|
|
2952
|
+
},
|
|
2953
|
+
required: ['items', 'total']
|
|
2954
|
+
} as const;
|
|
2955
|
+
|
|
2956
|
+
export const $UpdateBeanPriceDto = {
|
|
2957
|
+
type: 'object',
|
|
2958
|
+
properties: {
|
|
2959
|
+
currency: {
|
|
2960
|
+
type: 'string',
|
|
2961
|
+
description: 'Currency being priced'
|
|
2962
|
+
},
|
|
2963
|
+
quoteCurrency: {
|
|
2964
|
+
type: 'string',
|
|
2965
|
+
description: 'Quote currency (pricing currency)'
|
|
2966
|
+
},
|
|
2967
|
+
amount: {
|
|
2968
|
+
type: 'number',
|
|
2969
|
+
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
2970
|
+
minimum: 0
|
|
2971
|
+
},
|
|
2972
|
+
date: {
|
|
2973
|
+
type: 'string',
|
|
2974
|
+
description: 'Price date (ISO 8601 format)'
|
|
2975
|
+
},
|
|
2976
|
+
metadata: {
|
|
2977
|
+
type: 'object',
|
|
2978
|
+
description: 'Metadata'
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
} as const;
|
|
2982
|
+
|
|
2983
|
+
export const $CreateRecurringRuleDto = {
|
|
2984
|
+
type: 'object',
|
|
2985
|
+
properties: {
|
|
2986
|
+
name: {
|
|
2987
|
+
type: 'string',
|
|
2988
|
+
description: 'Rule name (unique per user)',
|
|
2989
|
+
maxLength: 100
|
|
2990
|
+
},
|
|
2991
|
+
icon: {
|
|
2992
|
+
type: 'string',
|
|
2993
|
+
description: 'Icon emoji',
|
|
2994
|
+
maxLength: 10
|
|
2995
|
+
},
|
|
2996
|
+
frequency: {
|
|
2997
|
+
type: 'string',
|
|
2998
|
+
description: 'Recurring frequency',
|
|
2999
|
+
enum: [
|
|
3000
|
+
'WEEKLY',
|
|
3001
|
+
'BIWEEKLY',
|
|
3002
|
+
'MONTHLY',
|
|
3003
|
+
'BIMONTHLY',
|
|
3004
|
+
'QUARTERLY',
|
|
3005
|
+
'YEARLY',
|
|
3006
|
+
'CUSTOM'
|
|
3007
|
+
]
|
|
3008
|
+
},
|
|
3009
|
+
expectedAmount: {
|
|
3010
|
+
type: 'number',
|
|
3011
|
+
description: 'Expected amount (positive number)',
|
|
3012
|
+
minimum: 0
|
|
3013
|
+
},
|
|
3014
|
+
expectedDay: {
|
|
3015
|
+
type: 'number',
|
|
3016
|
+
description: 'Expected day of month (1-31)',
|
|
3017
|
+
minimum: 1,
|
|
3018
|
+
maximum: 31
|
|
3019
|
+
},
|
|
3020
|
+
customIntervalDays: {
|
|
3021
|
+
type: 'number',
|
|
3022
|
+
description: 'Custom interval in days (required for CUSTOM frequency)',
|
|
3023
|
+
minimum: 1
|
|
3024
|
+
},
|
|
3025
|
+
currency: {
|
|
3026
|
+
type: 'string',
|
|
3027
|
+
description: 'Currency code',
|
|
3028
|
+
default: 'CNY',
|
|
3029
|
+
maxLength: 10
|
|
3030
|
+
},
|
|
3031
|
+
matchPayeePattern: {
|
|
3032
|
+
type: 'string',
|
|
3033
|
+
description: 'Payee matching pattern (supports wildcards)',
|
|
3034
|
+
maxLength: 200
|
|
3035
|
+
},
|
|
3036
|
+
matchAmountTolerance: {
|
|
3037
|
+
type: 'number',
|
|
3038
|
+
description: 'Amount tolerance percentage (0-1)',
|
|
3039
|
+
default: 0.075,
|
|
3040
|
+
minimum: 0,
|
|
3041
|
+
maximum: 1
|
|
3042
|
+
},
|
|
3043
|
+
defaultExpenseAccount: {
|
|
3044
|
+
type: 'string',
|
|
3045
|
+
description: 'Default expense account for auto-create',
|
|
3046
|
+
maxLength: 200
|
|
3047
|
+
},
|
|
3048
|
+
defaultPaymentAccount: {
|
|
3049
|
+
type: 'string',
|
|
3050
|
+
description: 'Default payment account for auto-create',
|
|
3051
|
+
maxLength: 200
|
|
3052
|
+
},
|
|
3053
|
+
defaultPayee: {
|
|
3054
|
+
type: 'string',
|
|
3055
|
+
description: 'Default payee for auto-create',
|
|
3056
|
+
maxLength: 200
|
|
3057
|
+
},
|
|
3058
|
+
autoCreate: {
|
|
3059
|
+
type: 'boolean',
|
|
3060
|
+
description: 'Auto-create transaction when expected date arrives',
|
|
3061
|
+
default: false
|
|
3062
|
+
},
|
|
3063
|
+
startDate: {
|
|
3064
|
+
type: 'string',
|
|
3065
|
+
description: 'Rule start date (ISO format)'
|
|
3066
|
+
},
|
|
3067
|
+
endDate: {
|
|
3068
|
+
type: 'string',
|
|
3069
|
+
description: 'Rule end date (ISO format)'
|
|
3070
|
+
}
|
|
3071
|
+
},
|
|
3072
|
+
required: [
|
|
3073
|
+
'name',
|
|
3074
|
+
'frequency',
|
|
3075
|
+
'expectedAmount',
|
|
3076
|
+
'currency',
|
|
3077
|
+
'matchAmountTolerance',
|
|
3078
|
+
'autoCreate'
|
|
3079
|
+
]
|
|
3080
|
+
} as const;
|
|
3081
|
+
|
|
3082
|
+
export const $RecurringRuleResponseDto = {
|
|
3083
|
+
type: 'object',
|
|
3084
|
+
properties: {
|
|
3085
|
+
id: {
|
|
3086
|
+
type: 'string',
|
|
3087
|
+
description: 'Rule ID'
|
|
3088
|
+
},
|
|
3089
|
+
userId: {
|
|
3090
|
+
type: 'string',
|
|
3091
|
+
description: 'User ID'
|
|
3092
|
+
},
|
|
3093
|
+
name: {
|
|
3094
|
+
type: 'string',
|
|
3095
|
+
description: 'Rule name'
|
|
3096
|
+
},
|
|
3097
|
+
icon: {
|
|
3098
|
+
type: 'object',
|
|
3099
|
+
description: 'Icon emoji'
|
|
3100
|
+
},
|
|
3101
|
+
frequency: {
|
|
3102
|
+
type: 'string',
|
|
3103
|
+
description: 'Recurring frequency'
|
|
2869
3104
|
},
|
|
2870
3105
|
expectedAmount: {
|
|
2871
3106
|
type: 'number',
|
|
@@ -4450,41 +4685,292 @@ export const $UpdateBeanEventDto = {
|
|
|
4450
4685
|
}
|
|
4451
4686
|
} as const;
|
|
4452
4687
|
|
|
4453
|
-
export const $
|
|
4688
|
+
export const $OnboardingAccountDto = {
|
|
4454
4689
|
type: 'object',
|
|
4455
4690
|
properties: {
|
|
4456
|
-
|
|
4691
|
+
path: {
|
|
4457
4692
|
type: 'string',
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
example: '
|
|
4461
|
-
}
|
|
4462
|
-
},
|
|
4463
|
-
required: ['file']
|
|
4464
|
-
} as const;
|
|
4465
|
-
|
|
4466
|
-
export const $ImportErrorDto = {
|
|
4467
|
-
type: 'object',
|
|
4468
|
-
properties: {
|
|
4469
|
-
index: {
|
|
4470
|
-
type: 'number',
|
|
4471
|
-
description: 'Index of failed transaction in the file',
|
|
4472
|
-
example: 5
|
|
4693
|
+
description:
|
|
4694
|
+
'Account path (Assets/Liabilities only; format validated by the account service)',
|
|
4695
|
+
example: 'Assets:Checking'
|
|
4473
4696
|
},
|
|
4474
|
-
|
|
4697
|
+
currency: {
|
|
4475
4698
|
type: 'string',
|
|
4476
|
-
description: '
|
|
4477
|
-
example: '
|
|
4699
|
+
description: 'ISO 4217 currency code (3 letters)',
|
|
4700
|
+
example: 'USD'
|
|
4701
|
+
},
|
|
4702
|
+
openingBalance: {
|
|
4703
|
+
type: 'string',
|
|
4704
|
+
description:
|
|
4705
|
+
'Opening balance as a non-negative Decimal string (e.g. "1000.00")',
|
|
4706
|
+
example: '1000.00'
|
|
4707
|
+
},
|
|
4708
|
+
platformId: {
|
|
4709
|
+
type: 'string',
|
|
4710
|
+
description:
|
|
4711
|
+
'Platform ID to bind the account to (references Platform.id); omit for unbound',
|
|
4712
|
+
example: 'c98e5d4a-2f71-4a5a-bb3c-92c9f231d5e2'
|
|
4478
4713
|
}
|
|
4479
4714
|
},
|
|
4480
|
-
required: ['
|
|
4715
|
+
required: ['path', 'currency']
|
|
4481
4716
|
} as const;
|
|
4482
4717
|
|
|
4483
|
-
export const $
|
|
4718
|
+
export const $OnboardingDto = {
|
|
4484
4719
|
type: 'object',
|
|
4485
4720
|
properties: {
|
|
4486
|
-
|
|
4487
|
-
|
|
4721
|
+
accounts: {
|
|
4722
|
+
description: 'Asset/Liability accounts to register with opening balances',
|
|
4723
|
+
type: 'array',
|
|
4724
|
+
items: {
|
|
4725
|
+
$ref: '#/components/schemas/OnboardingAccountDto'
|
|
4726
|
+
}
|
|
4727
|
+
},
|
|
4728
|
+
skipAssetRegistration: {
|
|
4729
|
+
type: 'boolean',
|
|
4730
|
+
description:
|
|
4731
|
+
'Skip asset registration; only bootstrap the core account set',
|
|
4732
|
+
default: false
|
|
4733
|
+
}
|
|
4734
|
+
}
|
|
4735
|
+
} as const;
|
|
4736
|
+
|
|
4737
|
+
export const $ActualBalanceDto = {
|
|
4738
|
+
type: 'object',
|
|
4739
|
+
properties: {
|
|
4740
|
+
amount: {
|
|
4741
|
+
type: 'string',
|
|
4742
|
+
description:
|
|
4743
|
+
'Actual balance amount as a decimal string (preserves precision for tolerance inference).',
|
|
4744
|
+
example: '1234.56'
|
|
4745
|
+
},
|
|
4746
|
+
ccy: {
|
|
4747
|
+
type: 'string',
|
|
4748
|
+
description: 'Currency code (ISO 4217 or commodity ticker).',
|
|
4749
|
+
example: 'CNY'
|
|
4750
|
+
}
|
|
4751
|
+
},
|
|
4752
|
+
required: ['amount', 'ccy']
|
|
4753
|
+
} as const;
|
|
4754
|
+
|
|
4755
|
+
export const $ComputeReconciliationDto = {
|
|
4756
|
+
type: 'object',
|
|
4757
|
+
properties: {
|
|
4758
|
+
accountId: {
|
|
4759
|
+
type: 'string',
|
|
4760
|
+
description: 'BeanAccount id to reconcile.'
|
|
4761
|
+
},
|
|
4762
|
+
asOfDate: {
|
|
4763
|
+
type: 'string',
|
|
4764
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
4765
|
+
example: '2026-07-24'
|
|
4766
|
+
},
|
|
4767
|
+
actualBalance: {
|
|
4768
|
+
description: 'Actual balance from the external statement.',
|
|
4769
|
+
allOf: [
|
|
4770
|
+
{
|
|
4771
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
4772
|
+
}
|
|
4773
|
+
]
|
|
4774
|
+
}
|
|
4775
|
+
},
|
|
4776
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
4777
|
+
} as const;
|
|
4778
|
+
|
|
4779
|
+
export const $ReconciliationComputeResultDto = {
|
|
4780
|
+
type: 'object',
|
|
4781
|
+
properties: {
|
|
4782
|
+
accountId: {
|
|
4783
|
+
type: 'string'
|
|
4784
|
+
},
|
|
4785
|
+
asOfDate: {
|
|
4786
|
+
type: 'string'
|
|
4787
|
+
},
|
|
4788
|
+
bookBalance: {
|
|
4789
|
+
type: 'string',
|
|
4790
|
+
description: 'System-computed book balance (decimal string).'
|
|
4791
|
+
},
|
|
4792
|
+
actualBalance: {
|
|
4793
|
+
type: 'string',
|
|
4794
|
+
description: 'User-entered actual balance (decimal string).'
|
|
4795
|
+
},
|
|
4796
|
+
currency: {
|
|
4797
|
+
type: 'string'
|
|
4798
|
+
},
|
|
4799
|
+
diff: {
|
|
4800
|
+
type: 'string',
|
|
4801
|
+
description: 'Diff = book − actual (decimal string).'
|
|
4802
|
+
},
|
|
4803
|
+
tolerance: {
|
|
4804
|
+
type: 'string',
|
|
4805
|
+
description: 'Applied tolerance (decimal string).'
|
|
4806
|
+
},
|
|
4807
|
+
withinTolerance: {
|
|
4808
|
+
type: 'boolean',
|
|
4809
|
+
description: 'true when |diff| ≤ tolerance.'
|
|
4810
|
+
},
|
|
4811
|
+
suggestedAction: {
|
|
4812
|
+
type: 'string',
|
|
4813
|
+
enum: ['assert', 'pad'],
|
|
4814
|
+
description:
|
|
4815
|
+
'Suggested next action: assert when within tolerance, pad otherwise.'
|
|
4816
|
+
}
|
|
4817
|
+
},
|
|
4818
|
+
required: [
|
|
4819
|
+
'accountId',
|
|
4820
|
+
'asOfDate',
|
|
4821
|
+
'bookBalance',
|
|
4822
|
+
'actualBalance',
|
|
4823
|
+
'currency',
|
|
4824
|
+
'diff',
|
|
4825
|
+
'tolerance',
|
|
4826
|
+
'withinTolerance',
|
|
4827
|
+
'suggestedAction'
|
|
4828
|
+
]
|
|
4829
|
+
} as const;
|
|
4830
|
+
|
|
4831
|
+
export const $AssertReconciliationDto = {
|
|
4832
|
+
type: 'object',
|
|
4833
|
+
properties: {
|
|
4834
|
+
accountId: {
|
|
4835
|
+
type: 'string',
|
|
4836
|
+
description: 'BeanAccount id to reconcile.'
|
|
4837
|
+
},
|
|
4838
|
+
asOfDate: {
|
|
4839
|
+
type: 'string',
|
|
4840
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
4841
|
+
example: '2026-07-24'
|
|
4842
|
+
},
|
|
4843
|
+
actualBalance: {
|
|
4844
|
+
description: 'Actual balance from the external statement.',
|
|
4845
|
+
allOf: [
|
|
4846
|
+
{
|
|
4847
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
4848
|
+
}
|
|
4849
|
+
]
|
|
4850
|
+
},
|
|
4851
|
+
tolerance: {
|
|
4852
|
+
type: 'string',
|
|
4853
|
+
description:
|
|
4854
|
+
'Optional explicit tolerance override. Omit to infer from amount precision (Beancount default).',
|
|
4855
|
+
example: '0.01'
|
|
4856
|
+
}
|
|
4857
|
+
},
|
|
4858
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
4859
|
+
} as const;
|
|
4860
|
+
|
|
4861
|
+
export const $ReconciliationRecordDto = {
|
|
4862
|
+
type: 'object',
|
|
4863
|
+
properties: {
|
|
4864
|
+
id: {
|
|
4865
|
+
type: 'string'
|
|
4866
|
+
},
|
|
4867
|
+
accountId: {
|
|
4868
|
+
type: 'string'
|
|
4869
|
+
},
|
|
4870
|
+
date: {
|
|
4871
|
+
type: 'string'
|
|
4872
|
+
},
|
|
4873
|
+
amount: {
|
|
4874
|
+
type: 'string',
|
|
4875
|
+
description: 'Asserted (actual) amount.'
|
|
4876
|
+
},
|
|
4877
|
+
currency: {
|
|
4878
|
+
type: 'string'
|
|
4879
|
+
},
|
|
4880
|
+
tolerance: {
|
|
4881
|
+
type: 'string'
|
|
4882
|
+
},
|
|
4883
|
+
diffAmount: {
|
|
4884
|
+
type: 'string',
|
|
4885
|
+
description: 'book − actual.'
|
|
4886
|
+
},
|
|
4887
|
+
diffCurrency: {
|
|
4888
|
+
type: 'string'
|
|
4889
|
+
},
|
|
4890
|
+
createdAt: {
|
|
4891
|
+
type: 'string'
|
|
4892
|
+
}
|
|
4893
|
+
},
|
|
4894
|
+
required: ['id', 'accountId', 'date', 'amount', 'currency', 'createdAt']
|
|
4895
|
+
} as const;
|
|
4896
|
+
|
|
4897
|
+
export const $PadReconciliationDto = {
|
|
4898
|
+
type: 'object',
|
|
4899
|
+
properties: {
|
|
4900
|
+
accountId: {
|
|
4901
|
+
type: 'string',
|
|
4902
|
+
description: 'BeanAccount id to reconcile.'
|
|
4903
|
+
},
|
|
4904
|
+
asOfDate: {
|
|
4905
|
+
type: 'string',
|
|
4906
|
+
description: 'Assertion date (ISO 8601, e.g. "2026-07-24").',
|
|
4907
|
+
example: '2026-07-24'
|
|
4908
|
+
},
|
|
4909
|
+
actualBalance: {
|
|
4910
|
+
description: 'Actual balance from the external statement.',
|
|
4911
|
+
allOf: [
|
|
4912
|
+
{
|
|
4913
|
+
$ref: '#/components/schemas/ActualBalanceDto'
|
|
4914
|
+
}
|
|
4915
|
+
]
|
|
4916
|
+
},
|
|
4917
|
+
sourceAccount: {
|
|
4918
|
+
type: 'string',
|
|
4919
|
+
description:
|
|
4920
|
+
'Pad source account. Defaults to Equity:Opening-Balances (official Beancount convention).',
|
|
4921
|
+
example: 'Equity:Opening-Balances',
|
|
4922
|
+
default: 'Equity:Opening-Balances'
|
|
4923
|
+
}
|
|
4924
|
+
},
|
|
4925
|
+
required: ['accountId', 'asOfDate', 'actualBalance']
|
|
4926
|
+
} as const;
|
|
4927
|
+
|
|
4928
|
+
export const $PadResultDto = {
|
|
4929
|
+
type: 'object',
|
|
4930
|
+
properties: {
|
|
4931
|
+
transactionId: {
|
|
4932
|
+
type: 'string',
|
|
4933
|
+
description: 'Created pad adjusting transaction id.'
|
|
4934
|
+
}
|
|
4935
|
+
},
|
|
4936
|
+
required: ['transactionId']
|
|
4937
|
+
} as const;
|
|
4938
|
+
|
|
4939
|
+
export const $FileImportDto = {
|
|
4940
|
+
type: 'object',
|
|
4941
|
+
properties: {
|
|
4942
|
+
file: {
|
|
4943
|
+
type: 'string',
|
|
4944
|
+
format: 'binary',
|
|
4945
|
+
description: 'Bill file to import (CSV, PDF, OFX, etc.)',
|
|
4946
|
+
example: 'alipay.csv'
|
|
4947
|
+
}
|
|
4948
|
+
},
|
|
4949
|
+
required: ['file']
|
|
4950
|
+
} as const;
|
|
4951
|
+
|
|
4952
|
+
export const $ImportErrorDto = {
|
|
4953
|
+
type: 'object',
|
|
4954
|
+
properties: {
|
|
4955
|
+
index: {
|
|
4956
|
+
type: 'number',
|
|
4957
|
+
description: 'Index of failed transaction in the file',
|
|
4958
|
+
example: 5
|
|
4959
|
+
},
|
|
4960
|
+
error: {
|
|
4961
|
+
type: 'string',
|
|
4962
|
+
description: 'Error message',
|
|
4963
|
+
example: 'Transaction does not balance: -100 USD != 0'
|
|
4964
|
+
}
|
|
4965
|
+
},
|
|
4966
|
+
required: ['index', 'error']
|
|
4967
|
+
} as const;
|
|
4968
|
+
|
|
4969
|
+
export const $ReviewItemPreviewDto = {
|
|
4970
|
+
type: 'object',
|
|
4971
|
+
properties: {
|
|
4972
|
+
index: {
|
|
4973
|
+
type: 'number',
|
|
4488
4974
|
description: 'Index in the import batch (for tracking)',
|
|
4489
4975
|
example: 0
|
|
4490
4976
|
},
|
|
@@ -4616,7 +5102,7 @@ export const $IdentifyResultDto = {
|
|
|
4616
5102
|
account: {
|
|
4617
5103
|
type: 'string',
|
|
4618
5104
|
description: 'Default account used by this importer',
|
|
4619
|
-
example: 'Assets:Alipay:Balance'
|
|
5105
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4620
5106
|
},
|
|
4621
5107
|
message: {
|
|
4622
5108
|
type: 'string',
|
|
@@ -4633,7 +5119,7 @@ export const $MapperDefaultsDto = {
|
|
|
4633
5119
|
sourceAccount: {
|
|
4634
5120
|
type: 'string',
|
|
4635
5121
|
description: 'Source account for transactions (Beancount format)',
|
|
4636
|
-
example: 'Assets:Alipay:Balance'
|
|
5122
|
+
example: 'Assets:CN:Alipay:Balance'
|
|
4637
5123
|
},
|
|
4638
5124
|
currency: {
|
|
4639
5125
|
type: 'string',
|
|
@@ -4670,7 +5156,7 @@ export const $MapperDefaultsDto = {
|
|
|
4670
5156
|
description:
|
|
4671
5157
|
'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
|
|
4672
5158
|
example: {
|
|
4673
|
-
HuaBei: 'Liabilities:
|
|
5159
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
4674
5160
|
CreditCard: 'Liabilities:CreditCard'
|
|
4675
5161
|
}
|
|
4676
5162
|
}
|
|
@@ -4802,7 +5288,7 @@ export const $UpdateMapperDefaultsDto = {
|
|
|
4802
5288
|
sourceAccount: {
|
|
4803
5289
|
type: 'string',
|
|
4804
5290
|
description: 'Source account for transactions (Beancount format)',
|
|
4805
|
-
example: 'Assets:Alipay:Balance',
|
|
5291
|
+
example: 'Assets:CN:Alipay:Balance',
|
|
4806
5292
|
pattern: '^[A-Z][a-zA-Z0-9-]*:[a-zA-Z0-9-:]+$'
|
|
4807
5293
|
},
|
|
4808
5294
|
currency: {
|
|
@@ -4830,7 +5316,7 @@ export const $UpdateMapperDefaultsDto = {
|
|
|
4830
5316
|
description:
|
|
4831
5317
|
'Payment method to source account mapping. Maps payment method keywords to Beancount account paths. Used by Alipay/WeChat importers to determine sourceAccount based on payment method (e.g., HuaBei, CreditCard).',
|
|
4832
5318
|
example: {
|
|
4833
|
-
HuaBei: 'Liabilities:
|
|
5319
|
+
HuaBei: 'Liabilities:CN:CreditLine',
|
|
4834
5320
|
CreditCard: 'Liabilities:CreditCard'
|
|
4835
5321
|
}
|
|
4836
5322
|
}
|
|
@@ -4865,159 +5351,59 @@ export const $UpdateImporterConfigDto = {
|
|
|
4865
5351
|
}
|
|
4866
5352
|
} as const;
|
|
4867
5353
|
|
|
4868
|
-
export const $
|
|
5354
|
+
export const $ProviderSyncConfigDto = {
|
|
4869
5355
|
type: 'object',
|
|
4870
5356
|
properties: {
|
|
4871
|
-
|
|
4872
|
-
type: 'string',
|
|
4873
|
-
description: 'Platform name',
|
|
4874
|
-
example: 'Binance'
|
|
4875
|
-
},
|
|
4876
|
-
canonical: {
|
|
5357
|
+
sourceAccount: {
|
|
4877
5358
|
type: 'string',
|
|
4878
|
-
description: '
|
|
4879
|
-
example: '
|
|
4880
|
-
},
|
|
4881
|
-
aliases: {
|
|
4882
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4883
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4884
|
-
type: 'array',
|
|
4885
|
-
items: {
|
|
4886
|
-
type: 'string'
|
|
4887
|
-
}
|
|
5359
|
+
description: 'Source account for the first posting',
|
|
5360
|
+
example: 'Assets:US:Chase:Checking'
|
|
4888
5361
|
},
|
|
4889
|
-
|
|
5362
|
+
defaultCurrency: {
|
|
4890
5363
|
type: 'string',
|
|
4891
|
-
description: '
|
|
4892
|
-
example: '
|
|
5364
|
+
description: 'Default currency for transactions',
|
|
5365
|
+
example: 'USD'
|
|
4893
5366
|
},
|
|
4894
|
-
|
|
5367
|
+
defaultExpenseAccount: {
|
|
4895
5368
|
type: 'string',
|
|
4896
|
-
description: '
|
|
4897
|
-
|
|
4898
|
-
'BANK',
|
|
4899
|
-
'BROKERAGE',
|
|
4900
|
-
'CRYPTO_EXCHANGE',
|
|
4901
|
-
'PAYMENT',
|
|
4902
|
-
'INVESTMENT',
|
|
4903
|
-
'INSURANCE',
|
|
4904
|
-
'OTHER'
|
|
4905
|
-
],
|
|
4906
|
-
example: 'CRYPTO_EXCHANGE'
|
|
5369
|
+
description: 'Default expense account for the second posting',
|
|
5370
|
+
example: 'Expenses:Unknown'
|
|
4907
5371
|
},
|
|
4908
|
-
|
|
5372
|
+
defaultIncomeAccount: {
|
|
4909
5373
|
type: 'string',
|
|
4910
|
-
description: '
|
|
4911
|
-
example: '
|
|
5374
|
+
description: 'Default income account for the second posting',
|
|
5375
|
+
example: 'Income:Unknown'
|
|
4912
5376
|
},
|
|
4913
|
-
|
|
5377
|
+
filterPending: {
|
|
4914
5378
|
type: 'boolean',
|
|
4915
|
-
description: '
|
|
5379
|
+
description: 'Filter pending transactions',
|
|
4916
5380
|
default: true
|
|
5381
|
+
},
|
|
5382
|
+
externalAccountId: {
|
|
5383
|
+
type: 'string',
|
|
5384
|
+
description:
|
|
5385
|
+
'External account ID for per-batch providers (e.g. GoCardless). Overrides sourceAccount when an ExternalAccountLink mapping exists.',
|
|
5386
|
+
example: 'acc_gocardless_001'
|
|
4917
5387
|
}
|
|
4918
5388
|
},
|
|
4919
|
-
required: [
|
|
5389
|
+
required: [
|
|
5390
|
+
'sourceAccount',
|
|
5391
|
+
'defaultCurrency',
|
|
5392
|
+
'defaultExpenseAccount',
|
|
5393
|
+
'defaultIncomeAccount'
|
|
5394
|
+
]
|
|
4920
5395
|
} as const;
|
|
4921
5396
|
|
|
4922
|
-
export const $
|
|
5397
|
+
export const $ProviderSyncDto = {
|
|
4923
5398
|
type: 'object',
|
|
4924
5399
|
properties: {
|
|
4925
|
-
|
|
5400
|
+
provider: {
|
|
4926
5401
|
type: 'string',
|
|
4927
|
-
description:
|
|
4928
|
-
|
|
5402
|
+
description:
|
|
5403
|
+
'Provider name (already in URL path, optional here for reference)',
|
|
5404
|
+
example: 'plaid'
|
|
4929
5405
|
},
|
|
4930
|
-
|
|
4931
|
-
type: 'string',
|
|
4932
|
-
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
4933
|
-
example: 'binance'
|
|
4934
|
-
},
|
|
4935
|
-
aliases: {
|
|
4936
|
-
description: 'Platform aliases (multi-language names for lookup)',
|
|
4937
|
-
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
4938
|
-
type: 'array',
|
|
4939
|
-
items: {
|
|
4940
|
-
type: 'string'
|
|
4941
|
-
}
|
|
4942
|
-
},
|
|
4943
|
-
url: {
|
|
4944
|
-
type: 'string',
|
|
4945
|
-
description: 'Platform URL',
|
|
4946
|
-
example: 'https://www.binance.com'
|
|
4947
|
-
},
|
|
4948
|
-
type: {
|
|
4949
|
-
type: 'string',
|
|
4950
|
-
description: 'Platform type',
|
|
4951
|
-
enum: [
|
|
4952
|
-
'BANK',
|
|
4953
|
-
'BROKERAGE',
|
|
4954
|
-
'CRYPTO_EXCHANGE',
|
|
4955
|
-
'PAYMENT',
|
|
4956
|
-
'INVESTMENT',
|
|
4957
|
-
'INSURANCE',
|
|
4958
|
-
'OTHER'
|
|
4959
|
-
],
|
|
4960
|
-
example: 'CRYPTO_EXCHANGE'
|
|
4961
|
-
},
|
|
4962
|
-
logoUrl: {
|
|
4963
|
-
type: 'string',
|
|
4964
|
-
description: 'Platform logo URL',
|
|
4965
|
-
example: 'https://example.com/logos/binance.png'
|
|
4966
|
-
},
|
|
4967
|
-
isActive: {
|
|
4968
|
-
type: 'boolean',
|
|
4969
|
-
description: 'Whether the platform is active'
|
|
4970
|
-
}
|
|
4971
|
-
}
|
|
4972
|
-
} as const;
|
|
4973
|
-
|
|
4974
|
-
export const $ProviderSyncConfigDto = {
|
|
4975
|
-
type: 'object',
|
|
4976
|
-
properties: {
|
|
4977
|
-
sourceAccount: {
|
|
4978
|
-
type: 'string',
|
|
4979
|
-
description: 'Source account for the first posting',
|
|
4980
|
-
example: 'Assets:Bank:Chase'
|
|
4981
|
-
},
|
|
4982
|
-
defaultCurrency: {
|
|
4983
|
-
type: 'string',
|
|
4984
|
-
description: 'Default currency for transactions',
|
|
4985
|
-
example: 'USD'
|
|
4986
|
-
},
|
|
4987
|
-
defaultExpenseAccount: {
|
|
4988
|
-
type: 'string',
|
|
4989
|
-
description: 'Default expense account for the second posting',
|
|
4990
|
-
example: 'Expenses:Unknown'
|
|
4991
|
-
},
|
|
4992
|
-
defaultIncomeAccount: {
|
|
4993
|
-
type: 'string',
|
|
4994
|
-
description: 'Default income account for the second posting',
|
|
4995
|
-
example: 'Income:Unknown'
|
|
4996
|
-
},
|
|
4997
|
-
filterPending: {
|
|
4998
|
-
type: 'boolean',
|
|
4999
|
-
description: 'Filter pending transactions',
|
|
5000
|
-
default: true
|
|
5001
|
-
}
|
|
5002
|
-
},
|
|
5003
|
-
required: [
|
|
5004
|
-
'sourceAccount',
|
|
5005
|
-
'defaultCurrency',
|
|
5006
|
-
'defaultExpenseAccount',
|
|
5007
|
-
'defaultIncomeAccount'
|
|
5008
|
-
]
|
|
5009
|
-
} as const;
|
|
5010
|
-
|
|
5011
|
-
export const $ProviderSyncDto = {
|
|
5012
|
-
type: 'object',
|
|
5013
|
-
properties: {
|
|
5014
|
-
provider: {
|
|
5015
|
-
type: 'string',
|
|
5016
|
-
description:
|
|
5017
|
-
'Provider name (already in URL path, optional here for reference)',
|
|
5018
|
-
example: 'plaid'
|
|
5019
|
-
},
|
|
5020
|
-
syncId: {
|
|
5406
|
+
syncId: {
|
|
5021
5407
|
type: 'string',
|
|
5022
5408
|
description: 'Unique sync identifier for idempotency',
|
|
5023
5409
|
example: 'sync-12345'
|
|
@@ -5117,6 +5503,94 @@ export const $SupportedProvidersResponseDto = {
|
|
|
5117
5503
|
required: ['providers']
|
|
5118
5504
|
} as const;
|
|
5119
5505
|
|
|
5506
|
+
export const $CreateExternalAccountLinkDto = {
|
|
5507
|
+
type: 'object',
|
|
5508
|
+
properties: {
|
|
5509
|
+
provider: {
|
|
5510
|
+
type: 'string',
|
|
5511
|
+
enum: [
|
|
5512
|
+
'plaid',
|
|
5513
|
+
'teller',
|
|
5514
|
+
'truelayer',
|
|
5515
|
+
'gocardless',
|
|
5516
|
+
'simplefin',
|
|
5517
|
+
'yodlee',
|
|
5518
|
+
'beancount-direct',
|
|
5519
|
+
'parsed-bill'
|
|
5520
|
+
],
|
|
5521
|
+
example: 'plaid',
|
|
5522
|
+
description: 'Open Banking provider (whitelist)'
|
|
5523
|
+
},
|
|
5524
|
+
externalAccountId: {
|
|
5525
|
+
type: 'string',
|
|
5526
|
+
example: 'acc-plaid-001',
|
|
5527
|
+
description: 'External account ID from the provider'
|
|
5528
|
+
},
|
|
5529
|
+
beanAccountId: {
|
|
5530
|
+
type: 'string',
|
|
5531
|
+
example: '550e8400-e29b-41d4-a716-446655440000',
|
|
5532
|
+
description: 'Target BeanAccount ID (must belong to the JWT user)'
|
|
5533
|
+
}
|
|
5534
|
+
},
|
|
5535
|
+
required: ['provider', 'externalAccountId', 'beanAccountId']
|
|
5536
|
+
} as const;
|
|
5537
|
+
|
|
5538
|
+
export const $ExternalAccountLinkResponseDto = {
|
|
5539
|
+
type: 'object',
|
|
5540
|
+
properties: {
|
|
5541
|
+
id: {
|
|
5542
|
+
type: 'string'
|
|
5543
|
+
},
|
|
5544
|
+
provider: {
|
|
5545
|
+
type: 'string'
|
|
5546
|
+
},
|
|
5547
|
+
externalAccountId: {
|
|
5548
|
+
type: 'string'
|
|
5549
|
+
},
|
|
5550
|
+
beanAccountId: {
|
|
5551
|
+
type: 'string'
|
|
5552
|
+
},
|
|
5553
|
+
isActive: {
|
|
5554
|
+
type: 'boolean'
|
|
5555
|
+
},
|
|
5556
|
+
createdAt: {
|
|
5557
|
+
type: 'string'
|
|
5558
|
+
},
|
|
5559
|
+
updatedAt: {
|
|
5560
|
+
type: 'string'
|
|
5561
|
+
}
|
|
5562
|
+
},
|
|
5563
|
+
required: [
|
|
5564
|
+
'id',
|
|
5565
|
+
'provider',
|
|
5566
|
+
'externalAccountId',
|
|
5567
|
+
'beanAccountId',
|
|
5568
|
+
'isActive',
|
|
5569
|
+
'createdAt',
|
|
5570
|
+
'updatedAt'
|
|
5571
|
+
]
|
|
5572
|
+
} as const;
|
|
5573
|
+
|
|
5574
|
+
export const $ExternalAccountLinkListResponseDto = {
|
|
5575
|
+
type: 'object',
|
|
5576
|
+
properties: {
|
|
5577
|
+
items: {
|
|
5578
|
+
type: 'array',
|
|
5579
|
+
items: {
|
|
5580
|
+
$ref: '#/components/schemas/ExternalAccountLinkResponseDto'
|
|
5581
|
+
}
|
|
5582
|
+
},
|
|
5583
|
+
total: {
|
|
5584
|
+
type: 'number'
|
|
5585
|
+
},
|
|
5586
|
+
provider: {
|
|
5587
|
+
type: 'string',
|
|
5588
|
+
description: 'Filter by provider (query param)'
|
|
5589
|
+
}
|
|
5590
|
+
},
|
|
5591
|
+
required: ['items', 'total']
|
|
5592
|
+
} as const;
|
|
5593
|
+
|
|
5120
5594
|
export const $ParserTelemetryReportDto = {
|
|
5121
5595
|
type: 'object',
|
|
5122
5596
|
properties: {}
|
|
@@ -5666,7 +6140,7 @@ export const $NlpSuggestedAccountDto = {
|
|
|
5666
6140
|
account: {
|
|
5667
6141
|
type: 'string',
|
|
5668
6142
|
description: 'Suggested account path',
|
|
5669
|
-
example: 'Assets:
|
|
6143
|
+
example: 'Assets:Checking'
|
|
5670
6144
|
},
|
|
5671
6145
|
confidence: {
|
|
5672
6146
|
type: 'number',
|
|
@@ -5707,7 +6181,7 @@ export const $NlpDefaultAccountsDto = {
|
|
|
5707
6181
|
asset: {
|
|
5708
6182
|
type: 'string',
|
|
5709
6183
|
description: 'Default asset account',
|
|
5710
|
-
example: 'Assets:
|
|
6184
|
+
example: 'Assets:Checking'
|
|
5711
6185
|
},
|
|
5712
6186
|
expense: {
|
|
5713
6187
|
type: 'string',
|
|
@@ -5929,21 +6403,252 @@ export const $NlpResponseDto = {
|
|
|
5929
6403
|
required: ['status', 'action']
|
|
5930
6404
|
} as const;
|
|
5931
6405
|
|
|
5932
|
-
export const $
|
|
6406
|
+
export const $PlatformListItemDto = {
|
|
5933
6407
|
type: 'object',
|
|
5934
6408
|
properties: {
|
|
5935
|
-
|
|
6409
|
+
id: {
|
|
5936
6410
|
type: 'string',
|
|
5937
|
-
description: '
|
|
5938
|
-
example: 'CNY'
|
|
6411
|
+
description: 'Global platform ID'
|
|
5939
6412
|
},
|
|
5940
|
-
|
|
6413
|
+
name: {
|
|
5941
6414
|
type: 'string',
|
|
5942
|
-
description: '
|
|
5943
|
-
|
|
6415
|
+
description: 'Platform name'
|
|
6416
|
+
},
|
|
6417
|
+
url: {
|
|
6418
|
+
type: 'string',
|
|
6419
|
+
description: 'Platform URL'
|
|
6420
|
+
},
|
|
6421
|
+
type: {
|
|
6422
|
+
type: 'string',
|
|
6423
|
+
description: 'Platform type',
|
|
6424
|
+
enum: [
|
|
6425
|
+
'BANK',
|
|
6426
|
+
'BROKERAGE',
|
|
6427
|
+
'CRYPTO_EXCHANGE',
|
|
6428
|
+
'PAYMENT',
|
|
6429
|
+
'INVESTMENT',
|
|
6430
|
+
'INSURANCE',
|
|
6431
|
+
'OTHER'
|
|
6432
|
+
]
|
|
6433
|
+
},
|
|
6434
|
+
canonical: {
|
|
6435
|
+
type: 'string',
|
|
6436
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
6437
|
+
},
|
|
6438
|
+
suggestedSegment: {
|
|
6439
|
+
type: 'string',
|
|
6440
|
+
description:
|
|
6441
|
+
'Suggested path segment — canonical with first char uppercased (ACC_COMP_NAME_RE)'
|
|
6442
|
+
},
|
|
6443
|
+
logoUrl: {
|
|
6444
|
+
type: 'string',
|
|
6445
|
+
description: 'Logo URL',
|
|
6446
|
+
nullable: true
|
|
6447
|
+
},
|
|
6448
|
+
isBound: {
|
|
6449
|
+
type: 'boolean',
|
|
6450
|
+
description: 'Whether user has accounts using this platform'
|
|
5944
6451
|
}
|
|
5945
6452
|
},
|
|
5946
|
-
required: [
|
|
6453
|
+
required: [
|
|
6454
|
+
'id',
|
|
6455
|
+
'name',
|
|
6456
|
+
'url',
|
|
6457
|
+
'type',
|
|
6458
|
+
'canonical',
|
|
6459
|
+
'suggestedSegment',
|
|
6460
|
+
'logoUrl',
|
|
6461
|
+
'isBound'
|
|
6462
|
+
]
|
|
6463
|
+
} as const;
|
|
6464
|
+
|
|
6465
|
+
export const $PlatformMatchResultDto = {
|
|
6466
|
+
type: 'object',
|
|
6467
|
+
properties: {
|
|
6468
|
+
id: {
|
|
6469
|
+
type: 'string',
|
|
6470
|
+
description: 'Global platform ID'
|
|
6471
|
+
},
|
|
6472
|
+
name: {
|
|
6473
|
+
type: 'string',
|
|
6474
|
+
description: 'Platform name (e.g., "ICBC")'
|
|
6475
|
+
},
|
|
6476
|
+
canonical: {
|
|
6477
|
+
type: 'string',
|
|
6478
|
+
description: 'Canonical identifier in ACCOUNT_RE format (e.g., "icbc")'
|
|
6479
|
+
},
|
|
6480
|
+
type: {
|
|
6481
|
+
type: 'string',
|
|
6482
|
+
description: 'Platform type',
|
|
6483
|
+
enum: [
|
|
6484
|
+
'BANK',
|
|
6485
|
+
'BROKERAGE',
|
|
6486
|
+
'CRYPTO_EXCHANGE',
|
|
6487
|
+
'PAYMENT',
|
|
6488
|
+
'INVESTMENT',
|
|
6489
|
+
'INSURANCE',
|
|
6490
|
+
'OTHER'
|
|
6491
|
+
]
|
|
6492
|
+
},
|
|
6493
|
+
suggestedSegment: {
|
|
6494
|
+
type: 'string',
|
|
6495
|
+
description:
|
|
6496
|
+
'Suggested path segment — canonical, already in ACCOUNT_RE format'
|
|
6497
|
+
},
|
|
6498
|
+
logoUrl: {
|
|
6499
|
+
type: 'string',
|
|
6500
|
+
description: 'Logo URL',
|
|
6501
|
+
nullable: true
|
|
6502
|
+
},
|
|
6503
|
+
matchType: {
|
|
6504
|
+
type: 'string',
|
|
6505
|
+
description: "How this row matched: 'exact' > 'prefix' > 'substring'",
|
|
6506
|
+
enum: ['exact', 'prefix', 'substring']
|
|
6507
|
+
}
|
|
6508
|
+
},
|
|
6509
|
+
required: [
|
|
6510
|
+
'id',
|
|
6511
|
+
'name',
|
|
6512
|
+
'canonical',
|
|
6513
|
+
'type',
|
|
6514
|
+
'suggestedSegment',
|
|
6515
|
+
'logoUrl',
|
|
6516
|
+
'matchType'
|
|
6517
|
+
]
|
|
6518
|
+
} as const;
|
|
6519
|
+
|
|
6520
|
+
export const $PlatformMatchResponseDto = {
|
|
6521
|
+
type: 'object',
|
|
6522
|
+
properties: {
|
|
6523
|
+
platforms: {
|
|
6524
|
+
description: 'Ranked matches, best tier first (at most 10 rows)',
|
|
6525
|
+
type: 'array',
|
|
6526
|
+
items: {
|
|
6527
|
+
$ref: '#/components/schemas/PlatformMatchResultDto'
|
|
6528
|
+
}
|
|
6529
|
+
},
|
|
6530
|
+
matchType: {
|
|
6531
|
+
type: 'string',
|
|
6532
|
+
description:
|
|
6533
|
+
"Overall match quality — top row's tier, or 'none' when no hits",
|
|
6534
|
+
enum: ['none', 'exact', 'prefix', 'substring']
|
|
6535
|
+
},
|
|
6536
|
+
total: {
|
|
6537
|
+
type: 'number',
|
|
6538
|
+
description: 'Total matches before LIMIT (truncation transparency)'
|
|
6539
|
+
},
|
|
6540
|
+
hasMore: {
|
|
6541
|
+
type: 'boolean',
|
|
6542
|
+
description: 'true when total > platforms.length (more matches exist)'
|
|
6543
|
+
}
|
|
6544
|
+
},
|
|
6545
|
+
required: ['platforms', 'matchType', 'total', 'hasMore']
|
|
6546
|
+
} as const;
|
|
6547
|
+
|
|
6548
|
+
export const $CreatePlatformDto = {
|
|
6549
|
+
type: 'object',
|
|
6550
|
+
properties: {
|
|
6551
|
+
name: {
|
|
6552
|
+
type: 'string',
|
|
6553
|
+
description: 'Platform name',
|
|
6554
|
+
example: 'Binance'
|
|
6555
|
+
},
|
|
6556
|
+
canonical: {
|
|
6557
|
+
type: 'string',
|
|
6558
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
6559
|
+
example: 'binance'
|
|
6560
|
+
},
|
|
6561
|
+
aliases: {
|
|
6562
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
6563
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
6564
|
+
type: 'array',
|
|
6565
|
+
items: {
|
|
6566
|
+
type: 'string'
|
|
6567
|
+
}
|
|
6568
|
+
},
|
|
6569
|
+
url: {
|
|
6570
|
+
type: 'string',
|
|
6571
|
+
description: 'Platform URL',
|
|
6572
|
+
example: 'https://www.binance.com'
|
|
6573
|
+
},
|
|
6574
|
+
type: {
|
|
6575
|
+
type: 'string',
|
|
6576
|
+
description: 'Platform type',
|
|
6577
|
+
enum: [
|
|
6578
|
+
'BANK',
|
|
6579
|
+
'BROKERAGE',
|
|
6580
|
+
'CRYPTO_EXCHANGE',
|
|
6581
|
+
'PAYMENT',
|
|
6582
|
+
'INVESTMENT',
|
|
6583
|
+
'INSURANCE',
|
|
6584
|
+
'OTHER'
|
|
6585
|
+
],
|
|
6586
|
+
example: 'CRYPTO_EXCHANGE'
|
|
6587
|
+
},
|
|
6588
|
+
logoUrl: {
|
|
6589
|
+
type: 'string',
|
|
6590
|
+
description: 'Platform logo URL',
|
|
6591
|
+
example: 'https://example.com/logos/binance.png'
|
|
6592
|
+
},
|
|
6593
|
+
isActive: {
|
|
6594
|
+
type: 'boolean',
|
|
6595
|
+
description: 'Whether the platform is active',
|
|
6596
|
+
default: true
|
|
6597
|
+
}
|
|
6598
|
+
},
|
|
6599
|
+
required: ['name', 'canonical', 'aliases', 'url', 'type']
|
|
6600
|
+
} as const;
|
|
6601
|
+
|
|
6602
|
+
export const $UpdatePlatformDto = {
|
|
6603
|
+
type: 'object',
|
|
6604
|
+
properties: {
|
|
6605
|
+
name: {
|
|
6606
|
+
type: 'string',
|
|
6607
|
+
description: 'Platform name',
|
|
6608
|
+
example: 'Binance'
|
|
6609
|
+
},
|
|
6610
|
+
canonical: {
|
|
6611
|
+
type: 'string',
|
|
6612
|
+
description: 'Platform canonical identifier (lowercase, kebab-case)',
|
|
6613
|
+
example: 'binance'
|
|
6614
|
+
},
|
|
6615
|
+
aliases: {
|
|
6616
|
+
description: 'Platform aliases (multi-language names for lookup)',
|
|
6617
|
+
example: ['Binance', 'Binance Exchange', 'BNB'],
|
|
6618
|
+
type: 'array',
|
|
6619
|
+
items: {
|
|
6620
|
+
type: 'string'
|
|
6621
|
+
}
|
|
6622
|
+
},
|
|
6623
|
+
url: {
|
|
6624
|
+
type: 'string',
|
|
6625
|
+
description: 'Platform URL',
|
|
6626
|
+
example: 'https://www.binance.com'
|
|
6627
|
+
},
|
|
6628
|
+
type: {
|
|
6629
|
+
type: 'string',
|
|
6630
|
+
description: 'Platform type',
|
|
6631
|
+
enum: [
|
|
6632
|
+
'BANK',
|
|
6633
|
+
'BROKERAGE',
|
|
6634
|
+
'CRYPTO_EXCHANGE',
|
|
6635
|
+
'PAYMENT',
|
|
6636
|
+
'INVESTMENT',
|
|
6637
|
+
'INSURANCE',
|
|
6638
|
+
'OTHER'
|
|
6639
|
+
],
|
|
6640
|
+
example: 'CRYPTO_EXCHANGE'
|
|
6641
|
+
},
|
|
6642
|
+
logoUrl: {
|
|
6643
|
+
type: 'string',
|
|
6644
|
+
description: 'Platform logo URL',
|
|
6645
|
+
example: 'https://example.com/logos/binance.png'
|
|
6646
|
+
},
|
|
6647
|
+
isActive: {
|
|
6648
|
+
type: 'boolean',
|
|
6649
|
+
description: 'Whether the platform is active'
|
|
6650
|
+
}
|
|
6651
|
+
}
|
|
5947
6652
|
} as const;
|
|
5948
6653
|
|
|
5949
6654
|
export const $NetWorthByCurrencyDto = {
|
|
@@ -6015,28 +6720,6 @@ export const $ConvertedNetWorthDto = {
|
|
|
6015
6720
|
]
|
|
6016
6721
|
} as const;
|
|
6017
6722
|
|
|
6018
|
-
export const $ExchangeRateWarningDto = {
|
|
6019
|
-
type: 'object',
|
|
6020
|
-
properties: {
|
|
6021
|
-
type: {
|
|
6022
|
-
type: 'string',
|
|
6023
|
-
description: 'Warning type',
|
|
6024
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
6025
|
-
},
|
|
6026
|
-
currency: {
|
|
6027
|
-
type: 'string',
|
|
6028
|
-
description: 'Currency without exchange rate',
|
|
6029
|
-
example: 'EUR'
|
|
6030
|
-
},
|
|
6031
|
-
totalAmount: {
|
|
6032
|
-
type: 'string',
|
|
6033
|
-
description: 'Total amount affected',
|
|
6034
|
-
example: '1000.00'
|
|
6035
|
-
}
|
|
6036
|
-
},
|
|
6037
|
-
required: ['type', 'currency', 'totalAmount']
|
|
6038
|
-
} as const;
|
|
6039
|
-
|
|
6040
6723
|
export const $NetWorthResponseDto = {
|
|
6041
6724
|
type: 'object',
|
|
6042
6725
|
properties: {
|
|
@@ -6122,7 +6805,7 @@ export const $AccountItemDto = {
|
|
|
6122
6805
|
name: {
|
|
6123
6806
|
type: 'string',
|
|
6124
6807
|
description: 'Full account name',
|
|
6125
|
-
example: 'Assets:
|
|
6808
|
+
example: 'Assets:CN:CMB:Savings'
|
|
6126
6809
|
},
|
|
6127
6810
|
displayName: {
|
|
6128
6811
|
type: 'string',
|
|
@@ -6138,6 +6821,12 @@ export const $AccountItemDto = {
|
|
|
6138
6821
|
type: 'string',
|
|
6139
6822
|
description: 'Currency code',
|
|
6140
6823
|
example: 'CNY'
|
|
6824
|
+
},
|
|
6825
|
+
convertedBalance: {
|
|
6826
|
+
type: 'string',
|
|
6827
|
+
description:
|
|
6828
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
6829
|
+
example: '50000.00'
|
|
6141
6830
|
}
|
|
6142
6831
|
},
|
|
6143
6832
|
required: ['id', 'name', 'displayName', 'balance', 'currency']
|
|
@@ -6164,11 +6853,66 @@ export const $PlatformGroupDto = {
|
|
|
6164
6853
|
},
|
|
6165
6854
|
totalBalance: {
|
|
6166
6855
|
type: 'string',
|
|
6167
|
-
description: '
|
|
6856
|
+
description: 'FX-converted total balance in base currency',
|
|
6857
|
+
example: '100000.00'
|
|
6858
|
+
},
|
|
6859
|
+
balanceByCurrency: {
|
|
6860
|
+
description: 'Raw (unconverted) balances grouped by currency',
|
|
6861
|
+
type: 'array',
|
|
6862
|
+
items: {
|
|
6863
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
6864
|
+
}
|
|
6865
|
+
},
|
|
6866
|
+
convertedBalance: {
|
|
6867
|
+
type: 'string',
|
|
6868
|
+
description:
|
|
6869
|
+
'Converted balance in base currency (omitted when no currency is convertible)',
|
|
6168
6870
|
example: '100000.00'
|
|
6871
|
+
},
|
|
6872
|
+
sharePct: {
|
|
6873
|
+
type: 'number',
|
|
6874
|
+
description:
|
|
6875
|
+
'Share of the grand converted total (0-100); 0 when grand total is 0',
|
|
6876
|
+
example: 42.5
|
|
6169
6877
|
}
|
|
6170
6878
|
},
|
|
6171
|
-
required: [
|
|
6879
|
+
required: [
|
|
6880
|
+
'platformId',
|
|
6881
|
+
'platformName',
|
|
6882
|
+
'accounts',
|
|
6883
|
+
'totalBalance',
|
|
6884
|
+
'balanceByCurrency',
|
|
6885
|
+
'sharePct'
|
|
6886
|
+
]
|
|
6887
|
+
} as const;
|
|
6888
|
+
|
|
6889
|
+
export const $AccountExchangeRateWarningDto = {
|
|
6890
|
+
type: 'object',
|
|
6891
|
+
properties: {
|
|
6892
|
+
type: {
|
|
6893
|
+
type: 'string',
|
|
6894
|
+
description: 'Warning type',
|
|
6895
|
+
example: 'MISSING_EXCHANGE_RATE'
|
|
6896
|
+
},
|
|
6897
|
+
currency: {
|
|
6898
|
+
type: 'string',
|
|
6899
|
+
description: 'Currency without exchange rate',
|
|
6900
|
+
example: 'USD'
|
|
6901
|
+
},
|
|
6902
|
+
accounts: {
|
|
6903
|
+
description: 'Affected account paths',
|
|
6904
|
+
type: 'array',
|
|
6905
|
+
items: {
|
|
6906
|
+
type: 'string'
|
|
6907
|
+
}
|
|
6908
|
+
},
|
|
6909
|
+
totalAmount: {
|
|
6910
|
+
type: 'string',
|
|
6911
|
+
description: 'Total amount in this currency',
|
|
6912
|
+
example: '5000.00'
|
|
6913
|
+
}
|
|
6914
|
+
},
|
|
6915
|
+
required: ['type', 'currency', 'accounts', 'totalAmount']
|
|
6172
6916
|
} as const;
|
|
6173
6917
|
|
|
6174
6918
|
export const $AccountsSummaryDto = {
|
|
@@ -6181,9 +6925,21 @@ export const $AccountsSummaryDto = {
|
|
|
6181
6925
|
totalPlatforms: {
|
|
6182
6926
|
type: 'number',
|
|
6183
6927
|
description: 'Total number of platforms'
|
|
6928
|
+
},
|
|
6929
|
+
baseCurrency: {
|
|
6930
|
+
type: 'string',
|
|
6931
|
+
description: 'Base currency for conversion',
|
|
6932
|
+
example: 'CNY'
|
|
6933
|
+
},
|
|
6934
|
+
warnings: {
|
|
6935
|
+
description: 'Per-account exchange rate warnings',
|
|
6936
|
+
type: 'array',
|
|
6937
|
+
items: {
|
|
6938
|
+
$ref: '#/components/schemas/AccountExchangeRateWarningDto'
|
|
6939
|
+
}
|
|
6184
6940
|
}
|
|
6185
6941
|
},
|
|
6186
|
-
required: ['totalAccounts', 'totalPlatforms']
|
|
6942
|
+
required: ['totalAccounts', 'totalPlatforms', 'baseCurrency']
|
|
6187
6943
|
} as const;
|
|
6188
6944
|
|
|
6189
6945
|
export const $AccountsResponseDto = {
|
|
@@ -6218,7 +6974,7 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
6218
6974
|
name: {
|
|
6219
6975
|
type: 'string',
|
|
6220
6976
|
description: 'Full account name',
|
|
6221
|
-
example: 'Assets:
|
|
6977
|
+
example: 'Assets:CN:CMB:Savings'
|
|
6222
6978
|
},
|
|
6223
6979
|
displayName: {
|
|
6224
6980
|
type: 'string',
|
|
@@ -6235,6 +6991,12 @@ export const $AccountItemWithAssetClassDto = {
|
|
|
6235
6991
|
description: 'Currency code',
|
|
6236
6992
|
example: 'CNY'
|
|
6237
6993
|
},
|
|
6994
|
+
convertedBalance: {
|
|
6995
|
+
type: 'string',
|
|
6996
|
+
description:
|
|
6997
|
+
'FX-converted balance in base currency; omitted when not convertible',
|
|
6998
|
+
example: '50000.00'
|
|
6999
|
+
},
|
|
6238
7000
|
assetClass: {
|
|
6239
7001
|
type: 'string',
|
|
6240
7002
|
description: 'Asset class',
|
|
@@ -6288,59 +7050,30 @@ export const $AssetClassGroupDto = {
|
|
|
6288
7050
|
},
|
|
6289
7051
|
assetSubClass: {
|
|
6290
7052
|
type: 'string',
|
|
6291
|
-
description: 'Asset sub-class name',
|
|
6292
|
-
example: 'DEPOSIT'
|
|
6293
|
-
},
|
|
6294
|
-
accounts: {
|
|
6295
|
-
description: 'Accounts within this asset class',
|
|
6296
|
-
type: 'array',
|
|
6297
|
-
items: {
|
|
6298
|
-
$ref: '#/components/schemas/AccountItemWithAssetClassDto'
|
|
6299
|
-
}
|
|
6300
|
-
},
|
|
6301
|
-
balanceByCurrency: {
|
|
6302
|
-
description: 'Balances grouped by currency',
|
|
6303
|
-
type: 'array',
|
|
6304
|
-
items: {
|
|
6305
|
-
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
6306
|
-
}
|
|
6307
|
-
},
|
|
6308
|
-
convertedBalance: {
|
|
6309
|
-
type: 'string',
|
|
6310
|
-
description: 'Converted balance in base currency',
|
|
6311
|
-
example: '100000.00'
|
|
6312
|
-
}
|
|
6313
|
-
},
|
|
6314
|
-
required: ['assetClass', 'accounts', 'balanceByCurrency']
|
|
6315
|
-
} as const;
|
|
6316
|
-
|
|
6317
|
-
export const $AccountExchangeRateWarningDto = {
|
|
6318
|
-
type: 'object',
|
|
6319
|
-
properties: {
|
|
6320
|
-
type: {
|
|
6321
|
-
type: 'string',
|
|
6322
|
-
description: 'Warning type',
|
|
6323
|
-
example: 'MISSING_EXCHANGE_RATE'
|
|
6324
|
-
},
|
|
6325
|
-
currency: {
|
|
6326
|
-
type: 'string',
|
|
6327
|
-
description: 'Currency without exchange rate',
|
|
6328
|
-
example: 'USD'
|
|
7053
|
+
description: 'Asset sub-class name',
|
|
7054
|
+
example: 'DEPOSIT'
|
|
6329
7055
|
},
|
|
6330
7056
|
accounts: {
|
|
6331
|
-
description: '
|
|
7057
|
+
description: 'Accounts within this asset class',
|
|
6332
7058
|
type: 'array',
|
|
6333
7059
|
items: {
|
|
6334
|
-
|
|
7060
|
+
$ref: '#/components/schemas/AccountItemWithAssetClassDto'
|
|
6335
7061
|
}
|
|
6336
7062
|
},
|
|
6337
|
-
|
|
7063
|
+
balanceByCurrency: {
|
|
7064
|
+
description: 'Balances grouped by currency',
|
|
7065
|
+
type: 'array',
|
|
7066
|
+
items: {
|
|
7067
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
7068
|
+
}
|
|
7069
|
+
},
|
|
7070
|
+
convertedBalance: {
|
|
6338
7071
|
type: 'string',
|
|
6339
|
-
description: '
|
|
6340
|
-
example: '
|
|
7072
|
+
description: 'Converted balance in base currency',
|
|
7073
|
+
example: '100000.00'
|
|
6341
7074
|
}
|
|
6342
7075
|
},
|
|
6343
|
-
required: ['
|
|
7076
|
+
required: ['assetClass', 'accounts', 'balanceByCurrency']
|
|
6344
7077
|
} as const;
|
|
6345
7078
|
|
|
6346
7079
|
export const $AssetClassSummaryDto = {
|
|
@@ -6416,7 +7149,7 @@ export const $HoldingAssetClassAccountSliceDto = {
|
|
|
6416
7149
|
accountPath: {
|
|
6417
7150
|
type: 'string',
|
|
6418
7151
|
description: 'Full account path',
|
|
6419
|
-
example: 'Assets:US:
|
|
7152
|
+
example: 'Assets:US:Fidelity:Brokerage'
|
|
6420
7153
|
},
|
|
6421
7154
|
accountCurrency: {
|
|
6422
7155
|
type: 'string',
|
|
@@ -6622,6 +7355,101 @@ export const $CashFlowResponseDto = {
|
|
|
6622
7355
|
]
|
|
6623
7356
|
} as const;
|
|
6624
7357
|
|
|
7358
|
+
export const $CategoryGroupDto = {
|
|
7359
|
+
type: 'object',
|
|
7360
|
+
properties: {
|
|
7361
|
+
category: {
|
|
7362
|
+
type: 'string',
|
|
7363
|
+
description:
|
|
7364
|
+
'Functional category (account-path Group segment); regional and universal account paths merge under it',
|
|
7365
|
+
example: 'Food'
|
|
7366
|
+
},
|
|
7367
|
+
totalExpense: {
|
|
7368
|
+
type: 'string',
|
|
7369
|
+
description:
|
|
7370
|
+
'Converted total for this category in base currency (expense amount when flow=expense, income amount when flow=income)',
|
|
7371
|
+
example: '1200.00'
|
|
7372
|
+
},
|
|
7373
|
+
sharePct: {
|
|
7374
|
+
type: 'number',
|
|
7375
|
+
description: 'Share of grand total (0-100); 0 when grand total is 0',
|
|
7376
|
+
example: 42.5
|
|
7377
|
+
},
|
|
7378
|
+
balanceByCurrency: {
|
|
7379
|
+
description: 'Raw (unconverted) expense per currency',
|
|
7380
|
+
type: 'array',
|
|
7381
|
+
items: {
|
|
7382
|
+
$ref: '#/components/schemas/BalanceByCurrencyDto'
|
|
7383
|
+
}
|
|
7384
|
+
},
|
|
7385
|
+
convertedBalance: {
|
|
7386
|
+
type: 'string',
|
|
7387
|
+
description:
|
|
7388
|
+
'Converted total in base currency (omitted when FX missing for all currencies in this category)',
|
|
7389
|
+
example: '1200.00'
|
|
7390
|
+
}
|
|
7391
|
+
},
|
|
7392
|
+
required: ['category', 'totalExpense', 'sharePct', 'balanceByCurrency']
|
|
7393
|
+
} as const;
|
|
7394
|
+
|
|
7395
|
+
export const $ExpensesByCategorySummaryDto = {
|
|
7396
|
+
type: 'object',
|
|
7397
|
+
properties: {
|
|
7398
|
+
totalExpense: {
|
|
7399
|
+
type: 'string',
|
|
7400
|
+
description:
|
|
7401
|
+
'Total across all categories, converted (convertible categories only); expense totals when flow=expense, income totals when flow=income',
|
|
7402
|
+
example: '5000.00'
|
|
7403
|
+
},
|
|
7404
|
+
categoryCount: {
|
|
7405
|
+
type: 'number',
|
|
7406
|
+
description: 'Number of categories',
|
|
7407
|
+
example: 8
|
|
7408
|
+
}
|
|
7409
|
+
},
|
|
7410
|
+
required: ['totalExpense', 'categoryCount']
|
|
7411
|
+
} as const;
|
|
7412
|
+
|
|
7413
|
+
export const $ExpensesByCategoryResponseDto = {
|
|
7414
|
+
type: 'object',
|
|
7415
|
+
properties: {
|
|
7416
|
+
period: {
|
|
7417
|
+
type: 'string',
|
|
7418
|
+
description: 'Period requested',
|
|
7419
|
+
example: '1m'
|
|
7420
|
+
},
|
|
7421
|
+
baseCurrency: {
|
|
7422
|
+
type: 'string',
|
|
7423
|
+
description: 'Base currency for converted values',
|
|
7424
|
+
example: 'CNY'
|
|
7425
|
+
},
|
|
7426
|
+
groups: {
|
|
7427
|
+
description:
|
|
7428
|
+
'Expense groups by functional category, sorted by converted total desc',
|
|
7429
|
+
type: 'array',
|
|
7430
|
+
items: {
|
|
7431
|
+
$ref: '#/components/schemas/CategoryGroupDto'
|
|
7432
|
+
}
|
|
7433
|
+
},
|
|
7434
|
+
summary: {
|
|
7435
|
+
description: 'Summary statistics',
|
|
7436
|
+
allOf: [
|
|
7437
|
+
{
|
|
7438
|
+
$ref: '#/components/schemas/ExpensesByCategorySummaryDto'
|
|
7439
|
+
}
|
|
7440
|
+
]
|
|
7441
|
+
},
|
|
7442
|
+
warnings: {
|
|
7443
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
7444
|
+
type: 'array',
|
|
7445
|
+
items: {
|
|
7446
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
7447
|
+
}
|
|
7448
|
+
}
|
|
7449
|
+
},
|
|
7450
|
+
required: ['period', 'baseCurrency', 'groups', 'summary']
|
|
7451
|
+
} as const;
|
|
7452
|
+
|
|
6625
7453
|
export const $MonetaryDto = {
|
|
6626
7454
|
type: 'object',
|
|
6627
7455
|
properties: {
|
|
@@ -6911,163 +7739,6 @@ export const $HoldingPnlResponseDto = {
|
|
|
6911
7739
|
required: ['asOfDate', 'baseCurrency', 'method', 'rows', 'warnings']
|
|
6912
7740
|
} as const;
|
|
6913
7741
|
|
|
6914
|
-
export const $CreateBeanPriceDto = {
|
|
6915
|
-
type: 'object',
|
|
6916
|
-
properties: {
|
|
6917
|
-
currency: {
|
|
6918
|
-
type: 'string',
|
|
6919
|
-
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
6920
|
-
example: 'USD'
|
|
6921
|
-
},
|
|
6922
|
-
quoteCurrency: {
|
|
6923
|
-
type: 'string',
|
|
6924
|
-
description: 'Quote currency (pricing currency, e.g., CNY, EUR)',
|
|
6925
|
-
example: 'CNY'
|
|
6926
|
-
},
|
|
6927
|
-
amount: {
|
|
6928
|
-
type: 'number',
|
|
6929
|
-
description:
|
|
6930
|
-
'Price amount (MUST be >= 0 per Beancount spec, supports up to 15 decimal places). Zero allowed for conversion entries, negative strictly prohibited.',
|
|
6931
|
-
example: 175.5,
|
|
6932
|
-
minimum: 0
|
|
6933
|
-
},
|
|
6934
|
-
date: {
|
|
6935
|
-
type: 'string',
|
|
6936
|
-
description: 'Price date (ISO 8601 format)',
|
|
6937
|
-
example: '2024-11-05'
|
|
6938
|
-
},
|
|
6939
|
-
metadata: {
|
|
6940
|
-
type: 'object',
|
|
6941
|
-
description:
|
|
6942
|
-
'Metadata (validated by Zod schema, max field lengths enforced)',
|
|
6943
|
-
example: {
|
|
6944
|
-
source: 'MANUAL',
|
|
6945
|
-
note: 'Bank valuation report',
|
|
6946
|
-
confidence: 0.95
|
|
6947
|
-
}
|
|
6948
|
-
}
|
|
6949
|
-
},
|
|
6950
|
-
required: ['currency', 'quoteCurrency', 'amount', 'date']
|
|
6951
|
-
} as const;
|
|
6952
|
-
|
|
6953
|
-
export const $PriceResponseDto = {
|
|
6954
|
-
type: 'object',
|
|
6955
|
-
properties: {
|
|
6956
|
-
id: {
|
|
6957
|
-
type: 'string',
|
|
6958
|
-
description: 'Unique identifier',
|
|
6959
|
-
example: 'uuid-123-456'
|
|
6960
|
-
},
|
|
6961
|
-
userId: {
|
|
6962
|
-
type: 'string',
|
|
6963
|
-
description: 'User ID (owner of the price)',
|
|
6964
|
-
example: 'user-123'
|
|
6965
|
-
},
|
|
6966
|
-
currency: {
|
|
6967
|
-
type: 'string',
|
|
6968
|
-
description: 'Currency being priced (e.g., USD, AAPL, BTC)',
|
|
6969
|
-
example: 'BTC'
|
|
6970
|
-
},
|
|
6971
|
-
quoteCurrency: {
|
|
6972
|
-
type: 'string',
|
|
6973
|
-
description: 'Quote currency (pricing currency, e.g., USD, CNY)',
|
|
6974
|
-
example: 'USD'
|
|
6975
|
-
},
|
|
6976
|
-
amount: {
|
|
6977
|
-
type: 'number',
|
|
6978
|
-
description:
|
|
6979
|
-
'Price amount (corresponds to Beancount Amount.number). Supports up to 15 decimal places.',
|
|
6980
|
-
example: 50000
|
|
6981
|
-
},
|
|
6982
|
-
date: {
|
|
6983
|
-
type: 'string',
|
|
6984
|
-
description:
|
|
6985
|
-
'Price date (ISO 8601 format). Represents the date this price was valid.',
|
|
6986
|
-
example: '2024-01-01',
|
|
6987
|
-
format: 'date'
|
|
6988
|
-
},
|
|
6989
|
-
meta: {
|
|
6990
|
-
type: 'object',
|
|
6991
|
-
description:
|
|
6992
|
-
'Metadata (corresponds to Beancount meta field). Contains source, confidence, note, etc.',
|
|
6993
|
-
example: {
|
|
6994
|
-
source: 'MANUAL',
|
|
6995
|
-
note: 'User-defined price',
|
|
6996
|
-
confidence: 1
|
|
6997
|
-
}
|
|
6998
|
-
},
|
|
6999
|
-
createdAt: {
|
|
7000
|
-
format: 'date-time',
|
|
7001
|
-
type: 'string',
|
|
7002
|
-
description: 'Creation timestamp',
|
|
7003
|
-
example: '2024-11-03T10:00:00Z'
|
|
7004
|
-
},
|
|
7005
|
-
updatedAt: {
|
|
7006
|
-
format: 'date-time',
|
|
7007
|
-
type: 'string',
|
|
7008
|
-
description: 'Last update timestamp',
|
|
7009
|
-
example: '2024-11-03T10:00:00Z'
|
|
7010
|
-
}
|
|
7011
|
-
},
|
|
7012
|
-
required: [
|
|
7013
|
-
'id',
|
|
7014
|
-
'userId',
|
|
7015
|
-
'currency',
|
|
7016
|
-
'quoteCurrency',
|
|
7017
|
-
'amount',
|
|
7018
|
-
'date',
|
|
7019
|
-
'meta',
|
|
7020
|
-
'createdAt',
|
|
7021
|
-
'updatedAt'
|
|
7022
|
-
]
|
|
7023
|
-
} as const;
|
|
7024
|
-
|
|
7025
|
-
export const $PriceListResponseDto = {
|
|
7026
|
-
type: 'object',
|
|
7027
|
-
properties: {
|
|
7028
|
-
items: {
|
|
7029
|
-
description: 'List of prices',
|
|
7030
|
-
type: 'array',
|
|
7031
|
-
items: {
|
|
7032
|
-
$ref: '#/components/schemas/PriceResponseDto'
|
|
7033
|
-
}
|
|
7034
|
-
},
|
|
7035
|
-
total: {
|
|
7036
|
-
type: 'number',
|
|
7037
|
-
description: 'Total number of prices',
|
|
7038
|
-
example: 42
|
|
7039
|
-
}
|
|
7040
|
-
},
|
|
7041
|
-
required: ['items', 'total']
|
|
7042
|
-
} as const;
|
|
7043
|
-
|
|
7044
|
-
export const $UpdateBeanPriceDto = {
|
|
7045
|
-
type: 'object',
|
|
7046
|
-
properties: {
|
|
7047
|
-
currency: {
|
|
7048
|
-
type: 'string',
|
|
7049
|
-
description: 'Currency being priced'
|
|
7050
|
-
},
|
|
7051
|
-
quoteCurrency: {
|
|
7052
|
-
type: 'string',
|
|
7053
|
-
description: 'Quote currency (pricing currency)'
|
|
7054
|
-
},
|
|
7055
|
-
amount: {
|
|
7056
|
-
type: 'number',
|
|
7057
|
-
description: 'Price amount (MUST be >= 0 per Beancount spec)',
|
|
7058
|
-
minimum: 0
|
|
7059
|
-
},
|
|
7060
|
-
date: {
|
|
7061
|
-
type: 'string',
|
|
7062
|
-
description: 'Price date (ISO 8601 format)'
|
|
7063
|
-
},
|
|
7064
|
-
metadata: {
|
|
7065
|
-
type: 'object',
|
|
7066
|
-
description: 'Metadata'
|
|
7067
|
-
}
|
|
7068
|
-
}
|
|
7069
|
-
} as const;
|
|
7070
|
-
|
|
7071
7742
|
export const $CurrencyBalanceDto = {
|
|
7072
7743
|
type: 'object',
|
|
7073
7744
|
properties: {
|
|
@@ -7103,6 +7774,16 @@ export const $TimeSeriesPointDto = {
|
|
|
7103
7774
|
description: 'Change from previous point',
|
|
7104
7775
|
example: '5000.00'
|
|
7105
7776
|
},
|
|
7777
|
+
assets: {
|
|
7778
|
+
type: 'string',
|
|
7779
|
+
description: 'Total assets at this date (in base currency)',
|
|
7780
|
+
example: '494338.00'
|
|
7781
|
+
},
|
|
7782
|
+
liabilities: {
|
|
7783
|
+
type: 'string',
|
|
7784
|
+
description: 'Total liabilities at this date (in base currency)',
|
|
7785
|
+
example: '310098.00'
|
|
7786
|
+
},
|
|
7106
7787
|
byCurrency: {
|
|
7107
7788
|
description: 'Multi-currency breakdown for this point',
|
|
7108
7789
|
type: 'array',
|