oak-pay-business 2.8.0-beta.1 → 3.0.1
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/components/order/pay/web.mobile.module.less +35 -35
- package/es/components/order/pay/web.pc.module.less +35 -35
- package/es/components/ship/system/web.pc.js +18 -18
- package/es/components/ship/system/web.pc.module.less +15 -15
- package/es/components/ship/wechatMpShip/upsert/web.pc.js +10 -10
- package/es/components/ship/wechatMpShip/web.pc.js +20 -20
- package/es/components/ship/wechatMpShip/web.pc.module.less +7 -7
- package/es/endpoints/wechatPay.js +2 -0
- package/es/entities/AbstractPayProduct.d.ts +13 -0
- package/es/entities/AbstractPayProduct.js +16 -0
- package/es/entities/Settlement.d.ts +3 -1
- package/es/entities/Settlement.js +2 -0
- package/es/entities/WpProduct.d.ts +2 -2
- package/es/oak-app-domain/AbstractPayProduct/Schema.d.ts +19 -0
- package/es/oak-app-domain/AbstractPayProduct/Schema.js +1 -0
- package/es/oak-app-domain/AbstractPayProduct/Storage.d.ts +3 -0
- package/es/oak-app-domain/AbstractPayProduct/Storage.js +40 -0
- package/es/oak-app-domain/AbstractPayProduct/_baseSchema.d.ts +57 -0
- package/es/oak-app-domain/AbstractPayProduct/_baseSchema.js +1 -0
- package/es/oak-app-domain/AbstractPayProduct/locales/zh_CN.json +11 -0
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/_baseSchema.d.ts +2 -2
- package/es/oak-app-domain/EntityDict.d.ts +65 -48
- package/es/oak-app-domain/Settlement/Action.d.ts +1 -1
- package/es/oak-app-domain/Settlement/Action.js +1 -1
- package/es/oak-app-domain/Settlement/locales/zh_CN.json +3 -1
- package/es/oak-app-domain/Storage.js +2 -2
- package/es/triggers/order.js +42 -63
- package/lib/endpoints/wechatPay.js +2 -0
- package/lib/entities/AbstractPayProduct.d.ts +13 -0
- package/lib/entities/AbstractPayProduct.js +19 -0
- package/lib/entities/Settlement.d.ts +3 -1
- package/lib/entities/Settlement.js +2 -0
- package/lib/entities/WpProduct.d.ts +2 -2
- package/lib/oak-app-domain/AbstractPayProduct/Schema.d.ts +19 -0
- package/lib/oak-app-domain/AbstractPayProduct/Schema.js +4 -0
- package/lib/oak-app-domain/AbstractPayProduct/Storage.d.ts +3 -0
- package/lib/oak-app-domain/AbstractPayProduct/Storage.js +43 -0
- package/lib/oak-app-domain/AbstractPayProduct/_baseSchema.d.ts +57 -0
- package/lib/oak-app-domain/AbstractPayProduct/_baseSchema.js +2 -0
- package/lib/oak-app-domain/AbstractPayProduct/locales/zh_CN.json +11 -0
- package/lib/oak-app-domain/AccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/AccountOper/_baseSchema.d.ts +2 -2
- package/lib/oak-app-domain/EntityDict.d.ts +65 -48
- package/lib/oak-app-domain/Settlement/Action.d.ts +1 -1
- package/lib/oak-app-domain/Settlement/Action.js +1 -1
- package/lib/oak-app-domain/Settlement/locales/zh_CN.json +3 -1
- package/lib/oak-app-domain/Storage.js +4 -4
- package/lib/triggers/order.js +42 -63
- package/package.json +4 -4
- package/src/entities/{AbstactPayProduct.ts → AbstractPayProduct.ts} +38 -38
- package/src/entities/AbstractShipAccount.ts +39 -39
- package/src/entities/Settlement.ts +5 -1
- package/src/entities/ShipService.ts +26 -26
- package/src/entities/WechatMpShip.ts +32 -32
- package/src/entities/WpProduct.ts +2 -2
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
background-color: var(--oak-bg-color-page);
|
|
8
|
-
// min-height: 500px;
|
|
9
|
-
|
|
10
|
-
.ctrl {
|
|
11
|
-
margin: 8px;
|
|
12
|
-
margin-top: 10px;
|
|
13
|
-
flex: 1;
|
|
14
|
-
|
|
15
|
-
.pc1 {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
margin-top: 4px;
|
|
21
|
-
|
|
22
|
-
.content {
|
|
23
|
-
background-color: var(--oak-bg-color-container);
|
|
24
|
-
padding: 4px;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
padding: 16px;
|
|
27
|
-
|
|
28
|
-
.tips {
|
|
29
|
-
color: var(--oak-color-info);
|
|
30
|
-
font-size: small;
|
|
31
|
-
margin-top: 3px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
background-color: var(--oak-bg-color-page);
|
|
8
|
+
// min-height: 500px;
|
|
9
|
+
|
|
10
|
+
.ctrl {
|
|
11
|
+
margin: 8px;
|
|
12
|
+
margin-top: 10px;
|
|
13
|
+
flex: 1;
|
|
14
|
+
|
|
15
|
+
.pc1 {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
margin-top: 4px;
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
background-color: var(--oak-bg-color-container);
|
|
24
|
+
padding: 4px;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
padding: 16px;
|
|
27
|
+
|
|
28
|
+
.tips {
|
|
29
|
+
color: var(--oak-color-info);
|
|
30
|
+
font-size: small;
|
|
31
|
+
margin-top: 3px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
background-color: var(--oak-bg-color-page);
|
|
8
|
-
// min-height: 500px;
|
|
9
|
-
|
|
10
|
-
.ctrl {
|
|
11
|
-
margin: 8px;
|
|
12
|
-
margin-top: 10px;
|
|
13
|
-
flex: 1;
|
|
14
|
-
|
|
15
|
-
.pc1 {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
margin-top: 4px;
|
|
21
|
-
|
|
22
|
-
.content {
|
|
23
|
-
background-color: var(--oak-bg-color-container);
|
|
24
|
-
padding: 4px;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
padding: 16px;
|
|
27
|
-
|
|
28
|
-
.tips {
|
|
29
|
-
color: var(--oak-color-info);
|
|
30
|
-
font-size: small;
|
|
31
|
-
font-weight: bold;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
background-color: var(--oak-bg-color-page);
|
|
8
|
+
// min-height: 500px;
|
|
9
|
+
|
|
10
|
+
.ctrl {
|
|
11
|
+
margin: 8px;
|
|
12
|
+
margin-top: 10px;
|
|
13
|
+
flex: 1;
|
|
14
|
+
|
|
15
|
+
.pc1 {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
margin-top: 4px;
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
background-color: var(--oak-bg-color-container);
|
|
24
|
+
padding: 4px;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
padding: 16px;
|
|
27
|
+
|
|
28
|
+
.tips {
|
|
29
|
+
color: var(--oak-color-info);
|
|
30
|
+
font-size: small;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -16,12 +16,12 @@ function RenderShipEntity(props) {
|
|
|
16
16
|
return (<Tabs className={Styles.container} tabPosition="left" items={entities.map((entity) => {
|
|
17
17
|
const Comp = ShipSettingComponentDict[entity];
|
|
18
18
|
return {
|
|
19
|
-
label: (<div className={Styles.systemLabel}>
|
|
20
|
-
{t(`${entity}:name`)}
|
|
19
|
+
label: (<div className={Styles.systemLabel}>
|
|
20
|
+
{t(`${entity}:name`)}
|
|
21
21
|
</div>),
|
|
22
22
|
key: entity,
|
|
23
|
-
children: (<Flex vertical>
|
|
24
|
-
<Comp systemId={oakId} oakPath={`${oakFullpath}.${entity}$system`}/>
|
|
23
|
+
children: (<Flex vertical>
|
|
24
|
+
<Comp systemId={oakId} oakPath={`${oakFullpath}.${entity}$system`}/>
|
|
25
25
|
{/* <Flex
|
|
26
26
|
gap="middle"
|
|
27
27
|
justify='end'
|
|
@@ -39,24 +39,24 @@ function RenderShipEntity(props) {
|
|
|
39
39
|
>
|
|
40
40
|
{t('common::reset')}
|
|
41
41
|
</Button>
|
|
42
|
-
</Flex> */}
|
|
42
|
+
</Flex> */}
|
|
43
43
|
</Flex>)
|
|
44
44
|
};
|
|
45
45
|
})}/>);
|
|
46
46
|
}
|
|
47
|
-
return (<Flex className={Styles.tips} vertical align="stretch">
|
|
48
|
-
<Alert type="info" message={t("tips.header")} description={t('tips.desc')}/>
|
|
49
|
-
<div className={Styles.code}>
|
|
50
|
-
<Markdown>{`
|
|
51
|
-
\`\`\`
|
|
52
|
-
import { registerShipSettingComponent } from 'oak-pay-business/es/registry';
|
|
53
|
-
import WechatMpShipSetting from 'oak-pay-business/es/components/ship/wechatMpShip';
|
|
54
|
-
registerShipSettingComponent('wechatMpShip', WechatMpShipSetting);
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
`}
|
|
58
|
-
</Markdown>
|
|
59
|
-
</div>
|
|
47
|
+
return (<Flex className={Styles.tips} vertical align="stretch">
|
|
48
|
+
<Alert type="info" message={t("tips.header")} description={t('tips.desc')}/>
|
|
49
|
+
<div className={Styles.code}>
|
|
50
|
+
<Markdown>{`
|
|
51
|
+
\`\`\`
|
|
52
|
+
import { registerShipSettingComponent } from 'oak-pay-business/es/registry';
|
|
53
|
+
import WechatMpShipSetting from 'oak-pay-business/es/components/ship/wechatMpShip';
|
|
54
|
+
registerShipSettingComponent('wechatMpShip', WechatMpShipSetting);
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
`}
|
|
58
|
+
</Markdown>
|
|
59
|
+
</div>
|
|
60
60
|
</Flex>);
|
|
61
61
|
}
|
|
62
62
|
export default function render(props) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.tips {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
|
|
10
|
-
.code {
|
|
11
|
-
width: 80%;
|
|
12
|
-
margin-top: 40px;
|
|
13
|
-
background-color: aquamarine;
|
|
14
|
-
align-self: center;
|
|
15
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tips {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
|
|
10
|
+
.code {
|
|
11
|
+
width: 80%;
|
|
12
|
+
margin-top: 40px;
|
|
13
|
+
background-color: aquamarine;
|
|
14
|
+
align-self: center;
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -4,24 +4,24 @@ export default function render(props) {
|
|
|
4
4
|
const { wechatMpShip, applicationChangable, applications } = props.data;
|
|
5
5
|
const { t, update } = props.methods;
|
|
6
6
|
if (wechatMpShip) {
|
|
7
|
-
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ width: '100%', margin: 28 }}>
|
|
8
|
-
<Form.Item label={t('wpProduct:name')}>
|
|
7
|
+
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ width: '100%', margin: 28 }}>
|
|
8
|
+
<Form.Item label={t('wpProduct:name')}>
|
|
9
9
|
{applicationChangable ? <Select options={applications} value={wechatMpShip.applicationId} onChange={(value) => {
|
|
10
10
|
update({
|
|
11
11
|
applicationId: value,
|
|
12
12
|
});
|
|
13
|
-
}}/> : <Input disabled={true} value={wechatMpShip.application?.name}/>}
|
|
14
|
-
</Form.Item>
|
|
15
|
-
<Form.Item label={t('wechatMpShip:attr.disabled')} help={t('help.disabled')}>
|
|
13
|
+
}}/> : <Input disabled={true} value={wechatMpShip.application?.name}/>}
|
|
14
|
+
</Form.Item>
|
|
15
|
+
<Form.Item label={t('wechatMpShip:attr.disabled')} help={t('help.disabled')}>
|
|
16
16
|
<Switch value={!!wechatMpShip.disabled} onChange={(v) => {
|
|
17
17
|
update({
|
|
18
18
|
disabled: v,
|
|
19
19
|
});
|
|
20
|
-
}}/>
|
|
21
|
-
</Form.Item>
|
|
22
|
-
<Form.Item label={t('wechatMpShip:attr.sort')} help={t('help.sort')}>
|
|
23
|
-
<Input disabled={true} value={wechatMpShip.sort}/>
|
|
24
|
-
</Form.Item>
|
|
20
|
+
}}/>
|
|
21
|
+
</Form.Item>
|
|
22
|
+
<Form.Item label={t('wechatMpShip:attr.sort')} help={t('help.sort')}>
|
|
23
|
+
<Input disabled={true} value={wechatMpShip.sort}/>
|
|
24
|
+
</Form.Item>
|
|
25
25
|
</Form>);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -17,57 +17,57 @@ export default function render(props) {
|
|
|
17
17
|
}} onOk={async () => {
|
|
18
18
|
await execute();
|
|
19
19
|
setUpsertId('');
|
|
20
|
-
}} width={720} okText={t('common::confirm')} cancelText={t('common::action.cancel')}>
|
|
21
|
-
<Upsert oakPath={`${oakFullpath}.${upsertId}`} oakId={upsertId}/>
|
|
20
|
+
}} width={720} okText={t('common::confirm')} cancelText={t('common::action.cancel')}>
|
|
21
|
+
<Upsert oakPath={`${oakFullpath}.${upsertId}`} oakId={upsertId}/>
|
|
22
22
|
</Modal>);
|
|
23
23
|
if (ships?.length) {
|
|
24
|
-
return (<div>
|
|
25
|
-
<Alert message={t('help.intro')}/>
|
|
24
|
+
return (<div>
|
|
25
|
+
<Alert message={t('help.intro')}/>
|
|
26
26
|
<Space style={{
|
|
27
27
|
marginTop: 22
|
|
28
|
-
}}>
|
|
28
|
+
}}>
|
|
29
29
|
{ships.map((ele, idx) => (<Card title={ele.application.name} extra={<Button size="small" icon={<EditOutlined />} type="text" onClick={() => {
|
|
30
30
|
setUpsertId(ele.id);
|
|
31
|
-
}}/>}>
|
|
31
|
+
}}/>}>
|
|
32
32
|
<Detail key={idx} column={1} bordered entity="wechatMpShip" attributes={[
|
|
33
33
|
"disabled",
|
|
34
34
|
"sort",
|
|
35
|
-
]} data={ele}/>
|
|
36
|
-
</Card>))}
|
|
35
|
+
]} data={ele}/>
|
|
36
|
+
</Card>))}
|
|
37
37
|
{applications.length > ships.length && <Card style={{
|
|
38
38
|
width: 245.67,
|
|
39
39
|
height: 269.41,
|
|
40
40
|
display: 'flex',
|
|
41
41
|
alignItems: 'center',
|
|
42
42
|
justifyContent: 'center'
|
|
43
|
-
}}>
|
|
43
|
+
}}>
|
|
44
44
|
<Button icon={<PlusOutlined style={{ fontSize: 32, color: 'var(--oak-color-primary)' }}/>} type="text" style={{ width: 80, height: 80 }} onClick={async () => {
|
|
45
45
|
const id = await generateNewIdAsync();
|
|
46
46
|
addItem({
|
|
47
47
|
id,
|
|
48
48
|
});
|
|
49
49
|
setUpsertId(id);
|
|
50
|
-
}}/>
|
|
51
|
-
</Card>}
|
|
52
|
-
</Space>
|
|
53
|
-
{U}
|
|
50
|
+
}}/>
|
|
51
|
+
</Card>}
|
|
52
|
+
</Space>
|
|
53
|
+
{U}
|
|
54
54
|
</div>);
|
|
55
55
|
}
|
|
56
56
|
if (applications?.length) {
|
|
57
|
-
return (<>
|
|
58
|
-
<div className={Styles.container}>
|
|
57
|
+
return (<>
|
|
58
|
+
<div className={Styles.container}>
|
|
59
59
|
<Button icon={<PlusOutlined style={{ fontSize: 72, color: 'var(--oak-color-primary)' }}/>} type="text" style={{ width: 80, height: 80 }} onClick={async () => {
|
|
60
60
|
const id = await generateNewIdAsync();
|
|
61
61
|
addItem({
|
|
62
62
|
id,
|
|
63
63
|
});
|
|
64
64
|
setUpsertId(id);
|
|
65
|
-
}}/>
|
|
66
|
-
</div>
|
|
67
|
-
{U}
|
|
65
|
+
}}/>
|
|
66
|
+
</div>
|
|
67
|
+
{U}
|
|
68
68
|
</>);
|
|
69
69
|
}
|
|
70
|
-
return (<div className={Styles.container}>
|
|
71
|
-
<Alert type="info" message={t('warning.noApplication')}/>
|
|
70
|
+
return (<div className={Styles.container}>
|
|
71
|
+
<Alert type="info" message={t('warning.noApplication')}/>
|
|
72
72
|
</div>);
|
|
73
73
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
min-height: 30vh;
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
min-height: 30vh;
|
|
8
8
|
}
|
|
@@ -3,6 +3,7 @@ export const payNotify = {
|
|
|
3
3
|
name: '微信支付回调',
|
|
4
4
|
method: 'post',
|
|
5
5
|
params: ['payId'],
|
|
6
|
+
type: 'simple',
|
|
6
7
|
fn: async (context, params, headers, req, body) => {
|
|
7
8
|
const { payId } = params;
|
|
8
9
|
return payNotifyFn(context, body, payId, headers);
|
|
@@ -12,6 +13,7 @@ export const refundNotify = {
|
|
|
12
13
|
name: '微信退款回调',
|
|
13
14
|
method: 'post',
|
|
14
15
|
params: ['refundId'],
|
|
16
|
+
type: 'simple',
|
|
15
17
|
fn: async (context, params, headers, req, body) => {
|
|
16
18
|
const { refundId } = params;
|
|
17
19
|
return refundNotifyFn(context, body, refundId, headers);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Boolean, Int, Decimal } from 'oak-domain/lib/types/DataType';
|
|
2
|
+
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
3
|
+
import { Schema as Application } from 'oak-general-business/lib/entities/Application';
|
|
4
|
+
import { EntityDesc } from 'oak-domain/lib/types';
|
|
5
|
+
export interface Schema extends EntityShape {
|
|
6
|
+
taxLossRatio?: Decimal<4, 2>;
|
|
7
|
+
refundGapDays?: Int<4>;
|
|
8
|
+
refundCompensateRatio?: Int<4>;
|
|
9
|
+
needReceiving?: Boolean;
|
|
10
|
+
application: Application;
|
|
11
|
+
enabled: Boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const entityDesc: EntityDesc<Schema>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
;
|
|
2
|
+
export const entityDesc = {
|
|
3
|
+
locales: {
|
|
4
|
+
zh_CN: {
|
|
5
|
+
name: '抽象支付产品',
|
|
6
|
+
attr: {
|
|
7
|
+
taxLossRatio: '渠道手续费百分比',
|
|
8
|
+
refundGapDays: '允许最大退款天数',
|
|
9
|
+
refundCompensateRatio: '退款渠道补偿百分比',
|
|
10
|
+
needReceiving: '用户确认收货后到账',
|
|
11
|
+
application: '关联应用',
|
|
12
|
+
enabled: '是否启用'
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -3,15 +3,17 @@ import { EntityShape } from 'oak-domain/lib/types/Entity';
|
|
|
3
3
|
import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
|
4
4
|
import { Schema as Account } from './Account';
|
|
5
5
|
import { Schema as Order } from './Order';
|
|
6
|
+
import { Schema as AccountOper } from './AccountOper';
|
|
6
7
|
export interface Schema extends EntityShape {
|
|
7
8
|
account: Account;
|
|
8
9
|
price: Price;
|
|
9
10
|
order: Order;
|
|
11
|
+
opers?: AccountOper[];
|
|
10
12
|
}
|
|
11
13
|
type IState = 'unsettled' | 'settled';
|
|
12
14
|
type IAction = 'settle';
|
|
13
15
|
export declare const IActionDef: ActionDef<IAction, IState>;
|
|
14
|
-
type Action = IAction | 'refund' | 'refundFailure';
|
|
16
|
+
type Action = IAction | 'preSettle' | 'refund' | 'refundFailure';
|
|
15
17
|
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
|
16
18
|
iState: IState;
|
|
17
19
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntityDesc } from 'oak-domain/lib/types';
|
|
2
2
|
import { Schema as WpAccount } from './WpAccount';
|
|
3
3
|
import { Schema as Pay } from './Pay';
|
|
4
|
-
import { Schema as
|
|
5
|
-
export interface Schema extends
|
|
4
|
+
import { Schema as AbstractPayProduct } from './AbstractPayProduct';
|
|
5
|
+
export interface Schema extends AbstractPayProduct {
|
|
6
6
|
wpAccount: WpAccount;
|
|
7
7
|
type: 'native' | 'mp' | 'jsapi' | 'h5' | 'app';
|
|
8
8
|
pays: Pay[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./_baseSchema";
|
|
2
|
+
import { AbstractPayProduct } from "../EntityDict";
|
|
3
|
+
export type Schema = AbstractPayProduct["Schema"];
|
|
4
|
+
export type Action = AbstractPayProduct["Action"];
|
|
5
|
+
export type Projection = AbstractPayProduct["Projection"];
|
|
6
|
+
export type Filter = AbstractPayProduct["Filter"];
|
|
7
|
+
export type SortNode = AbstractPayProduct["SortNode"];
|
|
8
|
+
export type Sorter = AbstractPayProduct["Sorter"];
|
|
9
|
+
export type Selection = AbstractPayProduct["Selection"];
|
|
10
|
+
export type Aggregation = AbstractPayProduct["Aggregation"];
|
|
11
|
+
export type CreateOperationData = AbstractPayProduct["CreateOperationData"];
|
|
12
|
+
export type CreateSingle = AbstractPayProduct["CreateSingle"];
|
|
13
|
+
export type CreateMulti = AbstractPayProduct["CreateMulti"];
|
|
14
|
+
export type Create = AbstractPayProduct["Create"];
|
|
15
|
+
export type UpdateOperationData = AbstractPayProduct["UpdateOperationData"];
|
|
16
|
+
export type Update = AbstractPayProduct["Update"];
|
|
17
|
+
export type RemoveOperationData = AbstractPayProduct["RemoveOperationData"];
|
|
18
|
+
export type Remove = AbstractPayProduct["Remove"];
|
|
19
|
+
export type Operation = AbstractPayProduct["Operation"];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./_baseSchema";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
|
2
|
+
export const desc = {
|
|
3
|
+
attributes: {
|
|
4
|
+
taxLossRatio: {
|
|
5
|
+
type: "decimal",
|
|
6
|
+
params: {
|
|
7
|
+
precision: 4,
|
|
8
|
+
scale: 2
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
refundGapDays: {
|
|
12
|
+
type: "int",
|
|
13
|
+
params: {
|
|
14
|
+
width: 4,
|
|
15
|
+
signed: true
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
refundCompensateRatio: {
|
|
19
|
+
type: "int",
|
|
20
|
+
params: {
|
|
21
|
+
width: 4,
|
|
22
|
+
signed: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
needReceiving: {
|
|
26
|
+
type: "boolean"
|
|
27
|
+
},
|
|
28
|
+
applicationId: {
|
|
29
|
+
notNull: true,
|
|
30
|
+
type: "ref",
|
|
31
|
+
ref: "application"
|
|
32
|
+
},
|
|
33
|
+
enabled: {
|
|
34
|
+
notNull: true,
|
|
35
|
+
type: "boolean"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
actionType: "crud",
|
|
39
|
+
actions
|
|
40
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
|
2
|
+
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, NodeId, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
|
3
|
+
import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
|
4
|
+
import { GenericAction } from "oak-domain/lib/actions/action";
|
|
5
|
+
import { Decimal, Int, Boolean } from "oak-domain/lib/types/DataType";
|
|
6
|
+
export type OpSchema = EntityShape & {
|
|
7
|
+
taxLossRatio?: Decimal<4, 2> | null;
|
|
8
|
+
refundGapDays?: Int<4> | null;
|
|
9
|
+
refundCompensateRatio?: Int<4> | null;
|
|
10
|
+
needReceiving?: Boolean | null;
|
|
11
|
+
applicationId: ForeignKey<"application">;
|
|
12
|
+
enabled: Boolean;
|
|
13
|
+
} & {
|
|
14
|
+
[A in ExpressionKey]?: any;
|
|
15
|
+
};
|
|
16
|
+
export type OpAttr = keyof OpSchema;
|
|
17
|
+
export type OpFilter = {
|
|
18
|
+
id: Q_StringValue;
|
|
19
|
+
$$createAt$$: Q_DateValue;
|
|
20
|
+
$$seq$$: Q_NumberValue;
|
|
21
|
+
$$updateAt$$: Q_DateValue;
|
|
22
|
+
taxLossRatio: Q_NumberValue;
|
|
23
|
+
refundGapDays: Q_NumberValue;
|
|
24
|
+
refundCompensateRatio: Q_NumberValue;
|
|
25
|
+
needReceiving: Q_BooleanValue;
|
|
26
|
+
applicationId: Q_StringValue;
|
|
27
|
+
enabled: Q_BooleanValue;
|
|
28
|
+
} & ExprOp<OpAttr | string>;
|
|
29
|
+
export type OpProjection = {
|
|
30
|
+
"#id"?: NodeId;
|
|
31
|
+
[k: string]: any;
|
|
32
|
+
id?: number;
|
|
33
|
+
$$createAt$$?: number;
|
|
34
|
+
$$updateAt$$?: number;
|
|
35
|
+
$$seq$$?: number;
|
|
36
|
+
taxLossRatio?: number;
|
|
37
|
+
refundGapDays?: number;
|
|
38
|
+
refundCompensateRatio?: number;
|
|
39
|
+
needReceiving?: number;
|
|
40
|
+
applicationId?: number;
|
|
41
|
+
enabled?: number;
|
|
42
|
+
} & Partial<ExprOp<OpAttr | string>>;
|
|
43
|
+
export type OpSortAttr = Partial<{
|
|
44
|
+
id: number;
|
|
45
|
+
$$createAt$$: number;
|
|
46
|
+
$$seq$$: number;
|
|
47
|
+
$$updateAt$$: number;
|
|
48
|
+
taxLossRatio: number;
|
|
49
|
+
refundGapDays: number;
|
|
50
|
+
refundCompensateRatio: number;
|
|
51
|
+
needReceiving: number;
|
|
52
|
+
applicationId: number;
|
|
53
|
+
enabled: number;
|
|
54
|
+
[k: string]: any;
|
|
55
|
+
} | ExprOp<OpAttr | string>>;
|
|
56
|
+
export type OpAction = OakMakeAction<GenericAction | string>;
|
|
57
|
+
export type OpUpdateAction = "update" | string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -40,7 +40,7 @@ export const desc = {
|
|
|
40
40
|
params: {
|
|
41
41
|
length: 32
|
|
42
42
|
},
|
|
43
|
-
ref: ["deposit", "order", "pay", "refund", "withdraw", "withdrawTransfer"]
|
|
43
|
+
ref: ["deposit", "order", "pay", "refund", "settlement", "withdraw", "withdrawTransfer"]
|
|
44
44
|
},
|
|
45
45
|
entityId: {
|
|
46
46
|
notNull: true,
|
|
@@ -13,7 +13,7 @@ export type OpSchema = EntityShape & {
|
|
|
13
13
|
total: Price;
|
|
14
14
|
avail: Price;
|
|
15
15
|
refundable: Price;
|
|
16
|
-
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string;
|
|
16
|
+
entity: "deposit" | "order" | "pay" | "refund" | "settlement" | "withdraw" | "withdrawTransfer" | string;
|
|
17
17
|
entityId: String<64>;
|
|
18
18
|
} & {
|
|
19
19
|
[A in ExpressionKey]?: any;
|
|
@@ -32,7 +32,7 @@ export type OpFilter = {
|
|
|
32
32
|
total: Q_NumberValue;
|
|
33
33
|
avail: Q_NumberValue;
|
|
34
34
|
refundable: Q_NumberValue;
|
|
35
|
-
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string>;
|
|
35
|
+
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "settlement" | "withdraw" | "withdrawTransfer" | string>;
|
|
36
36
|
entityId: Q_StringValue;
|
|
37
37
|
} & ExprOp<OpAttr | string>;
|
|
38
38
|
export type OpProjection = {
|