fix(settlement): 全部门店可未出账提现并企微提醒

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-03 15:43:24 +08:00
parent f3353bbce5
commit 26472f8678
12 changed files with 60 additions and 87 deletions
-5
View File
@@ -247,7 +247,6 @@ describe('sumUnbilledPayoutAmount', () => {
describe('validateStoreWithdraw', () => {
const base = {
whitelistEnabled: true,
availableAmount: 1000,
requestAmount: 200,
todayApplied: 0,
@@ -256,10 +255,6 @@ describe('validateStoreWithdraw', () => {
hasBankAccount: true,
};
it('rejects non-whitelist stores', () => {
expect(validateStoreWithdraw({ ...base, whitelistEnabled: false }).ok).toBe(false);
});
it('rejects when daily limit exceeded', () => {
expect(
validateStoreWithdraw({ ...base, todayApplied: 4900, requestAmount: 200, dailyLimit: 5000 }).ok,
+1 -5
View File
@@ -101,7 +101,6 @@ export function sumUnbilledPayoutAmount(payouts: Array<{ payoutAmount: number }>
}
export type ValidateStoreWithdrawInput = {
whitelistEnabled: boolean;
availableAmount: number;
requestAmount: number;
todayApplied: number;
@@ -110,13 +109,10 @@ export type ValidateStoreWithdrawInput = {
hasBankAccount: boolean;
};
/** 门店未出账提现护栏(FIN-001/002 + 幂等/账户) */
/** 门店未出账提现护栏(FIN-002 单日上限 + 幂等/账户) */
export function validateStoreWithdraw(
input: ValidateStoreWithdrawInput,
): { ok: boolean; message?: string } {
if (!input.whitelistEnabled) {
return { ok: false, message: '该门店未开通未出账提现(需总部白名单)' };
}
if (!input.hasBankAccount) {
return { ok: false, message: '请先完善入驻收款账户后再提现' };
}