accountOper 移除preSettle类型,调整type为settle时的checker

This commit is contained in:
lxy 2025-07-17 15:07:24 +08:00
parent 85298a5472
commit 64464d0b00
2 changed files with 12 additions and 14 deletions

View File

@ -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必须为0refundable必须为空或者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必须为0refundable必须为空或者0');
// }
// break;
// }
case 'settle': {
//分账时账户total不变refundable不变
if (totalPlus !== 0 || (refundablePlus && refundablePlus !== 0)) {
throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时其totalPlus必须为0refundable必须为空或者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;
}
}

View File

@ -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',
}
}