fix finance acceptance source ownership checks
This commit is contained in:
@@ -75,6 +75,9 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
|
||||
if (method === 'GET' && requestPath === '/api/platform/v1/iam/authorization/permissions') {
|
||||
return ok(permissions)
|
||||
}
|
||||
if (method === 'GET' && requestPath.startsWith('/api/platform/v1/iam/tenants?')) {
|
||||
return ok({ records: [{ id: '11', status: 'ACTIVE' }, { id: '12', status: 'ACTIVE' }] })
|
||||
}
|
||||
if (denyFinanceWrites && method === 'POST' && requestPath.endsWith('/statements')) {
|
||||
return { http: 200, body: { code: 'A0403', message: 'Access denied' },
|
||||
requestId: 'request-denied', traceId: 'trace-denied' }
|
||||
@@ -88,6 +91,7 @@ function fakeContext(withFixture = true, permissions = financePermissions, denyF
|
||||
}
|
||||
if (method === 'POST' && requestPath.endsWith('/statements')) {
|
||||
if (body.currency !== 'CNY') return { http: 200, body: { code: 'FIN_400' } }
|
||||
if (String(body.customerId) !== '11') return { http: 200, body: { code: 'FIN_404' } }
|
||||
if (missingSubject) return { http: 200, body: { code: 'FIN_409', message: '平台财务主体未配置' },
|
||||
requestId: 'request-subject', traceId: 'trace-subject' }
|
||||
const selected = body.generationMode === 'BY_CUTOFF'
|
||||
@@ -160,6 +164,7 @@ test('静态契约覆盖日期、SELECTED、三 AR、AP、状态机和数组输
|
||||
assert.match(source, /fixture\.root\.receivableSettlements = arRows/)
|
||||
assert.doesNotMatch(source, /generationMode:\s*['"]BY_CUTOFF['"]/)
|
||||
assert.match(source, /\/fee-pool/)
|
||||
assert.match(source, /\/api\/platform\/v1\/iam\/tenants\?page=1&size=100&status=ACTIVE/)
|
||||
assert.match(source, /http: response\?\.http \?\? null/)
|
||||
assert.match(source, /requestId: response\?\.requestId \?\? null/)
|
||||
assert.match(source, /traceId: response\?\.traceId \?\? null/)
|
||||
|
||||
Reference in New Issue
Block a user