docs+test: 补充成本缺失、退款期间与追溯限制说明
This commit is contained in:
@@ -171,3 +171,26 @@ test('人工确认后必须立刻重算该业务日事实与总账', async () =>
|
||||
assert.ok(source.includes('rebuildChannelSalesDailyFacts'), '必须重算渠道销售事实')
|
||||
assert.ok(source.includes('syncFinanceLedgerFromFacts'), '必须同步总账')
|
||||
})
|
||||
|
||||
test('成本缺失按渠道期望成本项判定,不能被通用费用掩盖', async () => {
|
||||
const facts = await read(new URL('./sales-facts-channel-service.ts', import.meta.url))
|
||||
assert.ok(facts.includes('channel_cost_code'))
|
||||
assert.ok(facts.includes("'sys_affiliate_purchase'"))
|
||||
assert.ok(facts.includes("cs.subject_type = 'manual_case'"))
|
||||
})
|
||||
|
||||
test('退款所属期间关账时必须阻断', async () => {
|
||||
const refund = await read(new URL('./order-refund-service.ts', import.meta.url))
|
||||
assert.ok(refund.includes('assertRefundMonthOpen'))
|
||||
assert.ok(refund.includes('退款所属期间'))
|
||||
})
|
||||
|
||||
test('成本版本与基线导入不允许追溯历史', async () => {
|
||||
const [definition, affiliate] = await Promise.all([
|
||||
read(new URL('../cost-center/cost-definition-service.ts', import.meta.url)),
|
||||
read(new URL('../cost-center/affiliate-product-service.ts', import.meta.url)),
|
||||
])
|
||||
assert.ok(definition.includes('cost_effective_from_in_past'))
|
||||
assert.ok(affiliate.includes('cost_baseline_import_blocked'))
|
||||
assert.ok(!affiliate.includes('shiftDate(today, -30)'))
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user