feat(M10-B): 完成可复算经营报表与日汇总

This commit is contained in:
Codex
2026-08-11 09:50:05 +08:00
parent 5d70114bab
commit ee7b16c932
35 changed files with 1355 additions and 65 deletions
+27 -1
View File
@@ -156,6 +156,15 @@ const notificationDownSql = read(
const notificationVerifySql = read(
'database/migrations/2026081110_m10a_notification_center.verify.sql'
);
const businessReportUpSql = read(
'database/migrations/2026081111_m10b_business_reports.up.sql'
);
const businessReportDownSql = read(
'database/migrations/2026081111_m10b_business_reports.down.sql'
);
const businessReportVerifySql = read(
'database/migrations/2026081111_m10b_business_reports.verify.sql'
);
const coreTables = [
'qipai_schema_migrations',
@@ -751,4 +760,21 @@ assert.match(notificationUpSql, /'notification\.read'/);
assert.match(notificationUpSql, /'notification\.manage'/);
assert.match(notificationVerifySql, /'2026081110'/);
console.log('PASS: M01-B through M10-A migration contracts are present.');
assert.match(businessReportUpSql, /CREATE TABLE IF NOT EXISTS qipai_business_daily_summaries\b/);
for (const column of ['room_gross_cents', 'room_refund_cents', 'product_gross_cents',
'product_refund_cents', 'used_minutes', 'capacity_minutes', 'cleaning_cost_cents',
'wechat_net_cents', 'balance_net_cents', 'package_net_cents', 'group_buy_net_cents',
'source_checksum']) {
assert.match(businessReportUpSql, new RegExp(`\\b${column}\\b`));
}
for (const permission of ['report.read', 'report.export', 'report.manage']) {
const pattern = new RegExp(permission.replace('.', '\\.'));
assert.match(businessReportUpSql, pattern);
assert.match(businessReportDownSql, pattern);
assert.match(businessReportVerifySql, pattern);
}
assert.match(businessReportUpSql, /uq_qipai_business_daily_summary_date/);
assert.match(businessReportDownSql, /DROP TABLE IF EXISTS qipai_business_daily_summaries/);
assert.match(businessReportVerifySql, /'2026081111'/);
console.log('PASS: M01-B through M10-B migration contracts are present.');