accountOper checker修改,允许消费、提现、退款退还值为0

This commit is contained in:
lxy 2024-10-17 15:44:37 +08:00
parent 8635a95791
commit 0ed2b94d65
2 changed files with 6 additions and 6 deletions

View File

@ -57,15 +57,15 @@ const checkers = [
case 'refund':
case 'withdraw': {
if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) {
throw new types_1.OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的负数`);
throw new types_1.OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的负数`);
}
break;
}
case 'refundFailure':
case 'withdrawBack':
case 'consumeBack': {
if (totalPlus <= 0 || availPlus <= 0 || totalPlus !== availPlus) {
throw new types_1.OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为不相等的正`);
if (totalPlus < 0 || availPlus < 0 || totalPlus !== availPlus) {
throw new types_1.OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的非负数`);
}
break;
}

View File

@ -58,15 +58,15 @@ const checkers: Checker<EntityDict, 'accountOper', RuntimeCxt>[] = [
case 'refund':
case 'withdraw': {
if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) {
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的负数`);
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的负数`);
}
break;
}
case 'refundFailure':
case 'withdrawBack':
case 'consumeBack': {
if (totalPlus <= 0 || availPlus <= 0 || totalPlus !== availPlus) {
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为不相等的正`);
if (totalPlus < 0 || availPlus < 0 || totalPlus !== availPlus) {
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}其totalPlus和availPlus必须为相等的非负数`);
}
break;
}