feat(admin): quick-edit paid post settings in a dialog on the pay products page
- Rebuild aksrt_pay_products as list + in-page quick settings dialog (pay type, limit, cash/points prices, sales float, coupon, order expiry, copy) - Query by _aksrt_pay_type with real pagination; drop order-summary fallback and the duplicate "Meta 销量" column - Centralize pay meta writes in DomainModel::persist_pay_meta(); stop writing unread _aksrt_pay_modo / _aksrt_pay_limit keys Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4083613dbe
commit
dc6dbc05d8
11 files changed
+983
-349
No files matched your search
@@ -125,14 +125,17 @@ test('pay quick-edit fields map onto the real pay meta schema', () => {
|
||||
})
|
||||
|
||||
test('pay quick-edit save sanitizes through the shared sanitizer', () => {
|
||||
// 任何批量写入都必须过 sanitize_pay_meta,再回写派生键,与 metabox 保存一致。
|
||||
assert.match(list, /DomainModel::sanitize_pay_meta/)
|
||||
assert.match(list, /DomainModel::PAY_META_KEY, \$pay_meta/)
|
||||
assert.match(list, /DomainModel::PAY_TYPE_KEY/)
|
||||
assert.match(list, /DomainModel::PAY_PRICE_KEY/)
|
||||
assert.match(list, /'_aksrt_pay_modo'/)
|
||||
assert.match(list, /'_aksrt_pay_limit'/)
|
||||
assert.match(list, /RESOURCE_MARKER_KEY/)
|
||||
// 任何批量写入都必须走统一写入口 persist_pay_meta:先 sanitize_pay_meta,再回写派生键。
|
||||
assert.match(list, /DomainModel::persist_pay_meta\(\$post_id, \$pay_meta\)/)
|
||||
const persist = domain.slice(domain.indexOf('function persist_pay_meta('), domain.indexOf('function sanitize_downloads('))
|
||||
assert.match(persist, /self::sanitize_pay_meta\(\$meta\)/)
|
||||
assert.match(persist, /self::PAY_META_KEY, \$meta/)
|
||||
assert.match(persist, /self::PAY_TYPE_KEY/)
|
||||
assert.match(persist, /self::PAY_PRICE_KEY/)
|
||||
assert.match(persist, /self::RESOURCE_MARKER_KEY/)
|
||||
// _aksrt_pay_modo / _aksrt_pay_limit 没有任何读取方,已删除,不得再写。
|
||||
assert.doesNotMatch(list, /'_aksrt_pay_modo'|'_aksrt_pay_limit'/)
|
||||
assert.doesNotMatch(resourceBox, /'_aksrt_pay_modo'|'_aksrt_pay_limit'/)
|
||||
})
|
||||
|
||||
test('pay prices go through the ledger, not raw floats', () => {
|
||||
|
||||
Reference in new issue
Block a user