修复授权分页并补齐追回到账诊断验证(09-17-company-loan-principal-repayment)

这个提交包含在:
2026-10-10 21:56:08 +08:00
父节点 db919dc6f6
当前提交 91fe31f0db
共修改 14 个文件,包含 623 行新增和 25 行删除
+13 -2
查看文件
@@ -471,7 +471,13 @@ module.exports = async function relatedFixture(h) {
}
checks.push('rp_only_payee_conflict_waived_multiple_roles_tokens_and_q6_refused');
for (const [cancelled, paidAmount, reserveAmount] of [[false, '0.00', '0.00'], [true, '0.00', '70.00'], [true, '60.00', '0.00'], [true, '100.00', '0.00']]) {
const s = await setup('100.00'); const b = await batch(s, '80.00'); await terminate(s, b, cancelled);
const s = await setup('100.00'); const b = await batch(s, '80.00');
let voidedEvidenceId;
if (paidAmount === '60.00') {
voidedEvidenceId = await evidence(b, 'incoming_return');
await call(finance, 'POST', `${base(b)}/loan-terminal-evidences/${voidedEvidenceId}/void`, { reason: '合成取消前作废未消费退款材料' });
}
await terminate(s, b, cancelled);
if (paidAmount !== '0.00') {
const p = await batch(s, paidAmount); await receipt(p.id, String(Math.round(Number(paidAmount) * 100)), `RP-PAID-${randomUUID()}`, { payeeAccount: s.lender.bankAccount });
await call(finance, 'POST', `${base(p)}/execute`, {});
@@ -489,7 +495,12 @@ module.exports = async function relatedFixture(h) {
assert.equal((await balance(s)).reserved, '0.00');
if (excess) {
await authorization(s.lender, [s.loan]);
for (const value of [15, excess - 15]) {
if (excess === 40) checks.push(...await require('./company-loan-bank-results-fixture.cjs').verifyReturnGuards({
prisma, pool, call, finance, batchId: b.id, lenderId: s.lender.id, loanId: s.loan.id, parentId: e.id, voidedEvidenceId,
fields: (amount, incoming) => fields(s, amount, `RP-RETURN-GUARD-${randomUUID()}`, incoming), upload: kind => evidence(b, kind),
review: (event, status = 200, more = {}) => review(b, event, 'loan-bank-results', status, manager, more),
apply: (event, status = 200) => apply(b, event, status), prefix: 'related' }));
else for (const value of [15, excess - 15]) {
const ret = await bankEvent(s, b, 'return', value.toFixed(2), e.id); await review(b, ret, 'loan-bank-results'); await apply(b, ret);
if (value === 15) assert.ok(await prisma.loanFreezeReason.count({ where: { lender_id: s.lender.id, status: 'active' } }));
}