fix(settlement): 全部门店可未出账提现并企微提醒
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+8
-18
@@ -172,30 +172,12 @@ async function main() {
|
||||
const shopStoreId = shopMe.storeId || shopMe.stores?.[0]?.storeId;
|
||||
if (!shopStoreId) throw new Error('Shop storeId missing after login');
|
||||
|
||||
const noWhitelistMsg = await expectFail('SHOP_H5', '/shop/withdraw', {
|
||||
method: 'POST',
|
||||
token: shopToken,
|
||||
body: JSON.stringify({}),
|
||||
});
|
||||
if (!String(noWhitelistMsg).includes('白名单')) {
|
||||
throw new Error(`Expected FIN-001 whitelist reject, got: ${noWhitelistMsg}`);
|
||||
}
|
||||
|
||||
await req('HQ_WEB', `/admin/stores/${shopStoreId}`, {
|
||||
method: 'PUT',
|
||||
token: admin.accessToken,
|
||||
body: JSON.stringify({ withdrawWhitelistEnabled: true }),
|
||||
});
|
||||
|
||||
const withdrawSummary = await req('SHOP_H5', '/shop/withdraw/summary', {
|
||||
token: shopToken,
|
||||
});
|
||||
if (!(withdrawSummary.availableAmount > 0)) {
|
||||
throw new Error('Expected available withdraw amount after redeem');
|
||||
}
|
||||
if (!withdrawSummary.whitelistEnabled) {
|
||||
throw new Error('Expected withdraw whitelist enabled');
|
||||
}
|
||||
|
||||
const applied = await req('SHOP_H5', '/shop/withdraw', {
|
||||
method: 'POST',
|
||||
@@ -215,6 +197,14 @@ async function main() {
|
||||
throw new Error(`Expected pending-request reject, got: ${pendingDup}`);
|
||||
}
|
||||
|
||||
// 锁定中的明细不可再出账(T+1 排除 withdrawItem)
|
||||
const summaryAfter = await req('SHOP_H5', '/shop/withdraw/summary', {
|
||||
token: shopToken,
|
||||
});
|
||||
if (summaryAfter.availableAmount !== 0) {
|
||||
throw new Error('Expected availableAmount=0 while withdraw pending');
|
||||
}
|
||||
|
||||
await req('HQ_WEB', `/admin/store-withdrawals/${applied.id}/approve`, {
|
||||
method: 'POST',
|
||||
token: admin.accessToken,
|
||||
|
||||
Reference in New Issue
Block a user