修复授权分页并补齐追回到账诊断验证(09-17-company-loan-principal-repayment)
这个提交包含在:
@@ -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' } }));
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户