oak-pay-business/lib/configuration/attrUpdateMatrix.js

248 lines
6.2 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const NoSuccessfulWithdraw = {
withdrawTransfer$withdrawAccount: {
"#sqp": 'not in',
iState: 'successful',
},
};
const attrUpdateMatrix = {
pay: {
meta: {
actions: ['update', 'succeedPaying', 'close'],
filter: {
$or: [
{
entity: 'offlineAccount',
},
{
iState: {
$in: ['unpaid', 'paying'],
}
}
]
}
},
accountOper$entity: {
actions: ['startPaying', 'continuePaying'],
filter: {
$or: [{
depositId: {
$exists: true,
},
entity: 'account',
}, {
orderId: {
$exists: true,
},
entity: 'account',
}]
}
},
paid: {
actions: ['succeedPaying', 'continuePaying'],
},
refunded: {
actions: ['refundPartially', 'refundAll'],
},
refundable: {
actions: ['succeedPaying', 'closeRefund', 'stopRefunding', 'refundPartially'],
},
forbidRefundAt: {
actions: ['succeedPaying'],
},
successAt: {
actions: ['succeedPaying'],
},
entity: {
actions: ['update', 'succeedPaying'],
filter: {
iState: 'paying',
entity: 'offlineAccount',
}
},
entityId: {
actions: ['update', 'succeedPaying'],
filter: {
iState: 'paying',
entity: 'offlineAccount',
}
},
externalId: {
actions: ['startPaying', 'succeedPaying', 'update'],
filter: {
iState: {
$in: ['unpaid', 'paying'],
},
},
},
timeoutAt: {
actions: ['startPaying'],
filter: {
iState: {
$in: ['unpaid', 'paying'],
}
}
},
},
refund: {
externalId: {
actions: ['succeed', 'update'],
filter: {
iState: 'refunding',
},
},
reason: {
actions: ['fail'],
},
successAt: {
actions: ['succeed'],
},
externalMeta: {
actions: ['succeed', 'fail'],
},
},
withdraw: {
dealLoss: {
actions: ['succeed', 'fail', 'succeedPartially'],
},
dealPrice: {
actions: ['succeed', 'fail', 'succeedPartially'],
},
reason: {
actions: ['succeed', 'fail', 'succeedPartially'],
},
meta: {
actions: ['succeed', 'fail', 'succeedPartially'],
},
},
offlineAccount: {
name: {
actions: ['update'],
filter: {
// 只有从来没用过的才能改
sysAccountOper$entity: {
"#sqp": 'not in',
}
}
},
channel: {
actions: ['update'],
filter: {
// 只有从来没用过的才能改
sysAccountOper$entity: {
"#sqp": 'not in',
}
}
},
qrCode: {
actions: ['update'],
},
enabled: {
actions: ['update'],
},
taxLossRatio: {
actions: ['update'],
},
depositLossRatio: {
actions: ['update'],
},
refundCompensateRatio: {
actions: ['update'],
},
refundGapDays: {
actions: ['update'],
},
price: {
actions: ['pay', 'refund', 'deposit', 'withdrawTransfer', 'tax', 'moveOut', 'moveIn', 'compensate'],
},
allowDeposit: {
actions: ['update'],
filter: {
enabled: true,
},
},
allowPay: {
actions: ['update'],
filter: {
enabled: true,
},
},
allowWithdrawTransfer: {
actions: ['update'],
filter: {
enabled: true,
},
},
withdrawTransferLossRatio: {
actions: ['update'],
filter: {
enabled: true,
},
},
},
wpAccount: {
wechatPay: {
actions: ['update'],
},
taxLossRatio: {
actions: ['update'],
},
depositLossRatio: {
actions: ['update'],
},
refundCompensateRatio: {
actions: ['update'],
},
refundGapDays: {
actions: ['update'],
},
refundLossRatio: {
actions: ['update'],
},
refundLossFloor: {
actions: ['update'],
},
publicKeyFilePath: {
actions: ['update'],
},
privateKeyFilePath: {
actions: ['update'],
},
apiV3Key: {
actions: ['update'],
},
enabled: {
actions: ['update'],
},
price: {
actions: ['pay', 'refund', 'deposit', 'withdrawTransfer', 'tax', 'moveOut', 'moveIn', 'compensate'],
}
},
withdrawAccount: {
isDefault: {
actions: ['update'],
},
org: {
actions: ['update'],
filter: NoSuccessfulWithdraw,
},
name: {
actions: ['update'],
filter: NoSuccessfulWithdraw,
},
code: {
actions: ['update'],
filter: NoSuccessfulWithdraw,
},
data: {
actions: ['update'],
filter: NoSuccessfulWithdraw,
},
enabled: {
actions: ['disable'],
}
}
};
exports.default = attrUpdateMatrix;