accountOper 移除preSettle类型,调整type为settle时的checker
This commit is contained in:
parent
85298a5472
commit
64464d0b00
|
|
@ -103,22 +103,22 @@ const checkers: Checker<EntityDict, 'accountOper', RuntimeCxt>[] = [
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<Schema, '', '', {
|
|||
cutoffRefundable: '削减可自由退额度',
|
||||
refund: '退款',
|
||||
refundFailure: '退款失败',
|
||||
preSettle: '预分账',
|
||||
settle: '分账',
|
||||
},
|
||||
},
|
||||
|
|
@ -80,7 +79,6 @@ export const entityDesc: EntityDesc<Schema, '', '', {
|
|||
cutoffRefundable: '#2E4053',
|
||||
refund: '#CC3333',
|
||||
refundFailure: '#009933',
|
||||
preSettle: '#8A631D',
|
||||
settle: '#157d5a',
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue