refactor(platform): remove deprecated reporting and audit modules

This commit is contained in:
2026-07-27 15:31:22 +08:00
parent e88734c0fd
commit a98fdd0fca
42 changed files with 86 additions and 674 deletions

View File

@@ -28,13 +28,13 @@ function loadResourceForm() {
return resourceModule.exports;
}
test('资源字段声明保留数字、布尔、时间与 JSON 类型', () => {
test('资源字段声明保留数字、布尔、时间与文本类型', () => {
const resources = loadResources();
const field = (resource, key) => resources.find((item) => item.name === resource).fields.find((item) => item.key === key);
assert.equal(field('ec_product', 'price_amount').type, 'number');
assert.equal(field('ec_product_image', 'is_cover').type, 'boolean');
assert.equal(field('delivery_track', 'started_at').type, 'datetime');
assert.equal(field('dev_telemetry', 'payload').type, 'json');
assert.equal(field('dev_telemetry', 'payload').type, 'textarea');
});
test('表单载荷构造器省略空的可选关系并转换字段类型', async () => {
@@ -56,7 +56,7 @@ test('表单载荷构造器省略空的可选关系并转换字段类型', async
);
});
test('安全规则与订单明细将 JSON 字段作为有效 JSON 字符串提交', () => {
test('安全规则与订单明细的文本字段允许任意文本提交', () => {
const resources = loadResources();
const { buildResourcePayload } = loadResourceForm();
const fields = (name) => resources.find((item) => item.name === name).fields;
@@ -64,29 +64,29 @@ test('安全规则与订单明细将 JSON 字段作为有效 JSON 字符串提
assert.deepEqual(
JSON.parse(JSON.stringify(buildResourcePayload(fields('safe_rule'), {
rule_code: 'pressure-limit',
threshold: '{"max":10}',
threshold: '{invalid}',
action: 'close-valve',
gray_scope: '["north"]',
gray_scope: 'north region only',
}))),
{
rule_code: 'pressure-limit',
threshold: '{"max":10}',
threshold: '{invalid}',
action: 'close-valve',
gray_scope: '["north"]',
gray_scope: 'north region only',
},
);
assert.deepEqual(
JSON.parse(JSON.stringify(buildResourcePayload(fields('ec_order_item'), {
ec_order_identity: 'order-a',
ec_product_identity: 'product-a',
product_snapshot: '{"name":"液化气"}',
product_snapshot: 'arbitrary product snapshot text',
quantity: 2,
sale_amount: 500,
}))),
{
ec_order_identity: 'order-a',
ec_product_identity: 'product-a',
product_snapshot: '{"name":"液化气"}',
product_snapshot: 'arbitrary product snapshot text',
quantity: 2,
sale_amount: 500,
},
@@ -131,11 +131,11 @@ test('日期按 RFC3339 提交,密码只在创建时必填并提交', () => {
);
});
test('审批只读页提供同意和驳回操作', () => {
test('已删除的审批模块不再保留前端资源或页面', () => {
const source = fs.readFileSync(fromProjectRoot('src/views/shared/ReadOnlyListPage.vue'), 'utf8');
const resources = fs.readFileSync(fromProjectRoot('src/api/resources.ts'), 'utf8');
assert.match(resources, /audit_approval[\s\S]*\/audit\/audit_approval\/:identity\/approve/);
assert.match(source, /submitDetailAction/);
assert.doesNotMatch(resources, /audit_approval|audit_operation_log|audit_export_log/);
assert.equal(fs.existsSync(fromProjectRoot('src/views/audit')), false);
});
test('树页面通过资源归档接口归档节点', () => {