oak-pay-business 2.6.3-alpha → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/aspects/withdraw.js +2 -2
- package/es/checkers/accountOper.js +23 -6
- package/es/checkers/offlineAccount.js +4 -4
- package/es/checkers/order.js +19 -12
- package/es/checkers/pay.js +1 -1
- package/es/checkers/wpProduct.js +4 -4
- package/es/components/AbstractComponents.d.ts +62 -11
- package/es/components/accountOper/pure/List.pc.d.ts +1 -0
- package/es/components/offlineAccount/upsert/index.d.ts +1 -0
- package/es/components/order/list/index.d.ts +1 -0
- package/es/components/order/pay/index.d.ts +1 -1
- package/es/components/order/pay/info.d.ts +1 -0
- package/es/components/pay/channelPicker2/web.d.ts +1 -0
- package/es/components/pay/channelPicker2/web.pc.d.ts +1 -0
- package/es/components/pay/detail/index.d.ts +1 -1
- package/es/components/pay/list/index.d.ts +1 -0
- package/es/components/payConfig/system/index.d.ts +1 -0
- package/es/components/refund/list/index.d.ts +1 -0
- package/es/components/sysAccount/transferList/index.d.ts +1 -0
- package/es/components/wechatPay/upsert/index.d.ts +2 -1
- package/es/components/withdraw/create/index.d.ts +1 -9
- package/es/components/withdraw/create/index.js +1 -0
- package/es/components/withdraw/create/web.d.ts +1 -1
- package/es/components/withdraw/create/web.pc.d.ts +1 -1
- package/es/components/withdraw/detail/index.d.ts +1 -0
- package/es/components/withdraw/display/index.d.ts +1 -5
- package/es/components/withdraw/display/web.d.ts +1 -0
- package/es/components/withdraw/display/web.pc.d.ts +1 -0
- package/es/components/withdrawTransfer/list/index.d.ts +1 -0
- package/es/configuration/attrUpdateMatrix.js +12 -12
- package/es/context/BackendRuntimeContext.d.ts +1 -1
- package/es/data/i18n.js +4 -0
- package/es/entities/AccountOper.d.ts +1 -1
- package/es/entities/AccountOper.js +4 -2
- package/es/entities/Settlement.d.ts +18 -0
- package/es/entities/Settlement.js +44 -0
- package/es/entities/System.js +1 -0
- package/es/locales/error/zh-CN.json +4 -0
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/Style.js +2 -1
- package/es/oak-app-domain/AccountOper/_baseSchema.d.ts +1 -1
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +3 -2
- package/es/oak-app-domain/ActionDefDict.d.ts +3 -0
- package/es/oak-app-domain/ActionDefDict.js +2 -0
- package/es/oak-app-domain/Application/Storage.js +15 -0
- package/es/oak-app-domain/Application/_baseSchema.d.ts +14 -0
- package/es/oak-app-domain/Application/locales/zh_CN.json +4 -1
- package/es/oak-app-domain/EntityDict.d.ts +67 -0
- package/es/oak-app-domain/Platform/Storage.js +6 -0
- package/es/oak-app-domain/Platform/_baseSchema.d.ts +4 -0
- package/es/oak-app-domain/Platform/locales/zh_CN.json +2 -1
- package/es/oak-app-domain/Settlement/Action.d.ts +11 -0
- package/es/oak-app-domain/Settlement/Action.js +10 -0
- package/es/oak-app-domain/Settlement/Schema.d.ts +19 -0
- package/es/oak-app-domain/Settlement/Schema.js +1 -0
- package/es/oak-app-domain/Settlement/Storage.d.ts +3 -0
- package/es/oak-app-domain/Settlement/Storage.js +25 -0
- package/es/oak-app-domain/Settlement/Style.d.ts +3 -0
- package/es/oak-app-domain/Settlement/Style.js +13 -0
- package/es/oak-app-domain/Settlement/_baseSchema.d.ts +47 -0
- package/es/oak-app-domain/Settlement/locales/zh_CN.json +20 -0
- package/es/oak-app-domain/Storage.js +2 -0
- package/es/oak-app-domain/StyleDict.js +2 -0
- package/es/oak-app-domain/System/Storage.js +10 -5
- package/es/oak-app-domain/System/_baseSchema.d.ts +4 -0
- package/es/oak-app-domain/System/locales/zh_CN.json +2 -1
- package/es/triggers/index.js +2 -0
- package/es/triggers/order.d.ts +5 -1
- package/es/triggers/order.js +142 -2
- package/es/triggers/refund.js +106 -23
- package/es/types/Exception.d.ts +4 -3
- package/es/types/Exception.js +5 -5
- package/es/utils/application.d.ts +1 -1
- package/es/utils/pay.d.ts +1 -0
- package/es/utils/payClazz/WechatPay/index.d.ts +1 -1
- package/lib/aspects/withdraw.js +4 -3
- package/lib/checkers/abstractChecker.js +2 -2
- package/lib/checkers/accountOper.js +23 -6
- package/lib/checkers/offlineAccount.js +4 -4
- package/lib/checkers/order.js +19 -12
- package/lib/checkers/pay.js +1 -1
- package/lib/checkers/wpProduct.js +4 -4
- package/lib/configuration/attrUpdateMatrix.js +12 -12
- package/lib/context/BackendRuntimeContext.d.ts +1 -1
- package/lib/data/i18n.js +4 -0
- package/lib/entities/AccountOper.d.ts +1 -1
- package/lib/entities/AccountOper.js +4 -2
- package/lib/entities/Settlement.d.ts +18 -0
- package/lib/entities/Settlement.js +47 -0
- package/lib/entities/System.js +1 -0
- package/lib/features/index.js +3 -2
- package/lib/hooks/useFeatures.js +1 -1
- package/lib/locales/error/zh-CN.json +4 -0
- package/lib/oak-app-domain/AccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/AccountOper/Style.js +2 -1
- package/lib/oak-app-domain/AccountOper/_baseSchema.d.ts +1 -1
- package/lib/oak-app-domain/AccountOper/locales/zh_CN.json +3 -2
- package/lib/oak-app-domain/ActionDefDict.d.ts +3 -0
- package/lib/oak-app-domain/ActionDefDict.js +14 -12
- package/lib/oak-app-domain/Application/Storage.js +15 -0
- package/lib/oak-app-domain/Application/_baseSchema.d.ts +14 -0
- package/lib/oak-app-domain/Application/locales/zh_CN.json +4 -1
- package/lib/oak-app-domain/EntityDict.d.ts +67 -0
- package/lib/oak-app-domain/Platform/Storage.js +6 -0
- package/lib/oak-app-domain/Platform/_baseSchema.d.ts +4 -0
- package/lib/oak-app-domain/Platform/locales/zh_CN.json +2 -1
- package/lib/oak-app-domain/Settlement/Action.d.ts +11 -0
- package/lib/oak-app-domain/Settlement/Action.js +13 -0
- package/lib/oak-app-domain/Settlement/Schema.d.ts +19 -0
- package/lib/oak-app-domain/Settlement/Schema.js +4 -0
- package/lib/oak-app-domain/Settlement/Storage.d.ts +3 -0
- package/lib/oak-app-domain/Settlement/Storage.js +28 -0
- package/lib/oak-app-domain/Settlement/Style.d.ts +3 -0
- package/lib/oak-app-domain/Settlement/Style.js +16 -0
- package/lib/oak-app-domain/Settlement/_baseSchema.d.ts +47 -0
- package/lib/oak-app-domain/Settlement/locales/zh_CN.json +20 -0
- package/lib/oak-app-domain/Storage.js +20 -18
- package/lib/oak-app-domain/StyleDict.js +18 -16
- package/lib/oak-app-domain/System/Storage.js +10 -5
- package/lib/oak-app-domain/System/_baseSchema.d.ts +4 -0
- package/lib/oak-app-domain/System/locales/zh_CN.json +2 -1
- package/lib/registry.js +2 -2
- package/lib/triggers/index.js +2 -0
- package/lib/triggers/order.d.ts +5 -1
- package/lib/triggers/order.js +143 -1
- package/lib/triggers/refund.js +106 -23
- package/lib/triggers/withdraw.d.ts +1 -1
- package/lib/triggers/withdraw.js +2 -1
- package/lib/types/DependentExceptions.js +1 -1
- package/lib/types/Exception.d.ts +4 -3
- package/lib/types/Exception.js +7 -7
- package/lib/utils/application.d.ts +1 -1
- package/lib/utils/application.js +2 -2
- package/lib/utils/pay.d.ts +1 -0
- package/lib/utils/pay.js +4 -4
- package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +2 -1
- package/lib/utils/payClazz/index.js +4 -3
- package/lib/utils/wpProduct.js +2 -1
- package/lib/utils/wpProductFrontend.js +3 -2
- package/package.json +4 -4
- package/src/entities/AccountOper.ts +6 -4
- package/src/entities/Settlement.ts +70 -0
- package/src/entities/System.ts +1 -0
- package/es/oak-app-domain/_SubQuery.d.ts +0 -760
- package/lib/oak-app-domain/_SubQuery.d.ts +0 -760
- /package/es/oak-app-domain/{_SubQuery.js → Settlement/_baseSchema.js} +0 -0
- /package/lib/oak-app-domain/{_SubQuery.js → Settlement/_baseSchema.js} +0 -0
package/es/aspects/withdraw.js
CHANGED
|
@@ -28,7 +28,7 @@ export async function getWithdrawCreateData(params, context) {
|
|
|
28
28
|
const { system } = context.getApplication();
|
|
29
29
|
const withdrawLoss = system?.payConfig?.withdrawLoss;
|
|
30
30
|
if (!withdrawLoss || (!withdrawLoss.conservative && typeof withdrawLoss.ratio !== 'number')) {
|
|
31
|
-
throw new OakException('error::system.withdrawLossUnSet');
|
|
31
|
+
throw new OakException('error::system.withdrawLossUnSet', 'oak-pay-business');
|
|
32
32
|
}
|
|
33
33
|
const { accountId, price: totalPrice, withdrawAccountId } = params;
|
|
34
34
|
const [account] = await context.select('account', {
|
|
@@ -46,7 +46,7 @@ export async function getWithdrawCreateData(params, context) {
|
|
|
46
46
|
// throw new OakInputIllegalException('withdraw', ['price'], 'error::withdraw.overflow');
|
|
47
47
|
// }
|
|
48
48
|
if (totalPrice > refundable && !withdrawAccountId) {
|
|
49
|
-
throw new OakInputIllegalException('withdraw', ['price'], 'error::withdraw.needWithdrawAccountId');
|
|
49
|
+
throw new OakInputIllegalException('withdraw', ['price'], 'error::withdraw.needWithdrawAccountId', 'oak-pay-business');
|
|
50
50
|
}
|
|
51
51
|
const data = {
|
|
52
52
|
id: await generateNewIdAsync(),
|
|
@@ -52,6 +52,11 @@ const checkers = [
|
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
54
|
case 'refund':
|
|
55
|
+
//当订单未完成分账时,仅减少total,此时totalPlus与availPlus不相等
|
|
56
|
+
if (totalPlus > 0 || availPlus > 0) {
|
|
57
|
+
throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus'], `accountOper为${type}时,其totalPlus必须为非正数`);
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
55
60
|
case 'withdraw': {
|
|
56
61
|
if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) {
|
|
57
62
|
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}时,其totalPlus和availPlus必须为相等的负数`);
|
|
@@ -59,6 +64,10 @@ const checkers = [
|
|
|
59
64
|
break;
|
|
60
65
|
}
|
|
61
66
|
case 'refundFailure':
|
|
67
|
+
if (totalPlus < 0 || availPlus < 0) {
|
|
68
|
+
throw new OakInputIllegalException('accountOper', ['availPlus'], `accountOper为${type}时,其totalPlus和availPlus必须为非负数`);
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
62
71
|
case 'withdrawBack':
|
|
63
72
|
case 'consumeBack': {
|
|
64
73
|
if (totalPlus < 0 || availPlus < 0 || totalPlus !== availPlus) {
|
|
@@ -72,12 +81,6 @@ const checkers = [
|
|
|
72
81
|
}
|
|
73
82
|
break;
|
|
74
83
|
}
|
|
75
|
-
case 'encash': {
|
|
76
|
-
if (totalPlus !== 0 || availPlus <= 0) {
|
|
77
|
-
throw new OakInputIllegalException('accountOper', ['availPlus'], 'accountOper为encash时,其totalPlus必须为0、availPlus必须为正数');
|
|
78
|
-
}
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
84
|
case 'cutoffRefundable': {
|
|
82
85
|
if (totalPlus !== 0 || availPlus !== 0 || typeof refundablePlus !== 'number' || refundablePlus >= 0) {
|
|
83
86
|
throw new OakInputIllegalException('accountOper', ['refundablePlus'], 'accountOper为cutoffRefundable时,其totalPlus/availPlus必须为0,且refundablePlus必须为负数');
|
|
@@ -96,6 +99,20 @@ const checkers = [
|
|
|
96
99
|
}
|
|
97
100
|
break;
|
|
98
101
|
}
|
|
102
|
+
case 'preSettle': {
|
|
103
|
+
//预分账时账户total增加,avail不变,refundable不变
|
|
104
|
+
if (totalPlus < 0 || availPlus !== 0 || (refundablePlus && refundablePlus !== 0)) {
|
|
105
|
+
throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus', 'refundablePlus'], 'accountOper为preSettle时,其totalPlus必须为非负数、availPlus必须为0,refundable必须为空或者0');
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case 'settle': {
|
|
110
|
+
//分账时账户total不变,refundable不变
|
|
111
|
+
if (totalPlus !== 0 || (refundablePlus && refundablePlus !== 0)) {
|
|
112
|
+
throw new OakInputIllegalException('accountOper', ['totalPlus', 'refundablePlus'], 'accountOper为settle时,其totalPlus必须为0,refundable必须为空或者0');
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
99
116
|
default: {
|
|
100
117
|
assert(false);
|
|
101
118
|
break;
|
|
@@ -14,7 +14,7 @@ function checkAttributes(data) {
|
|
|
14
14
|
case 'wechat':
|
|
15
15
|
case 'alipay': {
|
|
16
16
|
if (!name && !qrCode) {
|
|
17
|
-
throw new OakInputIllegalException('offlineAccount', ['name', 'qrCode'], 'offlineAccount::error.nameQrCodeBothNull');
|
|
17
|
+
throw new OakInputIllegalException('offlineAccount', ['name', 'qrCode'], 'offlineAccount::error.nameQrCodeBothNull', 'oak-pay-business');
|
|
18
18
|
}
|
|
19
19
|
break;
|
|
20
20
|
}
|
|
@@ -29,13 +29,13 @@ function checkAttributes(data) {
|
|
|
29
29
|
}
|
|
30
30
|
const { refundCompensateRatio, refundGapDays, withdrawTransferLossRatio } = data;
|
|
31
31
|
if (typeof refundGapDays !== 'number' || refundGapDays < 0) {
|
|
32
|
-
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundGapDaysNotNegative');
|
|
32
|
+
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundGapDaysNotNegative', 'oak-pay-business');
|
|
33
33
|
}
|
|
34
34
|
if (typeof refundCompensateRatio !== 'number' || refundCompensateRatio < 0 || refundCompensateRatio > 100) {
|
|
35
|
-
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundCompensateIllegal');
|
|
35
|
+
throw new OakInputIllegalException('offlineAccount', ['refundGapDays'], 'offlineAccount::error.refundCompensateIllegal', 'oak-pay-business');
|
|
36
36
|
}
|
|
37
37
|
if (typeof withdrawTransferLossRatio !== 'number' || withdrawTransferLossRatio < 0) {
|
|
38
|
-
throw new OakInputIllegalException('offlineAccount', ['withdrawTransferLossRatio'], 'offlineAccount::error.withdrawTransferLossRatioNotNegative');
|
|
38
|
+
throw new OakInputIllegalException('offlineAccount', ['withdrawTransferLossRatio'], 'offlineAccount::error.withdrawTransferLossRatioNotNegative', 'oak-pay-business');
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
const checkers = [
|
package/es/checkers/order.js
CHANGED
|
@@ -45,7 +45,7 @@ const checkers = [
|
|
|
45
45
|
assert(['unpaid', 'partiallyRefunded'].includes(iState) && paid === 0);
|
|
46
46
|
const { pay$order: pays } = data;
|
|
47
47
|
if (!(pays instanceof Array) || !pays.length) {
|
|
48
|
-
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.nonePay');
|
|
48
|
+
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.nonePay', 'oak-pay-business');
|
|
49
49
|
}
|
|
50
50
|
let amount = 0;
|
|
51
51
|
pays.forEach(({ action, data }) => {
|
|
@@ -54,13 +54,13 @@ const checkers = [
|
|
|
54
54
|
amount += price;
|
|
55
55
|
});
|
|
56
56
|
if (!allowPartialPay && amount !== price) {
|
|
57
|
-
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.payAmountNotEnough');
|
|
57
|
+
throw new OakInputIllegalException('order', ['pay$order'], 'error::order.payAmountNotEnough', 'oak-pay-business');
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
|
-
//
|
|
63
|
+
// 订单结算,检查存在关联的未结算的settlement,其price之和等于订单的已支付与已退款的差值
|
|
64
64
|
type: 'logicalData',
|
|
65
65
|
entity: 'order',
|
|
66
66
|
action: 'settle',
|
|
@@ -75,23 +75,30 @@ const checkers = [
|
|
|
75
75
|
paid: 1,
|
|
76
76
|
refunded: 1,
|
|
77
77
|
iState: 1,
|
|
78
|
+
settlement$order: {
|
|
79
|
+
$entity: 'settlement',
|
|
80
|
+
data: {
|
|
81
|
+
id: 1,
|
|
82
|
+
accountId: 1,
|
|
83
|
+
price: 1,
|
|
84
|
+
iState: 1,
|
|
85
|
+
},
|
|
86
|
+
filter: {
|
|
87
|
+
iState: 'unsettled'
|
|
88
|
+
}
|
|
89
|
+
}
|
|
78
90
|
},
|
|
79
91
|
filter: {
|
|
80
92
|
id: filter.id,
|
|
81
93
|
},
|
|
82
94
|
}, {}), (orders) => {
|
|
83
95
|
const [order] = orders;
|
|
84
|
-
const { price, paid, refunded, iState } = order;
|
|
96
|
+
const { price, paid, refunded, iState, settlement$order: settlements } = order;
|
|
85
97
|
assert(['paid', 'partiallyRefunded'].includes(iState));
|
|
86
|
-
|
|
87
|
-
assert(opers instanceof Array);
|
|
98
|
+
assert(settlements && settlements.length > 0, '该结算订单需添加结算明细');
|
|
88
99
|
let amount = 0;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const { type, totalPlus, availPlus, refundablePlus } = data;
|
|
92
|
-
assert(type === 'earn');
|
|
93
|
-
// assert(totalPlus === availPlus);
|
|
94
|
-
amount += totalPlus;
|
|
100
|
+
settlements.forEach((settlement) => {
|
|
101
|
+
amount += settlement.price;
|
|
95
102
|
});
|
|
96
103
|
assert(amount === paid - refunded);
|
|
97
104
|
});
|
package/es/checkers/pay.js
CHANGED
|
@@ -74,7 +74,7 @@ const checkers = [
|
|
|
74
74
|
let pricePaying = 0;
|
|
75
75
|
pays.forEach((pay) => pricePaying += pay.price);
|
|
76
76
|
if (pricePaying + price > orderPrice) {
|
|
77
|
-
throw new OakInputIllegalException('pay', ['price'], 'pay.
|
|
77
|
+
throw new OakInputIllegalException('pay', ['price'], 'error::pay.priceOverflow', 'oak-pay-business');
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
if (order instanceof Promise) {
|
package/es/checkers/wpProduct.js
CHANGED
|
@@ -79,27 +79,27 @@ const checkers = [
|
|
|
79
79
|
}, { dontCollect: true }), (applications) => {
|
|
80
80
|
const { type, config } = applications[0];
|
|
81
81
|
if (!getAppTypeFromProductType(data.type).includes(type)) {
|
|
82
|
-
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.TypeConflict');
|
|
82
|
+
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.TypeConflict', 'oak-pay-business');
|
|
83
83
|
}
|
|
84
84
|
switch (type) {
|
|
85
85
|
case 'web': {
|
|
86
86
|
const { wechat } = config;
|
|
87
87
|
if (!wechat?.appId) {
|
|
88
|
-
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp');
|
|
88
|
+
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp', 'oak-pay-business');
|
|
89
89
|
}
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
case 'wechatMp': {
|
|
93
93
|
const { appId } = config;
|
|
94
94
|
if (!appId) {
|
|
95
|
-
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp');
|
|
95
|
+
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp', 'oak-pay-business');
|
|
96
96
|
}
|
|
97
97
|
break;
|
|
98
98
|
}
|
|
99
99
|
case 'wechatPublic': {
|
|
100
100
|
const { appId } = config;
|
|
101
101
|
if (!appId) {
|
|
102
|
-
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp');
|
|
102
|
+
throw new OakInputIllegalException('wpProduct', ['applicationId'], 'error::wpProduct.NoWechatInfoOnApp', 'oak-pay-business');
|
|
103
103
|
}
|
|
104
104
|
break;
|
|
105
105
|
}
|
|
@@ -4,15 +4,66 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { EntityDict } from '../oak-app-domain';
|
|
7
|
-
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef } from 'oak-frontend-base';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, ListButtonProps, OakAbsAttrUpsertDef } from 'oak-frontend-base';
|
|
8
|
+
declare const FilterPanel: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
9
|
+
entity: T;
|
|
10
|
+
columns: ColumnProps<EntityDict, T>[];
|
|
11
|
+
}>) => React.ReactElement;
|
|
12
|
+
declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
13
|
+
entity: T;
|
|
14
|
+
extraActions: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]);
|
|
15
|
+
onAction: onActionFnDef;
|
|
16
|
+
disabledOp: boolean;
|
|
17
|
+
attributes: OakAbsAttrDef[];
|
|
18
|
+
data: RowWithActions<EntityDict, T>[];
|
|
19
|
+
loading: boolean;
|
|
20
|
+
tablePagination?: React.ReactNode;
|
|
21
|
+
rowSelection?: any;
|
|
22
|
+
hideHeader?: boolean | undefined;
|
|
23
|
+
disableSerialNumber?: boolean | undefined;
|
|
24
|
+
size?: "small" | "middle" | "large" | undefined;
|
|
25
|
+
scroll?: any;
|
|
26
|
+
empty?: React.ReactNode;
|
|
27
|
+
opWidth?: number | undefined;
|
|
28
|
+
ellipsis?: boolean | undefined;
|
|
29
|
+
}>) => React.ReactElement;
|
|
30
|
+
declare const ListPro: <T extends keyof EntityDict>(props: {
|
|
31
|
+
title?: any;
|
|
32
|
+
extraContent?: any;
|
|
33
|
+
hideDefaultButtons?: boolean | undefined;
|
|
34
|
+
buttonGroup?: ListButtonProps[] | undefined;
|
|
35
|
+
onReload?: (() => void) | undefined;
|
|
36
|
+
entity: T;
|
|
37
|
+
extraActions?: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]) | undefined;
|
|
38
|
+
onAction?: onActionFnDef | undefined;
|
|
39
|
+
disabledOp?: boolean | undefined;
|
|
40
|
+
attributes: OakAbsAttrDef[];
|
|
41
|
+
data: RowWithActions<EntityDict, T>[];
|
|
42
|
+
loading?: boolean | undefined;
|
|
43
|
+
tablePagination?: any;
|
|
44
|
+
rowSelection?: any;
|
|
45
|
+
disableSerialNumber?: boolean | undefined;
|
|
46
|
+
size?: "small" | "middle" | "large" | undefined;
|
|
47
|
+
scroll?: any;
|
|
48
|
+
empty?: any;
|
|
49
|
+
opWidth?: number | undefined;
|
|
50
|
+
oakPath?: string | undefined;
|
|
51
|
+
}) => React.ReactElement;
|
|
52
|
+
declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
53
|
+
column?: number | Record<Breakpoint, number> | undefined;
|
|
54
|
+
entity: T;
|
|
55
|
+
attributes: OakAbsAttrDef[];
|
|
56
|
+
data: Partial<EntityDict[T]["Schema"]>;
|
|
57
|
+
title?: string | undefined;
|
|
58
|
+
bordered?: boolean | undefined;
|
|
59
|
+
layout?: "horizontal" | "vertical" | undefined;
|
|
60
|
+
}>) => React.ReactElement;
|
|
61
|
+
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
62
|
+
helps: Record<string, string>;
|
|
63
|
+
entity: T;
|
|
64
|
+
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
|
|
65
|
+
data: EntityDict[T]["Schema"];
|
|
66
|
+
layout: "horizontal" | "vertical";
|
|
67
|
+
mode: "default" | "card";
|
|
68
|
+
}>) => React.ReactElement;
|
|
18
69
|
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "offlineAccount", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "order", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -2,6 +2,6 @@ import { EntityDict } from "../../../oak-app-domain";
|
|
|
2
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "order", false, {
|
|
3
3
|
accountId: string;
|
|
4
4
|
accountAvailMax: number;
|
|
5
|
-
onSetPays: (pays: Partial<EntityDict[
|
|
5
|
+
onSetPays: (pays: Partial<EntityDict['pay']['CreateOperationData']>[]) => void;
|
|
6
6
|
}>) => React.ReactElement;
|
|
7
7
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EntityDict } from "../../../oak-app-domain";
|
|
2
2
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
|
3
3
|
import { StartPayRoutine, JudgeCanPay } from "../../../types/Pay";
|
|
4
|
-
export declare function registerFrontendPayRoutine<ED extends EntityDict & BaseEntityDict>(entity: keyof ED, routine: StartPayRoutine, projection: ED['pay']['
|
|
4
|
+
export declare function registerFrontendPayRoutine<ED extends EntityDict & BaseEntityDict>(entity: keyof ED, routine: StartPayRoutine, projection: ED['pay']['Projection'], judgeCanPay: JudgeCanPay): void;
|
|
5
5
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "pay", false, {
|
|
6
6
|
onClose: () => void;
|
|
7
7
|
onPaid: () => void;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "pay", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "refund", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
2
3
|
export default _default;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { EntityDict } from '../../../oak-app-domain';
|
|
2
|
+
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "wechatPay", false, {
|
|
2
3
|
systemId: string;
|
|
3
4
|
}>) => React.ReactElement;
|
|
4
5
|
export default _default;
|
|
@@ -1,10 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
|
3
|
-
accountId: string;
|
|
4
|
-
withdrawAccountFilter: EntityDict["withdrawAccount"]["Selection"]["filter"];
|
|
5
|
-
onNewWithdrawAccount: () => void;
|
|
6
|
-
onCreateWithdraw: (id: string) => void;
|
|
7
|
-
onGoToHistory: () => void;
|
|
8
|
-
onGoToWaManage: () => void;
|
|
9
|
-
}>) => React.ReactElement;
|
|
1
|
+
declare const _default: any;
|
|
10
2
|
export default _default;
|
|
@@ -3,6 +3,7 @@ import assert from "assert";
|
|
|
3
3
|
import { RefundExceedMax } from "../../../types/Exception";
|
|
4
4
|
import { generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
|
5
5
|
import { combineFilters } from 'oak-domain/lib/store/filter';
|
|
6
|
+
// @ts-nocheck
|
|
6
7
|
export default OakComponent({
|
|
7
8
|
properties: {
|
|
8
9
|
accountId: '',
|
|
@@ -18,7 +18,7 @@ export default function render(props: WebComponentProps<EntityDict, 'withdraw',
|
|
|
18
18
|
withdrawable?: boolean;
|
|
19
19
|
withdrawLossText?: string;
|
|
20
20
|
chooseWa?: boolean;
|
|
21
|
-
waFilter?: EntityDict['withdrawAccount']['
|
|
21
|
+
waFilter?: EntityDict['withdrawAccount']['Filter'];
|
|
22
22
|
userId: string;
|
|
23
23
|
onGoToHistory: () => void;
|
|
24
24
|
onGoToWaManage: () => void;
|
|
@@ -18,7 +18,7 @@ export default function render(props: WebComponentProps<EntityDict, 'withdraw',
|
|
|
18
18
|
withdrawable?: boolean;
|
|
19
19
|
withdrawLossText?: string;
|
|
20
20
|
chooseWa?: boolean;
|
|
21
|
-
waFilter?: EntityDict['withdrawAccount']['
|
|
21
|
+
waFilter?: EntityDict['withdrawAccount']['Filter'];
|
|
22
22
|
userId: string;
|
|
23
23
|
onGoToHistory: () => void;
|
|
24
24
|
onGoToWaManage: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
import { EntityDict } from "../../../oak-app-domain";
|
|
2
3
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdraw", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
4
|
export default _default;
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
|
3
|
-
withdraw: EntityDict["withdraw"]["Schema"];
|
|
4
|
-
create: boolean;
|
|
5
|
-
}>) => React.ReactElement;
|
|
1
|
+
declare const _default: any;
|
|
6
2
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="wechat-miniprogram" />
|
|
1
2
|
import { EntityDict } from '../../../oak-app-domain';
|
|
2
3
|
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
|
3
4
|
export default _default;
|
|
@@ -142,9 +142,9 @@ const attrUpdateMatrix = {
|
|
|
142
142
|
taxLossRatio: {
|
|
143
143
|
actions: ['update'],
|
|
144
144
|
},
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
/* depositLossRatio: {
|
|
146
|
+
actions: ['update'],
|
|
147
|
+
}, */
|
|
148
148
|
refundCompensateRatio: {
|
|
149
149
|
actions: ['update'],
|
|
150
150
|
},
|
|
@@ -186,21 +186,21 @@ const attrUpdateMatrix = {
|
|
|
186
186
|
taxLossRatio: {
|
|
187
187
|
actions: ['update'],
|
|
188
188
|
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
189
|
+
/* depositLossRatio: {
|
|
190
|
+
actions: ['update'],
|
|
191
|
+
}, */
|
|
192
192
|
refundCompensateRatio: {
|
|
193
193
|
actions: ['update'],
|
|
194
194
|
},
|
|
195
195
|
refundGapDays: {
|
|
196
196
|
actions: ['update'],
|
|
197
197
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
198
|
+
/* refundLossRatio: {
|
|
199
|
+
actions: ['update'],
|
|
200
|
+
},
|
|
201
|
+
refundLossFloor: {
|
|
202
|
+
actions: ['update'],
|
|
203
|
+
},*/
|
|
204
204
|
publicKeyFilePath: {
|
|
205
205
|
actions: ['update'],
|
|
206
206
|
},
|
|
@@ -3,7 +3,7 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
|
|
3
3
|
import { RuntimeContext } from './RuntimeContext';
|
|
4
4
|
import { BackendRuntimeContext as DependentBackendRuntimeContext } from 'oak-general-business/lib/context/BackendRuntimeContext';
|
|
5
5
|
export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends DependentBackendRuntimeContext<ED> implements RuntimeContext {
|
|
6
|
-
protected applicationProjection:
|
|
6
|
+
protected applicationProjection: EntityDict['application']['Projection'];
|
|
7
7
|
toString(): Promise<string>;
|
|
8
8
|
refineOpRecords(): Promise<void>;
|
|
9
9
|
}
|
package/es/data/i18n.js
CHANGED
|
@@ -2,7 +2,7 @@ import { String, Price } from 'oak-domain/lib/types/DataType';
|
|
|
2
2
|
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
3
|
import { EntityDesc } from 'oak-domain/lib/types';
|
|
4
4
|
import { Schema as Account } from './Account';
|
|
5
|
-
type Type = 'deposit' | 'withdraw' | 'consume' | 'consumeBack' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | '
|
|
5
|
+
type Type = 'deposit' | 'withdraw' | 'consume' | 'consumeBack' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | 'cutoffRefundable' | 'tax' | 'taxRefund' | 'refund' | 'refundFailure' | 'preSettle' | 'settle';
|
|
6
6
|
export interface Schema extends EntityShape {
|
|
7
7
|
account: Account;
|
|
8
8
|
type: Type;
|
|
@@ -25,12 +25,13 @@ export const entityDesc = {
|
|
|
25
25
|
repay: '偿还',
|
|
26
26
|
withdrawBack: '提现退还',
|
|
27
27
|
earn: '赚取',
|
|
28
|
-
encash: '兑现',
|
|
29
28
|
tax: '渠道费',
|
|
30
29
|
taxRefund: '渠道费用退还',
|
|
31
30
|
cutoffRefundable: '削减可自由退额度',
|
|
32
31
|
refund: '退款',
|
|
33
32
|
refundFailure: '退款失败',
|
|
33
|
+
preSettle: '预分账',
|
|
34
|
+
settle: '分账',
|
|
34
35
|
},
|
|
35
36
|
},
|
|
36
37
|
},
|
|
@@ -46,12 +47,13 @@ export const entityDesc = {
|
|
|
46
47
|
loan: '#CD6155',
|
|
47
48
|
repay: '#82E0AA',
|
|
48
49
|
earn: '#FF3333',
|
|
49
|
-
encash: '#FF3399',
|
|
50
50
|
tax: '#A569BD',
|
|
51
51
|
taxRefund: '#FF3333',
|
|
52
52
|
cutoffRefundable: '#2E4053',
|
|
53
53
|
refund: '#CC3333',
|
|
54
54
|
refundFailure: '#009933',
|
|
55
|
+
preSettle: '#8A631D',
|
|
56
|
+
settle: '#157d5a',
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
59
|
},
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Price } from 'oak-domain/lib/types/DataType';
|
|
2
|
+
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
|
+
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
|
4
|
+
import { Schema as Account } from './Account';
|
|
5
|
+
import { Schema as Order } from './Order';
|
|
6
|
+
export interface Schema extends EntityShape {
|
|
7
|
+
account: Account;
|
|
8
|
+
price: Price;
|
|
9
|
+
order: Order;
|
|
10
|
+
}
|
|
11
|
+
type IState = 'unsettled' | 'settled';
|
|
12
|
+
type IAction = 'settle';
|
|
13
|
+
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
14
|
+
type Action = IAction | 'refund' | 'refundFailure';
|
|
15
|
+
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
16
|
+
iState: IState;
|
|
17
|
+
}>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
;
|
|
2
|
+
export const IActionDef = {
|
|
3
|
+
stm: {
|
|
4
|
+
settle: ['unsettled', 'settled'],
|
|
5
|
+
},
|
|
6
|
+
is: 'unsettled',
|
|
7
|
+
};
|
|
8
|
+
export const entityDesc = {
|
|
9
|
+
locales: {
|
|
10
|
+
zh_CN: {
|
|
11
|
+
name: '结算明细',
|
|
12
|
+
attr: {
|
|
13
|
+
account: '帐号',
|
|
14
|
+
price: '变化金额',
|
|
15
|
+
order: '订单',
|
|
16
|
+
iState: '结算状态',
|
|
17
|
+
},
|
|
18
|
+
action: {
|
|
19
|
+
settle: '结算',
|
|
20
|
+
refund: '退款',
|
|
21
|
+
refundFailure: '退款失败',
|
|
22
|
+
},
|
|
23
|
+
v: {
|
|
24
|
+
iState: {
|
|
25
|
+
unsettled: '未结算',
|
|
26
|
+
settled: '已结算',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
style: {
|
|
32
|
+
icon: {
|
|
33
|
+
settle: '',
|
|
34
|
+
refund: '',
|
|
35
|
+
refundFailure: '',
|
|
36
|
+
},
|
|
37
|
+
color: {
|
|
38
|
+
iState: {
|
|
39
|
+
unsettled: '#52BE80',
|
|
40
|
+
settled: '#2E86C1',
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
};
|