补充财务主体缺失阻断诊断

This commit is contained in:
2026-08-12 13:55:16 +08:00
parent 49967bbc28
commit 4375beaa13
2 changed files with 27 additions and 1 deletions
@@ -29,6 +29,10 @@ function rejectedWith(response, code) {
return response?.http === 200 && String(response?.body?.code) === code
}
function accessDenied(response) { return rejectedWith(response, 'A0403') }
function financeSubjectMissing(response) {
return rejectedWith(response, 'FIN_409')
&& String(response?.body?.message ?? '').includes('平台财务主体未配置')
}
function sameIds(actual, expected) {
const left = [...new Set(actual)].sort()
const right = [...new Set(expected)].sort()
@@ -301,6 +305,13 @@ export async function run(context) {
finish(context, start)
return
}
if (financeSubjectMissing(created.response)) {
blocker(context, '平台财务主体 Fixture 门禁',
`POST ${BASE}/statements 返回 FIN_409 平台财务主体未配置;sourceIds=${created.body.feeSourceIds.join(',')}, requestId=${created.response.requestId ?? 'null'}, traceId=${created.response.traceId ?? 'null'};需在测试库 fin_subject 中提供 ACTIVE 主体`,
'missing-active-finance-subject', created.response)
finish(context, start)
return
}
context.assert(MODULE, `第 ${index + 1} 张仅使用分组来源`, created.response,
created.statement && sameIds(lineSourceIds(created.statement), groups[index].map((source) => source.feeSourceId)),
`expected=${groups[index].length}, actual=${lineSourceIds(created.statement).length}`, OPTIONS)