feat(M07-B): 接入充值优惠规则

This commit is contained in:
Codex
2026-06-24 15:37:01 +08:00
parent db1d08ecf8
commit d9743d36d8
9 changed files with 578 additions and 6 deletions
+16 -1
View File
@@ -72,6 +72,9 @@ const iotMessagesVerifySql = read('database/migrations/2026062220_m06c_iot_messa
const walletUpSql = read('database/migrations/2026062421_m07a_wallet_ledger.up.sql');
const walletDownSql = read('database/migrations/2026062421_m07a_wallet_ledger.down.sql');
const walletVerifySql = read('database/migrations/2026062421_m07a_wallet_ledger.verify.sql');
const rechargeUpSql = read('database/migrations/2026062422_m07b_recharge_plans.up.sql');
const rechargeDownSql = read('database/migrations/2026062422_m07b_recharge_plans.down.sql');
const rechargeVerifySql = read('database/migrations/2026062422_m07b_recharge_plans.verify.sql');
const coreTables = [
'qipai_schema_migrations',
@@ -331,4 +334,16 @@ assert.match(walletUpSql, /uq_qipai_wallet_ledger_business/);
assert.match(walletUpSql, /cash_delta_cents INT NOT NULL DEFAULT 0/);
assert.match(walletUpSql, /gift_delta_cents INT NOT NULL DEFAULT 0/);
console.log('PASS: M01-B through M07-A migration contracts are present.');
for (const table of ['qipai_recharge_plans', 'qipai_recharge_orders']) {
assert.match(rechargeUpSql, new RegExp(`CREATE TABLE IF NOT EXISTS ${table}`));
assert.match(rechargeDownSql, new RegExp(`DROP TABLE IF EXISTS ${table}`));
assert.match(rechargeVerifySql, new RegExp(`'${table}'`));
}
assert.match(rechargeUpSql, /pay_amount_cents INT UNSIGNED NOT NULL/);
assert.match(rechargeUpSql, /gift_amount_cents INT UNSIGNED NOT NULL DEFAULT 0/);
assert.match(rechargeUpSql, /purchase_limit_per_user INT UNSIGNED/);
assert.match(rechargeUpSql, /UNIQUE KEY uq_qipai_recharge_order_request/);
assert.match(rechargeUpSql, /payment_id BIGINT UNSIGNED NULL/);
assert.match(rechargeUpSql, /credited_at DATETIME\(3\) NULL/);
console.log('PASS: M01-B through M07-B migration contracts are present.');