diff --git a/src/checkers/accountOper.ts b/src/checkers/accountOper.ts index 869a6dfa..1eecbb3c 100644 --- a/src/checkers/accountOper.ts +++ b/src/checkers/accountOper.ts @@ -103,22 +103,22 @@ const checkers: Checker[] = [ } break; } - case 'preSettle': { - //预分账时账户total增加,avail不变,refundable不变 - if (totalPlus < 0 || availPlus !== 0 || (refundablePlus && refundablePlus !== 0)) { - throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为preSettle时,其totalPlus必须为非负数、availPlus必须为0,refundable必须为空或者0'); - } - break; - } + // case 'preSettle': { + // //预分账时账户total增加,avail不变,refundable不变 + // if (totalPlus < 0 || availPlus !== 0 || (refundablePlus && refundablePlus !== 0)) { + // throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为preSettle时,其totalPlus必须为非负数、availPlus必须为0,refundable必须为空或者0'); + // } + // break; + // } case 'settle': { - //分账时账户total不变,refundable不变 - if (totalPlus !== 0 || (refundablePlus && refundablePlus !== 0)) { - throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时,其totalPlus必须为0,refundable必须为空或者0'); + //分账时账户total增加,avail增加,refundable不变 + if (totalPlus < 0 || availPlus < 0 || (refundablePlus && refundablePlus !== 0)) { + throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时,其totalPlus、availPlus必须为非负数,refundable必须为空或者0'); } break; } default: { - assert(false); + // assert(false); break; } } diff --git a/src/entities/AccountOper.ts b/src/entities/AccountOper.ts index e10f5389..64f6f6a7 100644 --- a/src/entities/AccountOper.ts +++ b/src/entities/AccountOper.ts @@ -10,7 +10,7 @@ import { EntityDesc, ActionDef } from 'oak-domain/lib/types'; import { Schema as Account } from './Account'; type Type = 'deposit' | 'withdraw' | 'consume' | 'consumeBack' | 'loan' | 'repay' | 'withdrawBack' | 'earn' - | 'cutoffRefundable' | 'tax' | 'taxRefund' | 'refund' | 'refundFailure' | 'preSettle' | 'settle'; + | 'cutoffRefundable' | 'tax' | 'taxRefund' | 'refund' | 'refundFailure' | 'settle'; export interface Schema extends EntityShape { account: Account; @@ -58,7 +58,6 @@ export const entityDesc: EntityDesc