@firela/api-types 0.0.0-canary.8cbdced0 → 0.0.0-canary.9d0af796
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 +1091 -38
- package/dist/index.d.ts +1091 -38
- package/dist/index.js +71 -16
- package/dist/index.mjs +71 -16
- package/package.json +1 -1
- package/src/generated/schemas.gen.ts +1115 -56
- package/src/generated/services.gen.ts +314 -20
- package/src/generated/types.gen.ts +1112 -19
|
@@ -4312,6 +4312,144 @@ export const $UpdatePropertyDto = {
|
|
|
4312
4312
|
required: ['value']
|
|
4313
4313
|
} as const;
|
|
4314
4314
|
|
|
4315
|
+
export const $CreateBeanEventDto = {
|
|
4316
|
+
type: 'object',
|
|
4317
|
+
properties: {
|
|
4318
|
+
date: {
|
|
4319
|
+
type: 'string',
|
|
4320
|
+
description: 'Life event date (ISO 8601)',
|
|
4321
|
+
example: '2024-03-15'
|
|
4322
|
+
},
|
|
4323
|
+
type: {
|
|
4324
|
+
type: 'string',
|
|
4325
|
+
description:
|
|
4326
|
+
'Life event type (e.g., "employer", "location", "marital-status") — user-defined, no enum constraint at engine layer',
|
|
4327
|
+
example: 'employer'
|
|
4328
|
+
},
|
|
4329
|
+
description: {
|
|
4330
|
+
type: 'string',
|
|
4331
|
+
description:
|
|
4332
|
+
'Life event description. Empty string is a VALID value (distinct from absence).',
|
|
4333
|
+
example: 'Acme Corp'
|
|
4334
|
+
},
|
|
4335
|
+
meta: {
|
|
4336
|
+
type: 'object',
|
|
4337
|
+
description:
|
|
4338
|
+
'Product-side metadata (lives in BeanEvent.meta JSON, never in engine Event fields)',
|
|
4339
|
+
example: {
|
|
4340
|
+
note: 'Promotion'
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
},
|
|
4344
|
+
required: ['date', 'type', 'description']
|
|
4345
|
+
} as const;
|
|
4346
|
+
|
|
4347
|
+
export const $EventResponseDto = {
|
|
4348
|
+
type: 'object',
|
|
4349
|
+
properties: {
|
|
4350
|
+
id: {
|
|
4351
|
+
type: 'string',
|
|
4352
|
+
description: 'Unique identifier',
|
|
4353
|
+
example: 'uuid-123-456'
|
|
4354
|
+
},
|
|
4355
|
+
userId: {
|
|
4356
|
+
type: 'string',
|
|
4357
|
+
description: 'User ID (owner of the life event)',
|
|
4358
|
+
example: 'user-123'
|
|
4359
|
+
},
|
|
4360
|
+
date: {
|
|
4361
|
+
type: 'string',
|
|
4362
|
+
description: 'Life event date (ISO 8601 format)',
|
|
4363
|
+
example: '2024-03-15',
|
|
4364
|
+
format: 'date'
|
|
4365
|
+
},
|
|
4366
|
+
type: {
|
|
4367
|
+
type: 'string',
|
|
4368
|
+
description:
|
|
4369
|
+
'Life event type (user-defined, e.g., "employer", "location")',
|
|
4370
|
+
example: 'employer'
|
|
4371
|
+
},
|
|
4372
|
+
description: {
|
|
4373
|
+
type: 'string',
|
|
4374
|
+
description:
|
|
4375
|
+
'Life event description. May be an empty string (a valid value distinct from absence).',
|
|
4376
|
+
example: 'Acme Corp'
|
|
4377
|
+
},
|
|
4378
|
+
meta: {
|
|
4379
|
+
type: 'object',
|
|
4380
|
+
description: 'Product-side metadata (free-form JSON)',
|
|
4381
|
+
example: {
|
|
4382
|
+
note: 'Promotion'
|
|
4383
|
+
}
|
|
4384
|
+
},
|
|
4385
|
+
createdAt: {
|
|
4386
|
+
format: 'date-time',
|
|
4387
|
+
type: 'string',
|
|
4388
|
+
description: 'Creation timestamp',
|
|
4389
|
+
example: '2024-03-15T10:00:00Z'
|
|
4390
|
+
},
|
|
4391
|
+
updatedAt: {
|
|
4392
|
+
format: 'date-time',
|
|
4393
|
+
type: 'string',
|
|
4394
|
+
description:
|
|
4395
|
+
'Last update timestamp. Also emitted as the ETag response header for If-Match optimistic concurrency.',
|
|
4396
|
+
example: '2024-03-15T10:00:00Z'
|
|
4397
|
+
}
|
|
4398
|
+
},
|
|
4399
|
+
required: [
|
|
4400
|
+
'id',
|
|
4401
|
+
'userId',
|
|
4402
|
+
'date',
|
|
4403
|
+
'type',
|
|
4404
|
+
'description',
|
|
4405
|
+
'meta',
|
|
4406
|
+
'createdAt',
|
|
4407
|
+
'updatedAt'
|
|
4408
|
+
]
|
|
4409
|
+
} as const;
|
|
4410
|
+
|
|
4411
|
+
export const $EventListResponseDto = {
|
|
4412
|
+
type: 'object',
|
|
4413
|
+
properties: {
|
|
4414
|
+
items: {
|
|
4415
|
+
description: 'List of life events',
|
|
4416
|
+
type: 'array',
|
|
4417
|
+
items: {
|
|
4418
|
+
$ref: '#/components/schemas/EventResponseDto'
|
|
4419
|
+
}
|
|
4420
|
+
},
|
|
4421
|
+
total: {
|
|
4422
|
+
type: 'number',
|
|
4423
|
+
description: 'Total number of life events matching the query',
|
|
4424
|
+
example: 42
|
|
4425
|
+
}
|
|
4426
|
+
},
|
|
4427
|
+
required: ['items', 'total']
|
|
4428
|
+
} as const;
|
|
4429
|
+
|
|
4430
|
+
export const $UpdateBeanEventDto = {
|
|
4431
|
+
type: 'object',
|
|
4432
|
+
properties: {
|
|
4433
|
+
date: {
|
|
4434
|
+
type: 'string',
|
|
4435
|
+
description: 'Life event date (ISO 8601)'
|
|
4436
|
+
},
|
|
4437
|
+
type: {
|
|
4438
|
+
type: 'string',
|
|
4439
|
+
description: 'Life event type (user-defined)'
|
|
4440
|
+
},
|
|
4441
|
+
description: {
|
|
4442
|
+
type: 'string',
|
|
4443
|
+
description:
|
|
4444
|
+
'Life event description. Empty string is a VALID value (distinct from absence).'
|
|
4445
|
+
},
|
|
4446
|
+
meta: {
|
|
4447
|
+
type: 'object',
|
|
4448
|
+
description: 'Product-side metadata (free-form JSON)'
|
|
4449
|
+
}
|
|
4450
|
+
}
|
|
4451
|
+
} as const;
|
|
4452
|
+
|
|
4315
4453
|
export const $FileImportDto = {
|
|
4316
4454
|
type: 'object',
|
|
4317
4455
|
properties: {
|
|
@@ -4888,91 +5026,907 @@ export const $ProviderSyncDto = {
|
|
|
4888
5026
|
description: 'Provider sync configuration',
|
|
4889
5027
|
allOf: [
|
|
4890
5028
|
{
|
|
4891
|
-
$ref: '#/components/schemas/ProviderSyncConfigDto'
|
|
5029
|
+
$ref: '#/components/schemas/ProviderSyncConfigDto'
|
|
5030
|
+
}
|
|
5031
|
+
]
|
|
5032
|
+
},
|
|
5033
|
+
transactions: {
|
|
5034
|
+
type: 'array',
|
|
5035
|
+
description: 'Raw transactions from provider',
|
|
5036
|
+
example: [
|
|
5037
|
+
{
|
|
5038
|
+
transaction_id: 'txn-001',
|
|
5039
|
+
amount: 50,
|
|
5040
|
+
iso_currency_code: 'USD',
|
|
5041
|
+
date: '2024-01-15',
|
|
5042
|
+
merchant_name: 'Starbucks',
|
|
5043
|
+
name: 'STARBUCKS STORE 12345',
|
|
5044
|
+
pending: false,
|
|
5045
|
+
account_id: 'acc-001'
|
|
5046
|
+
}
|
|
5047
|
+
]
|
|
5048
|
+
}
|
|
5049
|
+
},
|
|
5050
|
+
required: ['config', 'transactions']
|
|
5051
|
+
} as const;
|
|
5052
|
+
|
|
5053
|
+
export const $ProviderSyncResponseDto = {
|
|
5054
|
+
type: 'object',
|
|
5055
|
+
properties: {
|
|
5056
|
+
imported: {
|
|
5057
|
+
type: 'number',
|
|
5058
|
+
description: 'Number of transactions successfully imported',
|
|
5059
|
+
example: 10
|
|
5060
|
+
},
|
|
5061
|
+
skipped: {
|
|
5062
|
+
type: 'number',
|
|
5063
|
+
description: 'Number of transactions skipped (duplicates)',
|
|
5064
|
+
example: 2
|
|
5065
|
+
},
|
|
5066
|
+
pendingReview: {
|
|
5067
|
+
type: 'number',
|
|
5068
|
+
description: 'Number of transactions pending review',
|
|
5069
|
+
example: 3
|
|
5070
|
+
},
|
|
5071
|
+
failed: {
|
|
5072
|
+
type: 'number',
|
|
5073
|
+
description: 'Number of transactions that failed to import',
|
|
5074
|
+
example: 0
|
|
5075
|
+
},
|
|
5076
|
+
importedTransactionIds: {
|
|
5077
|
+
description: 'IDs of successfully imported transactions',
|
|
5078
|
+
example: ['txn-001', 'txn-002'],
|
|
5079
|
+
type: 'array',
|
|
5080
|
+
items: {
|
|
5081
|
+
type: 'string'
|
|
5082
|
+
}
|
|
5083
|
+
},
|
|
5084
|
+
reviewItemIds: {
|
|
5085
|
+
description: 'IDs of review items created for branched transactions',
|
|
5086
|
+
example: ['review-001', 'review-002'],
|
|
5087
|
+
type: 'array',
|
|
5088
|
+
items: {
|
|
5089
|
+
type: 'string'
|
|
5090
|
+
}
|
|
5091
|
+
}
|
|
5092
|
+
},
|
|
5093
|
+
required: ['imported', 'skipped', 'pendingReview', 'failed']
|
|
5094
|
+
} as const;
|
|
5095
|
+
|
|
5096
|
+
export const $SupportedProvidersResponseDto = {
|
|
5097
|
+
type: 'object',
|
|
5098
|
+
properties: {
|
|
5099
|
+
providers: {
|
|
5100
|
+
description: 'List of supported provider names',
|
|
5101
|
+
example: [
|
|
5102
|
+
'plaid',
|
|
5103
|
+
'teller',
|
|
5104
|
+
'truelayer',
|
|
5105
|
+
'gocardless',
|
|
5106
|
+
'simplefin',
|
|
5107
|
+
'yodlee',
|
|
5108
|
+
'beancount-direct',
|
|
5109
|
+
'parsed-bill'
|
|
5110
|
+
],
|
|
5111
|
+
type: 'array',
|
|
5112
|
+
items: {
|
|
5113
|
+
type: 'string'
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
5116
|
+
},
|
|
5117
|
+
required: ['providers']
|
|
5118
|
+
} as const;
|
|
5119
|
+
|
|
5120
|
+
export const $ParserTelemetryReportDto = {
|
|
5121
|
+
type: 'object',
|
|
5122
|
+
properties: {}
|
|
5123
|
+
} as const;
|
|
5124
|
+
|
|
5125
|
+
export const $UncoveredFormatMissDto = {
|
|
5126
|
+
type: 'object',
|
|
5127
|
+
properties: {}
|
|
5128
|
+
} as const;
|
|
5129
|
+
|
|
5130
|
+
export const $ProcessNlpDto = {
|
|
5131
|
+
type: 'object',
|
|
5132
|
+
properties: {
|
|
5133
|
+
message: {
|
|
5134
|
+
type: 'string',
|
|
5135
|
+
description: 'Natural language text describing a transaction (Chinese)',
|
|
5136
|
+
example: 'yesterday Starbucks spent 35 yuan',
|
|
5137
|
+
maxLength: 500
|
|
5138
|
+
},
|
|
5139
|
+
sessionId: {
|
|
5140
|
+
type: 'string',
|
|
5141
|
+
description:
|
|
5142
|
+
'Session ID for multi-turn conversation (auto-generated if not provided)',
|
|
5143
|
+
example: 'session_abc123'
|
|
5144
|
+
},
|
|
5145
|
+
parsedData: {
|
|
5146
|
+
type: 'object',
|
|
5147
|
+
description:
|
|
5148
|
+
'Parsed data from previous NLP response for session recovery. Send back the parsedData received in confirm_payee/confirm responses.',
|
|
5149
|
+
example: {
|
|
5150
|
+
amount: 35,
|
|
5151
|
+
currency: 'CNY',
|
|
5152
|
+
payee: 'Starbucks'
|
|
5153
|
+
}
|
|
5154
|
+
}
|
|
5155
|
+
},
|
|
5156
|
+
required: ['message']
|
|
5157
|
+
} as const;
|
|
5158
|
+
|
|
5159
|
+
export const $NlpTransactionInfoDto = {
|
|
5160
|
+
type: 'object',
|
|
5161
|
+
properties: {
|
|
5162
|
+
id: {
|
|
5163
|
+
type: 'string',
|
|
5164
|
+
description: 'Transaction ID'
|
|
5165
|
+
},
|
|
5166
|
+
date: {
|
|
5167
|
+
type: 'string',
|
|
5168
|
+
description: 'Transaction date (ISO format)'
|
|
5169
|
+
},
|
|
5170
|
+
amount: {
|
|
5171
|
+
type: 'number',
|
|
5172
|
+
description: 'Transaction amount'
|
|
5173
|
+
},
|
|
5174
|
+
currency: {
|
|
5175
|
+
type: 'string',
|
|
5176
|
+
description: 'Currency code'
|
|
5177
|
+
},
|
|
5178
|
+
payee: {
|
|
5179
|
+
type: 'string',
|
|
5180
|
+
description: 'Payee name'
|
|
5181
|
+
},
|
|
5182
|
+
narration: {
|
|
5183
|
+
type: 'string',
|
|
5184
|
+
description: 'Transaction narration'
|
|
5185
|
+
},
|
|
5186
|
+
warning: {
|
|
5187
|
+
type: 'string',
|
|
5188
|
+
description:
|
|
5189
|
+
'Warning message for special transaction scenarios (e.g., cross-currency settlement)',
|
|
5190
|
+
example: '此交易使用USD账户结算。如需记录CNY支出,请创建货币转换交易。'
|
|
5191
|
+
}
|
|
5192
|
+
},
|
|
5193
|
+
required: ['id', 'date', 'amount', 'currency']
|
|
5194
|
+
} as const;
|
|
5195
|
+
|
|
5196
|
+
export const $NlpParsedDataDto = {
|
|
5197
|
+
type: 'object',
|
|
5198
|
+
properties: {
|
|
5199
|
+
amount: {
|
|
5200
|
+
type: 'number',
|
|
5201
|
+
description: 'Extracted amount'
|
|
5202
|
+
},
|
|
5203
|
+
currency: {
|
|
5204
|
+
type: 'string',
|
|
5205
|
+
description: 'Currency code',
|
|
5206
|
+
default: 'CNY'
|
|
5207
|
+
},
|
|
5208
|
+
date: {
|
|
5209
|
+
type: 'string',
|
|
5210
|
+
description: 'Transaction date (ISO format)'
|
|
5211
|
+
},
|
|
5212
|
+
payee: {
|
|
5213
|
+
type: 'string',
|
|
5214
|
+
description: 'Payee name'
|
|
5215
|
+
},
|
|
5216
|
+
narration: {
|
|
5217
|
+
type: 'string',
|
|
5218
|
+
description: 'Transaction narration'
|
|
5219
|
+
},
|
|
5220
|
+
category: {
|
|
5221
|
+
type: 'string',
|
|
5222
|
+
description: 'Category'
|
|
5223
|
+
},
|
|
5224
|
+
incomeType: {
|
|
5225
|
+
type: 'string',
|
|
5226
|
+
description: 'Income type (e.g., Salary, Bonus, Dividend, Interest)',
|
|
5227
|
+
example: 'Salary'
|
|
5228
|
+
},
|
|
5229
|
+
incomeSource: {
|
|
5230
|
+
type: 'string',
|
|
5231
|
+
description: 'Income source (e.g., company name)',
|
|
5232
|
+
example: 'Anthropic Inc.'
|
|
5233
|
+
},
|
|
5234
|
+
symbol: {
|
|
5235
|
+
type: 'string',
|
|
5236
|
+
description: 'Security symbol code (e.g., 600519, AAPL)',
|
|
5237
|
+
example: '600519'
|
|
5238
|
+
},
|
|
5239
|
+
quantity: {
|
|
5240
|
+
type: 'number',
|
|
5241
|
+
description: 'Quantity of shares/units',
|
|
5242
|
+
example: 100
|
|
5243
|
+
},
|
|
5244
|
+
price: {
|
|
5245
|
+
type: 'number',
|
|
5246
|
+
description: 'Unit price per share/unit',
|
|
5247
|
+
example: 1900
|
|
5248
|
+
},
|
|
5249
|
+
investmentAction: {
|
|
5250
|
+
type: 'string',
|
|
5251
|
+
description: 'Investment action',
|
|
5252
|
+
enum: ['buy', 'sell'],
|
|
5253
|
+
example: 'buy'
|
|
5254
|
+
},
|
|
5255
|
+
paymentSource: {
|
|
5256
|
+
type: 'string',
|
|
5257
|
+
description: 'Payment source: asset (default) or liability (credit card)',
|
|
5258
|
+
enum: ['asset', 'liability'],
|
|
5259
|
+
example: 'asset'
|
|
5260
|
+
},
|
|
5261
|
+
liabilityHint: {
|
|
5262
|
+
type: 'string',
|
|
5263
|
+
description: 'Liability account hint (CreditCard/Huabei/Baitiao)',
|
|
5264
|
+
example: 'CreditCard'
|
|
5265
|
+
},
|
|
5266
|
+
warning: {
|
|
5267
|
+
type: 'string',
|
|
5268
|
+
description:
|
|
5269
|
+
'Warning message for special scenarios (e.g., cross-currency settlement)',
|
|
5270
|
+
example: '此交易使用USD账户结算。如需记录CNY支出,请创建货币转换交易。'
|
|
5271
|
+
}
|
|
5272
|
+
}
|
|
5273
|
+
} as const;
|
|
5274
|
+
|
|
5275
|
+
export const $NlpSourceTransactionDto = {
|
|
5276
|
+
type: 'object',
|
|
5277
|
+
properties: {
|
|
5278
|
+
date: {
|
|
5279
|
+
type: 'string',
|
|
5280
|
+
description: 'Transaction date (ISO format)'
|
|
5281
|
+
},
|
|
5282
|
+
amount: {
|
|
5283
|
+
type: 'string',
|
|
5284
|
+
description: 'Amount as string'
|
|
5285
|
+
},
|
|
5286
|
+
currency: {
|
|
5287
|
+
type: 'string',
|
|
5288
|
+
description: 'Currency code'
|
|
5289
|
+
},
|
|
5290
|
+
payee: {
|
|
5291
|
+
type: 'string',
|
|
5292
|
+
description: 'Payee name'
|
|
5293
|
+
},
|
|
5294
|
+
narration: {
|
|
5295
|
+
type: 'string',
|
|
5296
|
+
description: 'Transaction narration'
|
|
5297
|
+
}
|
|
5298
|
+
},
|
|
5299
|
+
required: ['date', 'amount', 'currency', 'narration']
|
|
5300
|
+
} as const;
|
|
5301
|
+
|
|
5302
|
+
export const $NlpTargetTransactionDto = {
|
|
5303
|
+
type: 'object',
|
|
5304
|
+
properties: {
|
|
5305
|
+
id: {
|
|
5306
|
+
type: 'string',
|
|
5307
|
+
description: 'Existing transaction ID'
|
|
5308
|
+
},
|
|
5309
|
+
date: {
|
|
5310
|
+
type: 'string',
|
|
5311
|
+
description: 'Transaction date (ISO format)'
|
|
5312
|
+
},
|
|
5313
|
+
amount: {
|
|
5314
|
+
type: 'string',
|
|
5315
|
+
description: 'Amount as string'
|
|
5316
|
+
},
|
|
5317
|
+
currency: {
|
|
5318
|
+
type: 'string',
|
|
5319
|
+
description: 'Currency code'
|
|
5320
|
+
},
|
|
5321
|
+
payee: {
|
|
5322
|
+
type: 'string',
|
|
5323
|
+
description: 'Payee name'
|
|
5324
|
+
},
|
|
5325
|
+
narration: {
|
|
5326
|
+
type: 'string',
|
|
5327
|
+
description: 'Transaction narration'
|
|
5328
|
+
}
|
|
5329
|
+
},
|
|
5330
|
+
required: ['id', 'date', 'amount', 'currency', 'narration']
|
|
5331
|
+
} as const;
|
|
5332
|
+
|
|
5333
|
+
export const $NlpSimilarityDto = {
|
|
5334
|
+
type: 'object',
|
|
5335
|
+
properties: {
|
|
5336
|
+
dateMatch: {
|
|
5337
|
+
type: 'boolean',
|
|
5338
|
+
description: 'Whether dates match'
|
|
5339
|
+
},
|
|
5340
|
+
dateDiff: {
|
|
5341
|
+
type: 'number',
|
|
5342
|
+
description: 'Date difference in days'
|
|
5343
|
+
},
|
|
5344
|
+
amountMatch: {
|
|
5345
|
+
type: 'boolean',
|
|
5346
|
+
description: 'Whether amounts match'
|
|
5347
|
+
},
|
|
5348
|
+
amountDiff: {
|
|
5349
|
+
type: 'string',
|
|
5350
|
+
description: 'Amount difference as decimal string'
|
|
5351
|
+
},
|
|
5352
|
+
payeeMatch: {
|
|
5353
|
+
type: 'boolean',
|
|
5354
|
+
description: 'Whether payees match'
|
|
5355
|
+
},
|
|
5356
|
+
payeeSimilarity: {
|
|
5357
|
+
type: 'number',
|
|
5358
|
+
description: 'Payee similarity score (0-1)'
|
|
5359
|
+
},
|
|
5360
|
+
accountOverlap: {
|
|
5361
|
+
type: 'number',
|
|
5362
|
+
description: 'Account overlap score (0-1)'
|
|
5363
|
+
}
|
|
5364
|
+
},
|
|
5365
|
+
required: [
|
|
5366
|
+
'dateMatch',
|
|
5367
|
+
'dateDiff',
|
|
5368
|
+
'amountMatch',
|
|
5369
|
+
'amountDiff',
|
|
5370
|
+
'payeeMatch',
|
|
5371
|
+
'payeeSimilarity',
|
|
5372
|
+
'accountOverlap'
|
|
5373
|
+
]
|
|
5374
|
+
} as const;
|
|
5375
|
+
|
|
5376
|
+
export const $NlpDuplicateConfirmationDataDto = {
|
|
5377
|
+
type: 'object',
|
|
5378
|
+
properties: {
|
|
5379
|
+
confidence: {
|
|
5380
|
+
type: 'number',
|
|
5381
|
+
description: 'Duplicate detection confidence score (0.5-0.89)',
|
|
5382
|
+
example: 0.85
|
|
5383
|
+
},
|
|
5384
|
+
sourceTransaction: {
|
|
5385
|
+
description:
|
|
5386
|
+
'Source transaction summary (the new transaction being entered)',
|
|
5387
|
+
allOf: [
|
|
5388
|
+
{
|
|
5389
|
+
$ref: '#/components/schemas/NlpSourceTransactionDto'
|
|
5390
|
+
}
|
|
5391
|
+
]
|
|
5392
|
+
},
|
|
5393
|
+
targetTransaction: {
|
|
5394
|
+
description: 'Target transaction summary (existing potential duplicate)',
|
|
5395
|
+
allOf: [
|
|
5396
|
+
{
|
|
5397
|
+
$ref: '#/components/schemas/NlpTargetTransactionDto'
|
|
5398
|
+
}
|
|
5399
|
+
]
|
|
5400
|
+
},
|
|
5401
|
+
similarity: {
|
|
5402
|
+
description: 'Detailed similarity information',
|
|
5403
|
+
allOf: [
|
|
5404
|
+
{
|
|
5405
|
+
$ref: '#/components/schemas/NlpSimilarityDto'
|
|
5406
|
+
}
|
|
5407
|
+
]
|
|
5408
|
+
},
|
|
5409
|
+
reasons: {
|
|
5410
|
+
description: 'Human-readable reasons for duplicate detection',
|
|
5411
|
+
example: ['日期匹配', '金额匹配', '商户相似'],
|
|
5412
|
+
type: 'array',
|
|
5413
|
+
items: {
|
|
5414
|
+
type: 'string'
|
|
5415
|
+
}
|
|
5416
|
+
}
|
|
5417
|
+
},
|
|
5418
|
+
required: [
|
|
5419
|
+
'confidence',
|
|
5420
|
+
'sourceTransaction',
|
|
5421
|
+
'targetTransaction',
|
|
5422
|
+
'similarity',
|
|
5423
|
+
'reasons'
|
|
5424
|
+
]
|
|
5425
|
+
} as const;
|
|
5426
|
+
|
|
5427
|
+
export const $NlpRuleConfirmationDataDto = {
|
|
5428
|
+
type: 'object',
|
|
5429
|
+
properties: {
|
|
5430
|
+
confidence: {
|
|
5431
|
+
type: 'number',
|
|
5432
|
+
description: 'Rule match confidence score (0.5-0.74)',
|
|
5433
|
+
example: 0.65
|
|
5434
|
+
},
|
|
5435
|
+
matchedRule: {
|
|
5436
|
+
type: 'object',
|
|
5437
|
+
description: 'Matched rule information'
|
|
5438
|
+
},
|
|
5439
|
+
suggestedAccounts: {
|
|
5440
|
+
type: 'object',
|
|
5441
|
+
description: 'Suggested accounts from the rule'
|
|
5442
|
+
},
|
|
5443
|
+
alternatives: {
|
|
5444
|
+
type: 'array',
|
|
5445
|
+
description: 'Alternative rules that also match'
|
|
5446
|
+
},
|
|
5447
|
+
reasons: {
|
|
5448
|
+
description: 'Human-readable reasons for the match',
|
|
5449
|
+
example: [
|
|
5450
|
+
'Moderate confidence (65%)',
|
|
5451
|
+
'Some keywords matched (OR logic)'
|
|
5452
|
+
],
|
|
5453
|
+
type: 'array',
|
|
5454
|
+
items: {
|
|
5455
|
+
type: 'string'
|
|
5456
|
+
}
|
|
5457
|
+
}
|
|
5458
|
+
},
|
|
5459
|
+
required: [
|
|
5460
|
+
'confidence',
|
|
5461
|
+
'matchedRule',
|
|
5462
|
+
'suggestedAccounts',
|
|
5463
|
+
'alternatives',
|
|
5464
|
+
'reasons'
|
|
5465
|
+
]
|
|
5466
|
+
} as const;
|
|
5467
|
+
|
|
5468
|
+
export const $NlpAccountConfirmationDataDto = {
|
|
5469
|
+
type: 'object',
|
|
5470
|
+
properties: {
|
|
5471
|
+
invalidAccount: {
|
|
5472
|
+
type: 'string',
|
|
5473
|
+
description: 'The invalid account name',
|
|
5474
|
+
example: 'Expenses:Food:Coffee'
|
|
5475
|
+
},
|
|
5476
|
+
suggestedAccount: {
|
|
5477
|
+
type: 'string',
|
|
5478
|
+
description: 'Suggested replacement account',
|
|
5479
|
+
example: 'Expenses:Food:Drinks'
|
|
5480
|
+
},
|
|
5481
|
+
similarAccounts: {
|
|
5482
|
+
description: 'Similar accounts for user selection',
|
|
5483
|
+
type: 'array',
|
|
5484
|
+
items: {
|
|
5485
|
+
type: 'string'
|
|
5486
|
+
}
|
|
5487
|
+
},
|
|
5488
|
+
errorMessage: {
|
|
5489
|
+
type: 'string',
|
|
5490
|
+
description: 'Error message explaining the issue',
|
|
5491
|
+
example: 'No similar account found'
|
|
5492
|
+
},
|
|
5493
|
+
transactionContext: {
|
|
5494
|
+
type: 'object',
|
|
5495
|
+
description: 'Transaction context for reference'
|
|
5496
|
+
}
|
|
5497
|
+
},
|
|
5498
|
+
required: [
|
|
5499
|
+
'invalidAccount',
|
|
5500
|
+
'suggestedAccount',
|
|
5501
|
+
'similarAccounts',
|
|
5502
|
+
'errorMessage',
|
|
5503
|
+
'transactionContext'
|
|
5504
|
+
]
|
|
5505
|
+
} as const;
|
|
5506
|
+
|
|
5507
|
+
export const $NlpSuggestedPayeeDto = {
|
|
5508
|
+
type: 'object',
|
|
5509
|
+
properties: {
|
|
5510
|
+
id: {
|
|
5511
|
+
type: 'string',
|
|
5512
|
+
description: 'Payee ID',
|
|
5513
|
+
example: 'payee-123'
|
|
5514
|
+
},
|
|
5515
|
+
name: {
|
|
5516
|
+
type: 'string',
|
|
5517
|
+
description: 'Payee name',
|
|
5518
|
+
example: 'Starbucks'
|
|
5519
|
+
},
|
|
5520
|
+
category: {
|
|
5521
|
+
type: 'string',
|
|
5522
|
+
description: 'Payee category',
|
|
5523
|
+
example: 'food'
|
|
5524
|
+
},
|
|
5525
|
+
source: {
|
|
5526
|
+
type: 'string',
|
|
5527
|
+
description: 'Source of the payee',
|
|
5528
|
+
enum: ['user', 'global']
|
|
5529
|
+
},
|
|
5530
|
+
payeeProfileId: {
|
|
5531
|
+
type: 'string',
|
|
5532
|
+
description: 'PayeeProfile ID (if matched from global)',
|
|
5533
|
+
example: 'profile-456'
|
|
5534
|
+
}
|
|
5535
|
+
},
|
|
5536
|
+
required: ['id', 'name']
|
|
5537
|
+
} as const;
|
|
5538
|
+
|
|
5539
|
+
export const $NlpAlternativePayeeDto = {
|
|
5540
|
+
type: 'object',
|
|
5541
|
+
properties: {
|
|
5542
|
+
id: {
|
|
5543
|
+
type: 'string',
|
|
5544
|
+
description: 'Payee ID',
|
|
5545
|
+
example: 'payee-alt-1'
|
|
5546
|
+
},
|
|
5547
|
+
name: {
|
|
5548
|
+
type: 'string',
|
|
5549
|
+
description: 'Payee name',
|
|
5550
|
+
example: 'Starbucks Coffee'
|
|
5551
|
+
},
|
|
5552
|
+
similarity: {
|
|
5553
|
+
type: 'number',
|
|
5554
|
+
description: 'Similarity score (0-1)',
|
|
5555
|
+
example: 0.75
|
|
5556
|
+
}
|
|
5557
|
+
},
|
|
5558
|
+
required: ['id', 'name', 'similarity']
|
|
5559
|
+
} as const;
|
|
5560
|
+
|
|
5561
|
+
export const $NlpPayeeConfirmationDataDto = {
|
|
5562
|
+
type: 'object',
|
|
5563
|
+
properties: {
|
|
5564
|
+
confidence: {
|
|
5565
|
+
type: 'number',
|
|
5566
|
+
description: 'Confidence score for the payee match (0-1)',
|
|
5567
|
+
example: 0.65
|
|
5568
|
+
},
|
|
5569
|
+
originalPayee: {
|
|
5570
|
+
type: 'string',
|
|
5571
|
+
description: 'Original payee string from user input',
|
|
5572
|
+
example: '星巴'
|
|
5573
|
+
},
|
|
5574
|
+
suggestedPayee: {
|
|
5575
|
+
description: 'Suggested payee to use (null when no similar payees found)',
|
|
5576
|
+
nullable: true,
|
|
5577
|
+
allOf: [
|
|
5578
|
+
{
|
|
5579
|
+
$ref: '#/components/schemas/NlpSuggestedPayeeDto'
|
|
5580
|
+
}
|
|
5581
|
+
]
|
|
5582
|
+
},
|
|
5583
|
+
similarity: {
|
|
5584
|
+
type: 'number',
|
|
5585
|
+
description: 'Similarity score between original and suggested (0-1)',
|
|
5586
|
+
example: 0.85
|
|
5587
|
+
},
|
|
5588
|
+
alternatives: {
|
|
5589
|
+
description: 'Alternative payee options',
|
|
5590
|
+
type: 'array',
|
|
5591
|
+
items: {
|
|
5592
|
+
$ref: '#/components/schemas/NlpAlternativePayeeDto'
|
|
5593
|
+
}
|
|
5594
|
+
},
|
|
5595
|
+
reasons: {
|
|
5596
|
+
description: 'Human-readable reasons for the match',
|
|
5597
|
+
example: ['Moderate similarity (65%)', 'Fuzzy match on name'],
|
|
5598
|
+
type: 'array',
|
|
5599
|
+
items: {
|
|
5600
|
+
type: 'string'
|
|
5601
|
+
}
|
|
5602
|
+
}
|
|
5603
|
+
},
|
|
5604
|
+
required: [
|
|
5605
|
+
'confidence',
|
|
5606
|
+
'originalPayee',
|
|
5607
|
+
'similarity',
|
|
5608
|
+
'alternatives',
|
|
5609
|
+
'reasons'
|
|
5610
|
+
]
|
|
5611
|
+
} as const;
|
|
5612
|
+
|
|
5613
|
+
export const $RecurringMatchInfoDto = {
|
|
5614
|
+
type: 'object',
|
|
5615
|
+
properties: {
|
|
5616
|
+
expectedId: {
|
|
5617
|
+
type: 'string',
|
|
5618
|
+
description: 'Expected transaction ID'
|
|
5619
|
+
},
|
|
5620
|
+
ruleId: {
|
|
5621
|
+
type: 'string',
|
|
5622
|
+
description: 'Recurring rule ID'
|
|
5623
|
+
},
|
|
5624
|
+
ruleName: {
|
|
5625
|
+
type: 'string',
|
|
5626
|
+
description: 'Rule name for display'
|
|
5627
|
+
},
|
|
5628
|
+
ruleIcon: {
|
|
5629
|
+
type: 'string',
|
|
5630
|
+
description: 'Rule icon'
|
|
5631
|
+
},
|
|
5632
|
+
expectedDate: {
|
|
5633
|
+
type: 'string',
|
|
5634
|
+
description: 'Expected date (YYYY-MM-DD)',
|
|
5635
|
+
example: '2026-01-05'
|
|
5636
|
+
},
|
|
5637
|
+
expectedAmount: {
|
|
5638
|
+
type: 'number',
|
|
5639
|
+
description: 'Expected amount',
|
|
5640
|
+
example: 3000
|
|
5641
|
+
},
|
|
5642
|
+
confidence: {
|
|
5643
|
+
type: 'number',
|
|
5644
|
+
description: 'Match confidence score (0-1)',
|
|
5645
|
+
example: 0.88
|
|
5646
|
+
},
|
|
5647
|
+
isAutoMatched: {
|
|
5648
|
+
type: 'boolean',
|
|
5649
|
+
description: 'Whether auto-matched (confidence >= 0.82)'
|
|
5650
|
+
}
|
|
5651
|
+
},
|
|
5652
|
+
required: [
|
|
5653
|
+
'expectedId',
|
|
5654
|
+
'ruleId',
|
|
5655
|
+
'ruleName',
|
|
5656
|
+
'expectedDate',
|
|
5657
|
+
'expectedAmount',
|
|
5658
|
+
'confidence',
|
|
5659
|
+
'isAutoMatched'
|
|
5660
|
+
]
|
|
5661
|
+
} as const;
|
|
5662
|
+
|
|
5663
|
+
export const $NlpSuggestedAccountDto = {
|
|
5664
|
+
type: 'object',
|
|
5665
|
+
properties: {
|
|
5666
|
+
account: {
|
|
5667
|
+
type: 'string',
|
|
5668
|
+
description: 'Suggested account path',
|
|
5669
|
+
example: 'Assets:Bank:Checking'
|
|
5670
|
+
},
|
|
5671
|
+
confidence: {
|
|
5672
|
+
type: 'number',
|
|
5673
|
+
description: 'Confidence score for this suggestion (0-1)',
|
|
5674
|
+
example: 0.9
|
|
5675
|
+
}
|
|
5676
|
+
},
|
|
5677
|
+
required: ['account']
|
|
5678
|
+
} as const;
|
|
5679
|
+
|
|
5680
|
+
export const $NlpSuggestedAccountsDto = {
|
|
5681
|
+
type: 'object',
|
|
5682
|
+
properties: {
|
|
5683
|
+
source: {
|
|
5684
|
+
description:
|
|
5685
|
+
'Source account suggestion (where money comes from). For expense: asset/liability account. For income: income account.',
|
|
5686
|
+
allOf: [
|
|
5687
|
+
{
|
|
5688
|
+
$ref: '#/components/schemas/NlpSuggestedAccountDto'
|
|
4892
5689
|
}
|
|
4893
5690
|
]
|
|
4894
5691
|
},
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
5692
|
+
destination: {
|
|
5693
|
+
description:
|
|
5694
|
+
'Destination account suggestion (where money goes to). For expense: expense account. For income: asset/liability account.',
|
|
5695
|
+
allOf: [
|
|
4899
5696
|
{
|
|
4900
|
-
|
|
4901
|
-
amount: 50,
|
|
4902
|
-
iso_currency_code: 'USD',
|
|
4903
|
-
date: '2024-01-15',
|
|
4904
|
-
merchant_name: 'Starbucks',
|
|
4905
|
-
name: 'STARBUCKS STORE 12345',
|
|
4906
|
-
pending: false,
|
|
4907
|
-
account_id: 'acc-001'
|
|
5697
|
+
$ref: '#/components/schemas/NlpSuggestedAccountDto'
|
|
4908
5698
|
}
|
|
4909
5699
|
]
|
|
4910
5700
|
}
|
|
4911
|
-
}
|
|
4912
|
-
required: ['config', 'transactions']
|
|
5701
|
+
}
|
|
4913
5702
|
} as const;
|
|
4914
5703
|
|
|
4915
|
-
export const $
|
|
5704
|
+
export const $NlpDefaultAccountsDto = {
|
|
4916
5705
|
type: 'object',
|
|
4917
5706
|
properties: {
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
5707
|
+
asset: {
|
|
5708
|
+
type: 'string',
|
|
5709
|
+
description: 'Default asset account',
|
|
5710
|
+
example: 'Assets:Bank:Checking'
|
|
5711
|
+
},
|
|
5712
|
+
expense: {
|
|
5713
|
+
type: 'string',
|
|
5714
|
+
description: 'Default expense account',
|
|
5715
|
+
example: 'Expenses:Uncategorized'
|
|
5716
|
+
},
|
|
5717
|
+
income: {
|
|
5718
|
+
type: 'string',
|
|
5719
|
+
description: 'Default income account',
|
|
5720
|
+
example: 'Income:Uncategorized'
|
|
5721
|
+
},
|
|
5722
|
+
liability: {
|
|
5723
|
+
type: 'string',
|
|
5724
|
+
description: 'Default liability account',
|
|
5725
|
+
example: 'Liabilities:CreditCard'
|
|
4934
5726
|
}
|
|
4935
5727
|
},
|
|
4936
|
-
required: ['
|
|
4937
|
-
} as const;
|
|
4938
|
-
|
|
4939
|
-
export const $ParserTelemetryReportDto = {
|
|
4940
|
-
type: 'object',
|
|
4941
|
-
properties: {}
|
|
4942
|
-
} as const;
|
|
4943
|
-
|
|
4944
|
-
export const $UncoveredFormatMissDto = {
|
|
4945
|
-
type: 'object',
|
|
4946
|
-
properties: {}
|
|
5728
|
+
required: ['asset', 'expense', 'income', 'liability']
|
|
4947
5729
|
} as const;
|
|
4948
5730
|
|
|
4949
|
-
export const $
|
|
5731
|
+
export const $NlpResponseDto = {
|
|
4950
5732
|
type: 'object',
|
|
4951
5733
|
properties: {
|
|
5734
|
+
status: {
|
|
5735
|
+
type: 'string',
|
|
5736
|
+
description: 'Response status',
|
|
5737
|
+
enum: ['success', 'pending', 'error']
|
|
5738
|
+
},
|
|
5739
|
+
action: {
|
|
5740
|
+
type: 'string',
|
|
5741
|
+
description: 'Action taken or requested',
|
|
5742
|
+
enum: [
|
|
5743
|
+
'created',
|
|
5744
|
+
'ask',
|
|
5745
|
+
'confirm',
|
|
5746
|
+
'confirm_duplicate',
|
|
5747
|
+
'confirm_rule',
|
|
5748
|
+
'confirm_account',
|
|
5749
|
+
'confirm_payee',
|
|
5750
|
+
'cancel'
|
|
5751
|
+
]
|
|
5752
|
+
},
|
|
5753
|
+
intent: {
|
|
5754
|
+
type: 'string',
|
|
5755
|
+
description:
|
|
5756
|
+
'Transaction intent detected by EntityRouter (v6.0: 5 core intents). Frontend uses this to render scenario-specific form fields.',
|
|
5757
|
+
enum: ['expense', 'asset', 'income', 'liability', 'equity'],
|
|
5758
|
+
example: 'expense'
|
|
5759
|
+
},
|
|
5760
|
+
assetSubType: {
|
|
5761
|
+
type: 'string',
|
|
5762
|
+
description:
|
|
5763
|
+
'Asset sub-type (only present when intent is "asset"). Determines which asset-related form to render.',
|
|
5764
|
+
enum: ['transfer', 'banking', 'investment'],
|
|
5765
|
+
example: 'investment'
|
|
5766
|
+
},
|
|
5767
|
+
liabilitySubType: {
|
|
5768
|
+
type: 'string',
|
|
5769
|
+
description:
|
|
5770
|
+
'Liability sub-type (only present when intent is "liability"). borrow: borrowing money (Liabilities → Assets), repay: repaying debt (Assets → Liabilities).',
|
|
5771
|
+
enum: ['borrow', 'repay'],
|
|
5772
|
+
example: 'borrow'
|
|
5773
|
+
},
|
|
5774
|
+
equitySubType: {
|
|
5775
|
+
type: 'string',
|
|
5776
|
+
description:
|
|
5777
|
+
'Equity sub-type (only present when intent is "equity"). opening: account opening balance (Equity → Assets), adjustment: balance correction.',
|
|
5778
|
+
enum: ['opening', 'adjustment'],
|
|
5779
|
+
example: 'opening'
|
|
5780
|
+
},
|
|
5781
|
+
paymentSource: {
|
|
5782
|
+
type: 'string',
|
|
5783
|
+
description:
|
|
5784
|
+
'Payment source for expense transactions (v6.1). Indicates whether payment comes from asset or liability account. Only present when intent is "expense".',
|
|
5785
|
+
enum: ['asset', 'liability'],
|
|
5786
|
+
example: 'liability'
|
|
5787
|
+
},
|
|
5788
|
+
liabilityHint: {
|
|
5789
|
+
type: 'string',
|
|
5790
|
+
description:
|
|
5791
|
+
'Liability account type hint for credit card/BNPL spending (v6.1). Only present when paymentSource is "liability". Values: CreditCard, Huabei, Baitiao',
|
|
5792
|
+
example: 'CreditCard'
|
|
5793
|
+
},
|
|
4952
5794
|
message: {
|
|
4953
5795
|
type: 'string',
|
|
4954
|
-
description:
|
|
4955
|
-
|
|
4956
|
-
|
|
5796
|
+
description:
|
|
5797
|
+
'Human-readable message (for ask or error actions). Deprecated: Use messageKey for i18n support.',
|
|
5798
|
+
example: 'How much did you spend?',
|
|
5799
|
+
deprecated: true
|
|
4957
5800
|
},
|
|
4958
|
-
|
|
5801
|
+
messageKey: {
|
|
4959
5802
|
type: 'string',
|
|
4960
5803
|
description:
|
|
4961
|
-
'
|
|
4962
|
-
example: '
|
|
5804
|
+
'i18n message key for frontend translation. Use this instead of message for internationalization support.',
|
|
5805
|
+
example: 'nlp.slot.prompt'
|
|
4963
5806
|
},
|
|
4964
|
-
|
|
5807
|
+
messageParams: {
|
|
4965
5808
|
type: 'object',
|
|
4966
5809
|
description:
|
|
4967
|
-
'
|
|
5810
|
+
'Parameters for message interpolation. Used with messageKey for dynamic values in translated messages.',
|
|
4968
5811
|
example: {
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
5812
|
+
slot: 'amount',
|
|
5813
|
+
name: 'Starbucks',
|
|
5814
|
+
similarity: 85
|
|
4972
5815
|
}
|
|
5816
|
+
},
|
|
5817
|
+
sessionId: {
|
|
5818
|
+
type: 'string',
|
|
5819
|
+
description:
|
|
5820
|
+
'Session ID for multi-turn dialogue. Must be included in subsequent requests to continue the conversation.',
|
|
5821
|
+
example: 'session_abc123'
|
|
5822
|
+
},
|
|
5823
|
+
waitingFor: {
|
|
5824
|
+
type: 'string',
|
|
5825
|
+
description: 'Which slot is waiting for user input',
|
|
5826
|
+
example: 'amount'
|
|
5827
|
+
},
|
|
5828
|
+
transaction: {
|
|
5829
|
+
description: 'Created transaction info (for created action)',
|
|
5830
|
+
allOf: [
|
|
5831
|
+
{
|
|
5832
|
+
$ref: '#/components/schemas/NlpTransactionInfoDto'
|
|
5833
|
+
}
|
|
5834
|
+
]
|
|
5835
|
+
},
|
|
5836
|
+
parsedData: {
|
|
5837
|
+
description:
|
|
5838
|
+
'Parsed data for confirmation (when action is "confirm"). Contains extracted fields that user should verify before transaction creation.',
|
|
5839
|
+
allOf: [
|
|
5840
|
+
{
|
|
5841
|
+
$ref: '#/components/schemas/NlpParsedDataDto'
|
|
5842
|
+
}
|
|
5843
|
+
]
|
|
5844
|
+
},
|
|
5845
|
+
duplicateData: {
|
|
5846
|
+
description:
|
|
5847
|
+
'Duplicate detection data (when action is "confirm_duplicate"). Contains information about potential duplicate transaction for user confirmation.',
|
|
5848
|
+
allOf: [
|
|
5849
|
+
{
|
|
5850
|
+
$ref: '#/components/schemas/NlpDuplicateConfirmationDataDto'
|
|
5851
|
+
}
|
|
5852
|
+
]
|
|
5853
|
+
},
|
|
5854
|
+
ruleData: {
|
|
5855
|
+
description:
|
|
5856
|
+
'Rule match data (when action is "confirm_rule"). Contains information about medium-confidence rule match for user confirmation.',
|
|
5857
|
+
allOf: [
|
|
5858
|
+
{
|
|
5859
|
+
$ref: '#/components/schemas/NlpRuleConfirmationDataDto'
|
|
5860
|
+
}
|
|
5861
|
+
]
|
|
5862
|
+
},
|
|
5863
|
+
accountData: {
|
|
5864
|
+
description:
|
|
5865
|
+
'Account validation data (when action is "confirm_account"). Contains information about invalid account for user correction.',
|
|
5866
|
+
allOf: [
|
|
5867
|
+
{
|
|
5868
|
+
$ref: '#/components/schemas/NlpAccountConfirmationDataDto'
|
|
5869
|
+
}
|
|
5870
|
+
]
|
|
5871
|
+
},
|
|
5872
|
+
payeeData: {
|
|
5873
|
+
description:
|
|
5874
|
+
'Payee confirmation data (when action is "confirm_payee"). Contains information about medium/low confidence payee match for user confirmation.',
|
|
5875
|
+
allOf: [
|
|
5876
|
+
{
|
|
5877
|
+
$ref: '#/components/schemas/NlpPayeeConfirmationDataDto'
|
|
5878
|
+
}
|
|
5879
|
+
]
|
|
5880
|
+
},
|
|
5881
|
+
confidence: {
|
|
5882
|
+
type: 'number',
|
|
5883
|
+
description: 'Overall confidence score (0-1)',
|
|
5884
|
+
example: 0.85
|
|
5885
|
+
},
|
|
5886
|
+
confidenceThreshold: {
|
|
5887
|
+
type: 'number',
|
|
5888
|
+
description:
|
|
5889
|
+
'Confidence threshold for automatic creation (default: 0.75). When confidence < threshold, action will be "confirm" requiring user verification.',
|
|
5890
|
+
example: 0.75
|
|
5891
|
+
},
|
|
5892
|
+
recurringMatch: {
|
|
5893
|
+
description:
|
|
5894
|
+
'Recurring transaction match info (when action is "created"). Contains match details when transaction matches a pending expected transaction.',
|
|
5895
|
+
allOf: [
|
|
5896
|
+
{
|
|
5897
|
+
$ref: '#/components/schemas/RecurringMatchInfoDto'
|
|
5898
|
+
}
|
|
5899
|
+
]
|
|
5900
|
+
},
|
|
5901
|
+
recurringSuggestion: {
|
|
5902
|
+
description:
|
|
5903
|
+
'Recurring rule creation suggestion (when action is "created"). Contains suggestion to create a recurring rule based on detected patterns. Only present when no existing rule matched and similar historical transactions were found.',
|
|
5904
|
+
allOf: [
|
|
5905
|
+
{
|
|
5906
|
+
$ref: '#/components/schemas/RecurringSuggestionDto'
|
|
5907
|
+
}
|
|
5908
|
+
]
|
|
5909
|
+
},
|
|
5910
|
+
suggestedAccounts: {
|
|
5911
|
+
description:
|
|
5912
|
+
'Suggested accounts for this transaction. Contains recommended source and destination accounts based on the detected intent and rules.',
|
|
5913
|
+
allOf: [
|
|
5914
|
+
{
|
|
5915
|
+
$ref: '#/components/schemas/NlpSuggestedAccountsDto'
|
|
5916
|
+
}
|
|
5917
|
+
]
|
|
5918
|
+
},
|
|
5919
|
+
defaultAccounts: {
|
|
5920
|
+
description:
|
|
5921
|
+
'Default accounts for the user/region. These are fallback accounts used when no specific suggestion is available.',
|
|
5922
|
+
allOf: [
|
|
5923
|
+
{
|
|
5924
|
+
$ref: '#/components/schemas/NlpDefaultAccountsDto'
|
|
5925
|
+
}
|
|
5926
|
+
]
|
|
4973
5927
|
}
|
|
4974
5928
|
},
|
|
4975
|
-
required: ['
|
|
5929
|
+
required: ['status', 'action']
|
|
4976
5930
|
} as const;
|
|
4977
5931
|
|
|
4978
5932
|
export const $BalanceByCurrencyDto = {
|
|
@@ -6258,6 +7212,111 @@ export const $PortfolioTrendsResponseDto = {
|
|
|
6258
7212
|
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
6259
7213
|
} as const;
|
|
6260
7214
|
|
|
7215
|
+
export const $CashFlowPointDto = {
|
|
7216
|
+
type: 'object',
|
|
7217
|
+
properties: {
|
|
7218
|
+
month: {
|
|
7219
|
+
type: 'string',
|
|
7220
|
+
description: 'Month key (YYYY-MM)',
|
|
7221
|
+
example: '2024-03'
|
|
7222
|
+
},
|
|
7223
|
+
income: {
|
|
7224
|
+
type: 'string',
|
|
7225
|
+
description: 'Income in base currency (absolute, converted)',
|
|
7226
|
+
example: '10000.00'
|
|
7227
|
+
},
|
|
7228
|
+
expense: {
|
|
7229
|
+
type: 'string',
|
|
7230
|
+
description: 'Expense in base currency (absolute, converted)',
|
|
7231
|
+
example: '5000.00'
|
|
7232
|
+
},
|
|
7233
|
+
netSavings: {
|
|
7234
|
+
type: 'string',
|
|
7235
|
+
description: 'netSavings = income − expense (savings positive)',
|
|
7236
|
+
example: '5000.00'
|
|
7237
|
+
}
|
|
7238
|
+
},
|
|
7239
|
+
required: ['month', 'income', 'expense', 'netSavings']
|
|
7240
|
+
} as const;
|
|
7241
|
+
|
|
7242
|
+
export const $CashFlowTrendSummaryDto = {
|
|
7243
|
+
type: 'object',
|
|
7244
|
+
properties: {
|
|
7245
|
+
totalIncome: {
|
|
7246
|
+
type: 'string',
|
|
7247
|
+
description: 'Total income across the period',
|
|
7248
|
+
example: '60000.00'
|
|
7249
|
+
},
|
|
7250
|
+
totalExpense: {
|
|
7251
|
+
type: 'string',
|
|
7252
|
+
description: 'Total expense across the period',
|
|
7253
|
+
example: '30000.00'
|
|
7254
|
+
},
|
|
7255
|
+
totalNetSavings: {
|
|
7256
|
+
type: 'string',
|
|
7257
|
+
description: 'income − expense across the period',
|
|
7258
|
+
example: '30000.00'
|
|
7259
|
+
},
|
|
7260
|
+
averageMonthlyNetSavings: {
|
|
7261
|
+
type: 'string',
|
|
7262
|
+
description:
|
|
7263
|
+
'totalNetSavings divided by the window length (N months, incl. zero-filled)',
|
|
7264
|
+
example: '5000.00'
|
|
7265
|
+
}
|
|
7266
|
+
},
|
|
7267
|
+
required: [
|
|
7268
|
+
'totalIncome',
|
|
7269
|
+
'totalExpense',
|
|
7270
|
+
'totalNetSavings',
|
|
7271
|
+
'averageMonthlyNetSavings'
|
|
7272
|
+
]
|
|
7273
|
+
} as const;
|
|
7274
|
+
|
|
7275
|
+
export const $CashFlowTrendsResponseDto = {
|
|
7276
|
+
type: 'object',
|
|
7277
|
+
properties: {
|
|
7278
|
+
series: {
|
|
7279
|
+
description:
|
|
7280
|
+
'Monthly cash-flow series (fixed N-month window, zero-filled)',
|
|
7281
|
+
type: 'array',
|
|
7282
|
+
items: {
|
|
7283
|
+
$ref: '#/components/schemas/CashFlowPointDto'
|
|
7284
|
+
}
|
|
7285
|
+
},
|
|
7286
|
+
summary: {
|
|
7287
|
+
description: 'Period totals',
|
|
7288
|
+
allOf: [
|
|
7289
|
+
{
|
|
7290
|
+
$ref: '#/components/schemas/CashFlowTrendSummaryDto'
|
|
7291
|
+
}
|
|
7292
|
+
]
|
|
7293
|
+
},
|
|
7294
|
+
period: {
|
|
7295
|
+
type: 'string',
|
|
7296
|
+
description: 'Period requested',
|
|
7297
|
+
example: '6m'
|
|
7298
|
+
},
|
|
7299
|
+
granularity: {
|
|
7300
|
+
type: 'string',
|
|
7301
|
+
description: 'Data granularity (v1 returns month buckets)',
|
|
7302
|
+
example: 'month'
|
|
7303
|
+
},
|
|
7304
|
+
currency: {
|
|
7305
|
+
type: 'string',
|
|
7306
|
+
description: 'Base currency for converted values',
|
|
7307
|
+
example: 'CNY'
|
|
7308
|
+
},
|
|
7309
|
+
warnings: {
|
|
7310
|
+
description: 'Exchange rate warnings (e.g. missing rate for a currency)',
|
|
7311
|
+
type: 'array',
|
|
7312
|
+
items: {
|
|
7313
|
+
$ref: '#/components/schemas/ExchangeRateWarningDto'
|
|
7314
|
+
}
|
|
7315
|
+
}
|
|
7316
|
+
},
|
|
7317
|
+
required: ['series', 'summary', 'period', 'granularity', 'currency']
|
|
7318
|
+
} as const;
|
|
7319
|
+
|
|
6261
7320
|
export const $GenerateSnapshotBody = {
|
|
6262
7321
|
type: 'object',
|
|
6263
7322
|
properties: {}
|