This commit is contained in:
2026-08-17 15:41:42 +08:00
parent 4abcb2b80f
commit 5f79616623
60 changed files with 1457 additions and 270 deletions
@@ -87,10 +87,16 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
return ok(permissions)
}
if (method === 'GET' && requestPath === '/api/platform/finance/v1/accounts?page=1&pageSize=20&customerId=11') {
return ok({ records: [{ customerId: '11', accountName: 'Fixture Account' }] })
return ok({ records: [{ customerId: '11', customerCode: 'TEN11', customerName: 'Fixture Account',
contactName: 'Fixture Contact', contactPhone: '13800000000', outstandingReceivable: 100,
pendingBilling: 20, receivedInPeriod: 30, outstandingPayable: 40, status: 'ACTIVE',
lastChangedAt: '2026-08-10T09:00:00' }] })
}
if (method === 'GET' && requestPath.startsWith('/api/platform/finance/v1/accounts/11/ledger?')) {
return ok({ records: [{ customerId: '11', statementId: '1', remark: marker }] })
return ok({ records: [{ customerId: '11', statementId: '1', ledgerId: '1',
occurredAt: '2026-08-10T09:00:00', businessType: 'SETTLEMENT_ISSUED', documentType: 'BILL',
documentId: '1', documentNo: 'REC-1', receivableChange: 100, payableChange: 0,
outstandingReceivableAfter: 100, operatorName: 'operator-7001', remark: marker }] })
}
if (method === 'GET' && requestPath.startsWith('/api/platform/v1/iam/tenants?')) {
return ok({ records: [{ id: '11', status: 'ACTIVE' }, { id: '12', status: 'ACTIVE' }] })
@@ -225,6 +231,10 @@ test('静态契约覆盖日期、SELECTED、三 AR、AP、状态机和数组输
assert.match(source, /\/accounts\/\$\{encodeURIComponent\(customerId\)\}\/ledger\?page=1&pageSize=200/)
assert.match(source, /balance.*recharge.*prepayment/)
assert.match(source, /accountReadback/)
assert.match(source, /accountInformationComplete/)
assert.match(source, /ledgerInformationComplete/)
assert.match(source, /客户账户基本信息、四项金额和最近变动时间完整/)
assert.match(source, /客户账户流水时间、业务类型、关联单据、金额和操作人完整/)
for (const action of ['SUBMIT', 'APPROVE', 'REJECT', 'ISSUE', 'ADJUST', 'VOID', 'REOPEN']) {
assert.match(source, new RegExp(`['"]${action}['"]`))
}