This commit is contained in:
Xu Chang 2024-06-12 17:06:20 +08:00
commit d45b511891
49 changed files with 251 additions and 121 deletions

View File

@ -12,8 +12,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -26,8 +26,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -40,8 +40,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -54,8 +54,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;

View File

@ -101,7 +101,7 @@ const checkers = [
{
entity: 'pay',
action: 'succeedPaying',
type: 'logical',
type: 'logicalData',
checker(operation, context) {
const { data, filter } = operation;
assert(!(data instanceof Array));

View File

@ -42,7 +42,7 @@ export default function render(props) {
}} placeholder={t(`placeholder.qrCode.${offlineAccount.type}`)}/>}
</Form.Item>}
<Form.Item label={t('offlineAccount:attr.taxLossRatio')} help={t('placeholder.taxLossRatio')}>
<InputNumber value={offlineAccount.taxLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
<InputNumber value={offlineAccount.taxLossRatio} max={5} min={0} addonAfter={"%"} step={0} precision={2} onChange={(value) => {
const taxLossRatio = value;
update({ taxLossRatio });
}}/>

View File

@ -13,6 +13,7 @@ export default OakComponent({
depositId: 1,
entityId: 1,
entity: 1,
externalId: 1,
order: {
id: 1,
creatorId: 1,

View File

@ -20,5 +20,8 @@
"spFail": {
"title": "操作失败",
"content": "系统目前不支持手动成功非线下途径的支付"
},
"placeholder": {
"externalId": "请输入外部系统的唯一转账编号,便于日后核对"
}
}

View File

@ -5,6 +5,7 @@ import ListPro from 'oak-frontend-base/es/components/listPro';
import { RenderOffline } from '../detail/web.pc';
import { generateNewId } from 'oak-domain/lib/utils/uuid';
import { ToYuan } from 'oak-domain/lib/utils/money';
import dayJs from 'dayjs';
export default function Render(props) {
const { pays, offlines, oakExecutable } = props.data;
const { t, execute, updateItem, setMessage, clean } = props.methods;
@ -116,7 +117,7 @@ export default function Render(props) {
}
}
}}/>
<Modal title={t('csp.title')} width={600} open={!!spId} footer={null} onCancel={() => {
<Modal title={t('csp.title')} width={600} destroyOnClose open={!!spId} footer={null} onCancel={() => {
clean();
setSpId('');
}}>
@ -132,12 +133,20 @@ export default function Render(props) {
<Form.Item label={t('pay:attr.price')}>
<Input value={ToYuan(spRow.price)} addonBefore={t('common::pay.symbol')} disabled={true}/>
</Form.Item>
<Form.Item label={t('pay:attr.externalId')} help={t("placeholder.externalId")}>
<Input maxLength={128} value={spRow.externalId || undefined} onChange={({ currentTarget }) => {
const { value } = currentTarget;
updateItem({
externalId: value,
}, spId);
}}/>
</Form.Item>
<Form.Item label={t('pay:attr.successAt')}>
<DatePicker showTime onChange={(value, dateString) => {
updateItem({
successAt: value?.valueOf(),
}, spId);
}}/>
}} maxDate={dayJs()}/>
</Form.Item>
</Form>
<div className={Styles.btn}>

View File

@ -13,6 +13,7 @@
onCancel="{{restartAllMp}}"
entity="user"
entityId="{{userId}}"
style="height:100%;box-sizing:border-box;"
/>
</block>
<block wx:elif="{{withdrawCreate}}">

View File

@ -1,11 +1,6 @@
@import '../../../config/styles/mp/mixins.less';
@import '../../../config/styles/mp/index.less';
.container {
width: 100%;
height: 100%;
box-sizing: border-box;
}
.warningContainer {
padding: 48rpx;

View File

@ -18,8 +18,6 @@ export function WpAccount(props) {
<Descriptions.Item label={t('wpAccount:attr.refundCompensateRatio')}>{refundCompensateRatio}%</Descriptions.Item>
<Descriptions.Item label={t('wpAccount:attr.refundGapDays')}>{refundGapDays}</Descriptions.Item>
<Descriptions.Item label={t('wpAccount:attr.taxLossRatio')}>{taxLossRatio}%</Descriptions.Item>
<Descriptions.Item label={t('wpAccount:attr.allowWithdrawTransfer')}>{t(`common::${allowWithdrawTransfer}`)}</Descriptions.Item>
<Descriptions.Item label={t('wpAccount:attr.withdrawTransferLossRatio')}>{withdrawTransferLossRatio}%</Descriptions.Item>
<Descriptions.Item label={t('wpAccount:attr.enabled')}>{t(`common::${enabled}`)}</Descriptions.Item>
</Descriptions>);
if (onUpdate) {

View File

@ -55,17 +55,6 @@ export default function render(props) {
<InputNumber value={wpAccount.refundGapDays} max={365} min={7} addonAfter={"天"} step={1} onChange={(value) => {
const refundGapDays = value;
update({ refundGapDays });
}}/>
</Form.Item>
<Form.Item label={t('wpAccount:attr.allowWithdrawTransfer')} help={t('placeholder.allowWithdrawTransfer')} required>
<Switch value={wpAccount.allowWithdrawTransfer} onChange={(allowWithdrawTransfer) => {
update({ allowWithdrawTransfer });
}}/>
</Form.Item>
<Form.Item label={t('wpAccount:attr.withdrawTransferLossRatio')} help={t('placeholder.withdrawTransferLossRatio')}>
<InputNumber value={wpAccount.withdrawTransferLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
const withdrawTransferLossRatio = value;
update({ withdrawTransferLossRatio });
}}/>
</Form.Item>
<Form.Item label={t('wpAccount:attr.enabled')} required>

View File

@ -65,7 +65,10 @@ const attrUpdateMatrix = {
iState: 'paying',
entity: 'offlineAccount',
}
}
},
externalId: {
actions: ['startPaying', 'succeedPaying'],
},
},
refund: {
externalId: {

View File

@ -15,7 +15,7 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -24,11 +24,6 @@ const actionAuths = [
pathId: 'user-acc-pay-refund',
deActions: ['select']
},
{
id: 'user-withdrawAccount',
pathId: 'user-withdrawAccount',
deActions: ['select', 'create', 'update', 'remove'],
},
{
id: 'creator-withdraw',
pathId: 'creator-withdraw',
@ -37,7 +32,7 @@ const actionAuths = [
{
id: 'user-account-withdraw',
pathId: 'user-account-withdraw',
deActions: ['select'],
deActions: ['select', 'create'],
},
//account
{

View File

@ -222,6 +222,9 @@ const i18ns = [
"spFail": {
"title": "操作失败",
"content": "系统目前不支持手动成功非线下途径的支付"
},
"placeholder": {
"externalId": "请输入外部系统的唯一转账编号,便于日后核对"
}
}
},

View File

@ -48,13 +48,6 @@ const paths = [
value: 'pay.order.creator',
recursive: false,
},
{
id: 'user-withdrawAccount',
sourceEntity: 'user',
destEntity: 'withdrawAccount',
value: 'user',
recursive: false,
},
{
id: 'creator-withdraw',
sourceEntity: 'user',

View File

@ -4,6 +4,7 @@ import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
import { Schema as Withdraw } from './Withdraw';
import { Schema as User } from './User';
import { Schema as WithdrawAccount } from './WithdrawAccount';
import { Schema as AccountOper } from './AccountOper';
type IState = 'transferring' | 'successful' | 'failed';
type IAction = 'succeed' | 'fail';
export declare const IActionDef: ActionDef<IAction, IState>;
@ -16,6 +17,7 @@ export interface Schema extends EntityShape {
externalId?: String<128>;
meta: Object;
reason?: Text;
sysOpers: AccountOper[];
}
type Action = IAction;
export declare const entityDesc: EntityDesc<Schema, Action, '', {

View File

@ -20,6 +20,7 @@ export const entityDesc = {
externalId: '外部Id',
meta: 'metadata',
reason: '原因',
sysOpers: '账户操作'
},
v: {
iState: {

View File

@ -10,6 +10,7 @@ import * as Order from "../Order/Schema";
import * as Pay from "../Pay/Schema";
import * as Refund from "../Refund/Schema";
import * as Withdraw from "../Withdraw/Schema";
import * as WithdrawTransfer from "../WithdrawTransfer/Schema";
type Type = "deposit" | "withdraw" | "consume" | "loan" | "repay" | "withdrawBack" | "earn" | "encash" | "cutoffRefundable" | "tax" | "taxRefund" | "refund" | "refundFailure";
export type OpSchema = EntityShape & {
accountId: ForeignKey<"account">;
@ -17,7 +18,7 @@ export type OpSchema = EntityShape & {
totalPlus: Price;
availPlus: Price;
refundablePlus?: Price | null;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | string;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string;
entityId: String<64>;
};
export type OpAttr = keyof OpSchema;
@ -27,7 +28,7 @@ export type Schema = EntityShape & {
totalPlus: Price;
availPlus: Price;
refundablePlus?: Price | null;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | string;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string;
entityId: String<64>;
account: Account.Schema;
deposit?: Deposit.Schema;
@ -35,6 +36,7 @@ export type Schema = EntityShape & {
pay?: Pay.Schema;
refund?: Refund.Schema;
withdraw?: Withdraw.Schema;
withdrawTransfer?: WithdrawTransfer.Schema;
} & {
[A in ExpressionKey]?: any;
};
@ -49,13 +51,14 @@ type AttrFilter = {
totalPlus: Q_NumberValue;
availPlus: Q_NumberValue;
refundablePlus: Q_NumberValue;
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | string>;
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string>;
entityId: Q_StringValue;
deposit: Deposit.Filter;
order: Order.Filter;
pay: Pay.Filter;
refund: Refund.Filter;
withdraw: Withdraw.Filter;
withdrawTransfer: WithdrawTransfer.Filter;
};
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
export type Projection = {
@ -78,6 +81,7 @@ export type Projection = {
pay?: Pay.Projection;
refund?: Refund.Projection;
withdraw?: Withdraw.Projection;
withdrawTransfer?: WithdrawTransfer.Projection;
} & Partial<ExprOp<OpAttr | string>>;
type AccountOperIdProjection = OneOf<{
id: number;
@ -100,6 +104,9 @@ type RefundIdProjection = OneOf<{
type WithdrawIdProjection = OneOf<{
entityId: number;
}>;
type WithdrawTransferIdProjection = OneOf<{
entityId: number;
}>;
export type SortAttr = {
id: number;
} | {
@ -134,6 +141,8 @@ export type SortAttr = {
refund: Refund.SortAttr;
} | {
withdraw: Withdraw.SortAttr;
} | {
withdrawTransfer: WithdrawTransfer.SortAttr;
} | {
[k: string]: any;
} | OneOf<ExprOp<OpAttr | string>>;
@ -214,6 +223,18 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
entity: "withdraw";
entityId: ForeignKey<"Withdraw">;
withdraw?: never;
} | {
entity?: never;
entityId?: never;
withdrawTransfer: WithdrawTransfer.CreateSingleOperation;
} | {
entity: "withdrawTransfer";
entityId: ForeignKey<"WithdrawTransfer">;
withdrawTransfer?: WithdrawTransfer.UpdateOperation;
} | {
entity: "withdrawTransfer";
entityId: ForeignKey<"WithdrawTransfer">;
withdrawTransfer?: never;
} | {
entity?: string;
entityId?: string;
@ -255,13 +276,18 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
entityId?: never;
entity?: never;
} | {
entity?: ("deposit" | "order" | "pay" | "refund" | "withdraw" | string) | null;
entityId?: ForeignKey<"Deposit" | "Order" | "Pay" | "Refund" | "Withdraw"> | null;
withdrawTransfer?: WithdrawTransfer.CreateSingleOperation | WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation;
entityId?: never;
entity?: never;
} | {
entity?: ("deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string) | null;
entityId?: ForeignKey<"Deposit" | "Order" | "Pay" | "Refund" | "Withdraw" | "WithdrawTransfer"> | null;
deposit?: never;
order?: never;
pay?: never;
refund?: never;
withdraw?: never;
withdrawTransfer?: never;
}) & {
[k: string]: any;
};
@ -278,6 +304,8 @@ export type RemoveOperationData = {} & (({
refund?: Refund.UpdateOperation | Refund.RemoveOperation;
} | {
withdraw?: Withdraw.UpdateOperation | Withdraw.RemoveOperation;
} | {
withdrawTransfer?: WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation;
} | {
[k: string]: any;
});
@ -289,6 +317,7 @@ export type OrderIdSubQuery = Selection<OrderIdProjection>;
export type PayIdSubQuery = Selection<PayIdProjection>;
export type RefundIdSubQuery = Selection<RefundIdProjection>;
export type WithdrawIdSubQuery = Selection<WithdrawIdProjection>;
export type WithdrawTransferIdSubQuery = Selection<WithdrawTransferIdProjection>;
export type AccountOperIdSubQuery = Selection<AccountOperIdProjection>;
export type EntityDef = {
Schema: Schema;

View File

@ -28,7 +28,7 @@ export const desc = {
params: {
length: 32
},
ref: ["deposit", "order", "pay", "refund", "withdraw"]
ref: ["deposit", "order", "pay", "refund", "withdraw", "withdrawTransfer"]
},
entityId: {
notNull: true,

View File

@ -10,6 +10,7 @@ import * as User from "../User/Schema";
import * as SysAccountOper from "../SysAccountOper/Schema";
import * as ModiEntity from "../ModiEntity/Schema";
import * as OperEntity from "../OperEntity/Schema";
import * as AccountOper from "../AccountOper/Schema";
export type OpSchema = EntityShape & {
iState?: IState | null;
withdrawId: ForeignKey<"withdraw">;
@ -41,6 +42,8 @@ export type Schema = EntityShape & {
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
operEntity$entity?: Array<OperEntity.Schema>;
operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
accountOper$entity?: Array<AccountOper.Schema>;
accountOper$entity$$aggr?: AggregationResult<AccountOper.Schema>;
} & {
[A in ExpressionKey]?: any;
};
@ -64,6 +67,7 @@ type AttrFilter = {
sysAccountOper$withdrawTransfer: SysAccountOper.Filter & SubQueryPredicateMetadata;
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
accountOper$entity: AccountOper.Filter & SubQueryPredicateMetadata;
};
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
export type Projection = {
@ -103,6 +107,12 @@ export type Projection = {
operEntity$entity$$aggr?: OperEntity.Aggregation & {
$entity: "operEntity";
};
accountOper$entity?: AccountOper.Selection & {
$entity: "accountOper";
};
accountOper$entity$$aggr?: AccountOper.Aggregation & {
$entity: "accountOper";
};
} & Partial<ExprOp<OpAttr | string>>;
type WithdrawTransferIdProjection = OneOf<{
id: number;
@ -188,6 +198,7 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "withdrawId" | "
sysAccountOper$withdrawTransfer?: OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">[]> | Array<OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">>>;
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
};
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
@ -233,6 +244,7 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "withdrawId" | "
sysAccountOper$withdrawTransfer?: OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">[]> | Array<OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">>>;
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
};
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
export type RemoveOperationData = {} & (({

View File

@ -1 +1 @@
{ "name": "提现转账", "attr": { "withdraw": "提现申请", "withdrawAccount": "提现账户", "price": "金额", "loss": "手续费", "operator": "操作者", "iState": "状态", "externalId": "外部Id", "meta": "metadata", "reason": "原因" }, "v": { "iState": { "transferring": "待转账", "failed": "已失败", "successful": "已成功" } }, "action": { "succeed": "提现成功", "fail": "提现失败" } }
{ "name": "提现转账", "attr": { "withdraw": "提现申请", "withdrawAccount": "提现账户", "price": "金额", "loss": "手续费", "operator": "操作者", "iState": "状态", "externalId": "外部Id", "meta": "metadata", "reason": "原因", "sysOpers": "账户操作" }, "v": { "iState": { "transferring": "待转账", "failed": "已失败", "successful": "已成功" } }, "action": { "succeed": "提现成功", "fail": "提现失败" } }

View File

@ -668,6 +668,8 @@ export type WithdrawTransferIdSubQuery = {
entity: "modiEntity";
}) | (OperEntity.WithdrawTransferIdSubQuery & {
entity: "operEntity";
}) | (AccountOper.WithdrawTransferIdSubQuery & {
entity: "accountOper";
}) | (WithdrawTransfer.WithdrawTransferIdSubQuery & {
entity: "withdrawTransfer";
}) | any;

View File

@ -336,7 +336,9 @@ const triggers = [
id: 1,
price: 1,
loss: 1,
accountId: 1,
},
refundable: 1,
};
const pays = await context.select('pay', {
data: projection,
@ -360,6 +362,7 @@ const triggers = [
type: 'pay',
}
}, {});
let cnt = 1;
if (tax !== 0) {
// tax产生的损失由sys account来承担
const [account] = await context.select('account', {
@ -384,7 +387,7 @@ const triggers = [
entityId: pay.id,
},
}, {});
return 1;
cnt++;
}
if (depositId) {
const payPrice = pay.price;
@ -414,6 +417,7 @@ const triggers = [
id: depositId,
},
}, {});
cnt++;
if (loss > 0) {
// 如果有loss就充入system的account账户
const [account] = await context.select('account', {
@ -436,9 +440,10 @@ const triggers = [
},
action: 'create',
});
cnt++;
}
}
return 1;
return cnt;
},
},
{

View File

@ -22,6 +22,7 @@ const triggers = [
entity: 1,
entityId: 1,
},
ofSystemId: 1,
},
},
filter: {
@ -34,21 +35,50 @@ const triggers = [
const { withdrawAccount, price, loss } = transfer;
const { entity, entityId } = withdrawAccount.channel;
const actualPrice = price - loss;
// wpAccount不可能成为转账账户
// wpAccount不可能成为转账账户offline这样取应当是安全的
const payClazz = await getPayClazz(entity, entityId, context);
throw new Error('还没写完');
const [tax] = payClazz.calcTransferTax(actualPrice);
await context.operate('sysAccountOper', {
id: await generateNewIdAsync(),
action: 'create',
data: {
id: await generateNewIdAsync(),
delta: loss - price,
delta: -actualPrice - tax,
entity,
entityId,
withdrawTransferId: transfer.id,
type: 'withdrawTransfer',
}
}, {});
cnt++;
if (tax) {
// 如果转账有手续费由system的account来承受
assert(tax > 0);
const systemId = withdrawAccount.ofSystemId;
const [account] = await context.select('account', {
data: {
id: 1,
},
filter: {
entity: 'system',
entityId: systemId,
}
}, { dontCollect: true });
await context.operate('accountOper', {
id: await generateNewIdAsync(),
action: 'create',
data: {
id: await generateNewIdAsync(),
accountId: account.id,
type: 'tax',
totalPlus: -tax,
availPlus: -tax,
entity: 'withdrawTransfer',
entityId: transfer.id,
},
}, {});
cnt++;
}
}
return cnt;
}

View File

@ -14,7 +14,7 @@ export declare const mergedProjection: {
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -1,4 +1,4 @@
import WechatPay from './WechatPay';
import WechatPayDebug from './WechatPay.debug';
declare const _default: typeof WechatPay | typeof WechatPayDebug;
declare const _default: typeof WechatPayDebug | typeof WechatPay;
export default _default;

View File

@ -12,8 +12,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -26,8 +26,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -40,8 +40,8 @@ export declare function getWithdrawCreateData(params: {
creatorId: string;
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
@ -54,8 +54,8 @@ export declare function getWithdrawCreateData(params: {
creator?: undefined;
creatorId: string;
} & {
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdrawId" | "withdraw">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdrawId" | "withdraw">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdrawId" | "withdraw">>)[] | undefined;
refund$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">[]> | (import("oak-domain/lib/types").Operation<string, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">>)[] | undefined;
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>[] | undefined;

View File

@ -104,7 +104,7 @@ const checkers = [
{
entity: 'pay',
action: 'succeedPaying',
type: 'logical',
type: 'logicalData',
checker(operation, context) {
const { data, filter } = operation;
(0, assert_1.default)(!(data instanceof Array));

View File

@ -67,7 +67,10 @@ const attrUpdateMatrix = {
iState: 'paying',
entity: 'offlineAccount',
}
}
},
externalId: {
actions: ['startPaying', 'succeedPaying'],
},
},
refund: {
externalId: {

View File

@ -15,7 +15,7 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -26,11 +26,6 @@ const actionAuths = [
pathId: 'user-acc-pay-refund',
deActions: ['select']
},
{
id: 'user-withdrawAccount',
pathId: 'user-withdrawAccount',
deActions: ['select', 'create', 'update', 'remove'],
},
{
id: 'creator-withdraw',
pathId: 'creator-withdraw',
@ -39,7 +34,7 @@ const actionAuths = [
{
id: 'user-account-withdraw',
pathId: 'user-account-withdraw',
deActions: ['select'],
deActions: ['select', 'create'],
},
//account
{

View File

@ -224,6 +224,9 @@ const i18ns = [
"spFail": {
"title": "操作失败",
"content": "系统目前不支持手动成功非线下途径的支付"
},
"placeholder": {
"externalId": "请输入外部系统的唯一转账编号,便于日后核对"
}
}
},

View File

@ -50,13 +50,6 @@ const paths = [
value: 'pay.order.creator',
recursive: false,
},
{
id: 'user-withdrawAccount',
sourceEntity: 'user',
destEntity: 'withdrawAccount',
value: 'user',
recursive: false,
},
{
id: 'creator-withdraw',
sourceEntity: 'user',

View File

@ -4,6 +4,7 @@ import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
import { Schema as Withdraw } from './Withdraw';
import { Schema as User } from './User';
import { Schema as WithdrawAccount } from './WithdrawAccount';
import { Schema as AccountOper } from './AccountOper';
type IState = 'transferring' | 'successful' | 'failed';
type IAction = 'succeed' | 'fail';
export declare const IActionDef: ActionDef<IAction, IState>;
@ -16,6 +17,7 @@ export interface Schema extends EntityShape {
externalId?: String<128>;
meta: Object;
reason?: Text;
sysOpers: AccountOper[];
}
type Action = IAction;
export declare const entityDesc: EntityDesc<Schema, Action, '', {

View File

@ -23,6 +23,7 @@ exports.entityDesc = {
externalId: '外部Id',
meta: 'metadata',
reason: '原因',
sysOpers: '账户操作'
},
v: {
iState: {

View File

@ -10,6 +10,7 @@ import * as Order from "../Order/Schema";
import * as Pay from "../Pay/Schema";
import * as Refund from "../Refund/Schema";
import * as Withdraw from "../Withdraw/Schema";
import * as WithdrawTransfer from "../WithdrawTransfer/Schema";
type Type = "deposit" | "withdraw" | "consume" | "loan" | "repay" | "withdrawBack" | "earn" | "encash" | "cutoffRefundable" | "tax" | "taxRefund" | "refund" | "refundFailure";
export type OpSchema = EntityShape & {
accountId: ForeignKey<"account">;
@ -17,7 +18,7 @@ export type OpSchema = EntityShape & {
totalPlus: Price;
availPlus: Price;
refundablePlus?: Price | null;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | string;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string;
entityId: String<64>;
};
export type OpAttr = keyof OpSchema;
@ -27,7 +28,7 @@ export type Schema = EntityShape & {
totalPlus: Price;
availPlus: Price;
refundablePlus?: Price | null;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | string;
entity: "deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string;
entityId: String<64>;
account: Account.Schema;
deposit?: Deposit.Schema;
@ -35,6 +36,7 @@ export type Schema = EntityShape & {
pay?: Pay.Schema;
refund?: Refund.Schema;
withdraw?: Withdraw.Schema;
withdrawTransfer?: WithdrawTransfer.Schema;
} & {
[A in ExpressionKey]?: any;
};
@ -49,13 +51,14 @@ type AttrFilter = {
totalPlus: Q_NumberValue;
availPlus: Q_NumberValue;
refundablePlus: Q_NumberValue;
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | string>;
entity: Q_EnumValue<"deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string>;
entityId: Q_StringValue;
deposit: Deposit.Filter;
order: Order.Filter;
pay: Pay.Filter;
refund: Refund.Filter;
withdraw: Withdraw.Filter;
withdrawTransfer: WithdrawTransfer.Filter;
};
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
export type Projection = {
@ -78,6 +81,7 @@ export type Projection = {
pay?: Pay.Projection;
refund?: Refund.Projection;
withdraw?: Withdraw.Projection;
withdrawTransfer?: WithdrawTransfer.Projection;
} & Partial<ExprOp<OpAttr | string>>;
type AccountOperIdProjection = OneOf<{
id: number;
@ -100,6 +104,9 @@ type RefundIdProjection = OneOf<{
type WithdrawIdProjection = OneOf<{
entityId: number;
}>;
type WithdrawTransferIdProjection = OneOf<{
entityId: number;
}>;
export type SortAttr = {
id: number;
} | {
@ -134,6 +141,8 @@ export type SortAttr = {
refund: Refund.SortAttr;
} | {
withdraw: Withdraw.SortAttr;
} | {
withdrawTransfer: WithdrawTransfer.SortAttr;
} | {
[k: string]: any;
} | OneOf<ExprOp<OpAttr | string>>;
@ -214,6 +223,18 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
entity: "withdraw";
entityId: ForeignKey<"Withdraw">;
withdraw?: never;
} | {
entity?: never;
entityId?: never;
withdrawTransfer: WithdrawTransfer.CreateSingleOperation;
} | {
entity: "withdrawTransfer";
entityId: ForeignKey<"WithdrawTransfer">;
withdrawTransfer?: WithdrawTransfer.UpdateOperation;
} | {
entity: "withdrawTransfer";
entityId: ForeignKey<"WithdrawTransfer">;
withdrawTransfer?: never;
} | {
entity?: string;
entityId?: string;
@ -255,13 +276,18 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
entityId?: never;
entity?: never;
} | {
entity?: ("deposit" | "order" | "pay" | "refund" | "withdraw" | string) | null;
entityId?: ForeignKey<"Deposit" | "Order" | "Pay" | "Refund" | "Withdraw"> | null;
withdrawTransfer?: WithdrawTransfer.CreateSingleOperation | WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation;
entityId?: never;
entity?: never;
} | {
entity?: ("deposit" | "order" | "pay" | "refund" | "withdraw" | "withdrawTransfer" | string) | null;
entityId?: ForeignKey<"Deposit" | "Order" | "Pay" | "Refund" | "Withdraw" | "WithdrawTransfer"> | null;
deposit?: never;
order?: never;
pay?: never;
refund?: never;
withdraw?: never;
withdrawTransfer?: never;
}) & {
[k: string]: any;
};
@ -278,6 +304,8 @@ export type RemoveOperationData = {} & (({
refund?: Refund.UpdateOperation | Refund.RemoveOperation;
} | {
withdraw?: Withdraw.UpdateOperation | Withdraw.RemoveOperation;
} | {
withdrawTransfer?: WithdrawTransfer.UpdateOperation | WithdrawTransfer.RemoveOperation;
} | {
[k: string]: any;
});
@ -289,6 +317,7 @@ export type OrderIdSubQuery = Selection<OrderIdProjection>;
export type PayIdSubQuery = Selection<PayIdProjection>;
export type RefundIdSubQuery = Selection<RefundIdProjection>;
export type WithdrawIdSubQuery = Selection<WithdrawIdProjection>;
export type WithdrawTransferIdSubQuery = Selection<WithdrawTransferIdProjection>;
export type AccountOperIdSubQuery = Selection<AccountOperIdProjection>;
export type EntityDef = {
Schema: Schema;

View File

@ -31,7 +31,7 @@ exports.desc = {
params: {
length: 32
},
ref: ["deposit", "order", "pay", "refund", "withdraw"]
ref: ["deposit", "order", "pay", "refund", "withdraw", "withdrawTransfer"]
},
entityId: {
notNull: true,

View File

@ -10,6 +10,7 @@ import * as User from "../User/Schema";
import * as SysAccountOper from "../SysAccountOper/Schema";
import * as ModiEntity from "../ModiEntity/Schema";
import * as OperEntity from "../OperEntity/Schema";
import * as AccountOper from "../AccountOper/Schema";
export type OpSchema = EntityShape & {
iState?: IState | null;
withdrawId: ForeignKey<"withdraw">;
@ -41,6 +42,8 @@ export type Schema = EntityShape & {
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
operEntity$entity?: Array<OperEntity.Schema>;
operEntity$entity$$aggr?: AggregationResult<OperEntity.Schema>;
accountOper$entity?: Array<AccountOper.Schema>;
accountOper$entity$$aggr?: AggregationResult<AccountOper.Schema>;
} & {
[A in ExpressionKey]?: any;
};
@ -64,6 +67,7 @@ type AttrFilter = {
sysAccountOper$withdrawTransfer: SysAccountOper.Filter & SubQueryPredicateMetadata;
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
accountOper$entity: AccountOper.Filter & SubQueryPredicateMetadata;
};
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
export type Projection = {
@ -103,6 +107,12 @@ export type Projection = {
operEntity$entity$$aggr?: OperEntity.Aggregation & {
$entity: "operEntity";
};
accountOper$entity?: AccountOper.Selection & {
$entity: "accountOper";
};
accountOper$entity$$aggr?: AccountOper.Aggregation & {
$entity: "accountOper";
};
} & Partial<ExprOp<OpAttr | string>>;
type WithdrawTransferIdProjection = OneOf<{
id: number;
@ -188,6 +198,7 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "withdrawId" | "
sysAccountOper$withdrawTransfer?: OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">[]> | Array<OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">>>;
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
};
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
@ -233,6 +244,7 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "withdrawId" | "
sysAccountOper$withdrawTransfer?: OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">[]> | Array<OakOperation<"create", Omit<SysAccountOper.CreateOperationData, "withdrawTransfer" | "withdrawTransferId">>>;
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
};
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
export type RemoveOperationData = {} & (({

View File

@ -1 +1 @@
{ "name": "提现转账", "attr": { "withdraw": "提现申请", "withdrawAccount": "提现账户", "price": "金额", "loss": "手续费", "operator": "操作者", "iState": "状态", "externalId": "外部Id", "meta": "metadata", "reason": "原因" }, "v": { "iState": { "transferring": "待转账", "failed": "已失败", "successful": "已成功" } }, "action": { "succeed": "提现成功", "fail": "提现失败" } }
{ "name": "提现转账", "attr": { "withdraw": "提现申请", "withdrawAccount": "提现账户", "price": "金额", "loss": "手续费", "operator": "操作者", "iState": "状态", "externalId": "外部Id", "meta": "metadata", "reason": "原因", "sysOpers": "账户操作" }, "v": { "iState": { "transferring": "待转账", "failed": "已失败", "successful": "已成功" } }, "action": { "succeed": "提现成功", "fail": "提现失败" } }

View File

@ -668,6 +668,8 @@ export type WithdrawTransferIdSubQuery = {
entity: "modiEntity";
}) | (OperEntity.WithdrawTransferIdSubQuery & {
entity: "operEntity";
}) | (AccountOper.WithdrawTransferIdSubQuery & {
entity: "accountOper";
}) | (WithdrawTransfer.WithdrawTransferIdSubQuery & {
entity: "withdrawTransfer";
}) | any;

View File

@ -339,7 +339,9 @@ const triggers = [
id: 1,
price: 1,
loss: 1,
accountId: 1,
},
refundable: 1,
};
const pays = await context.select('pay', {
data: projection,
@ -363,6 +365,7 @@ const triggers = [
type: 'pay',
}
}, {});
let cnt = 1;
if (tax !== 0) {
// tax产生的损失由sys account来承担
const [account] = await context.select('account', {
@ -387,7 +390,7 @@ const triggers = [
entityId: pay.id,
},
}, {});
return 1;
cnt++;
}
if (depositId) {
const payPrice = pay.price;
@ -417,6 +420,7 @@ const triggers = [
id: depositId,
},
}, {});
cnt++;
if (loss > 0) {
// 如果有loss就充入system的account账户
const [account] = await context.select('account', {
@ -439,9 +443,10 @@ const triggers = [
},
action: 'create',
});
cnt++;
}
}
return 1;
return cnt;
},
},
{

View File

@ -25,6 +25,7 @@ const triggers = [
entity: 1,
entityId: 1,
},
ofSystemId: 1,
},
},
filter: {
@ -37,21 +38,50 @@ const triggers = [
const { withdrawAccount, price, loss } = transfer;
const { entity, entityId } = withdrawAccount.channel;
const actualPrice = price - loss;
// wpAccount不可能成为转账账户
// wpAccount不可能成为转账账户offline这样取应当是安全的
const payClazz = await (0, payClazz_1.getPayClazz)(entity, entityId, context);
throw new Error('还没写完');
const [tax] = payClazz.calcTransferTax(actualPrice);
await context.operate('sysAccountOper', {
id: await (0, uuid_1.generateNewIdAsync)(),
action: 'create',
data: {
id: await (0, uuid_1.generateNewIdAsync)(),
delta: loss - price,
delta: -actualPrice - tax,
entity,
entityId,
withdrawTransferId: transfer.id,
type: 'withdrawTransfer',
}
}, {});
cnt++;
if (tax) {
// 如果转账有手续费由system的account来承受
(0, assert_1.default)(tax > 0);
const systemId = withdrawAccount.ofSystemId;
const [account] = await context.select('account', {
data: {
id: 1,
},
filter: {
entity: 'system',
entityId: systemId,
}
}, { dontCollect: true });
await context.operate('accountOper', {
id: await (0, uuid_1.generateNewIdAsync)(),
action: 'create',
data: {
id: await (0, uuid_1.generateNewIdAsync)(),
accountId: account.id,
type: 'tax',
totalPlus: -tax,
availPlus: -tax,
entity: 'withdrawTransfer',
entityId: transfer.id,
},
}, {});
cnt++;
}
}
return cnt;
}

View File

@ -14,7 +14,7 @@ export declare const mergedProjection: {
type?: number | undefined;
systemId?: number | undefined;
system?: import("../oak-app-domain/System/Schema").Projection | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
config?: number | import("oak-domain/lib/types").JsonProjection<import("../oak-app-domain/Application/Schema").WechatMpConfig | import("../oak-app-domain/Application/Schema").WebConfig | import("../oak-app-domain/Application/Schema").WechatPublicConfig | import("../oak-app-domain/Application/Schema").NativeConfig> | undefined;
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style> | undefined;
domainId?: number | undefined;
domain?: import("../oak-app-domain/Domain/Schema").Projection | undefined;

View File

@ -1,4 +1,4 @@
import WechatPay from './WechatPay';
import WechatPayDebug from './WechatPay.debug';
declare const _default: typeof WechatPay | typeof WechatPayDebug;
declare const _default: typeof WechatPayDebug | typeof WechatPay;
export default _default;

View File

@ -13,6 +13,7 @@
onCancel="{{restartAllMp}}"
entity="user"
entityId="{{userId}}"
style="height:100%;box-sizing:border-box;"
/>
</block>
<block wx:elif="{{withdrawCreate}}">

View File

@ -1,11 +1,6 @@
@import '../../../config/styles/mp/mixins.less';
@import '../../../config/styles/mp/index.less';
.container {
width: 100%;
height: 100%;
box-sizing: border-box;
}
.warningContainer {
padding: 48rpx;

View File

@ -26,11 +26,6 @@ const actionAuths: ActionAuth[] = [
pathId: 'user-acc-pay-refund',
deActions: ['select']
},
{
id: 'user-withdrawAccount',
pathId: 'user-withdrawAccount',
deActions: ['select', 'create', 'update', 'remove'],
},
{
id: 'creator-withdraw',
pathId: 'creator-withdraw',
@ -39,7 +34,7 @@ const actionAuths: ActionAuth[] = [
{
id: 'user-account-withdraw',
pathId: 'user-account-withdraw',
deActions: ['select'],
deActions: ['select', 'create'],
},
//account
{

View File

@ -50,13 +50,6 @@ const paths: Path[] = [
value: 'pay.order.creator',
recursive: false,
},
{
id: 'user-withdrawAccount',
sourceEntity: 'user',
destEntity: 'withdrawAccount',
value: 'user',
recursive: false,
},
{
id: 'creator-withdraw',
sourceEntity: 'user',

View File

@ -267,7 +267,7 @@ const triggers: Trigger<EntityDict, 'pay', BRC>[] = [
const payClazz = await getPayClazz(entity!, entityId!, context);
await payClazz.close(pay as EntityDict['pay']['OpSchema']);
cnt ++;
cnt++;
}
if (depositId) {
await context.operate('deposit', {
@ -278,7 +278,7 @@ const triggers: Trigger<EntityDict, 'pay', BRC>[] = [
id: depositId,
},
}, {});
cnt ++;
cnt++;
}
return cnt;
},
@ -387,7 +387,7 @@ const triggers: Trigger<EntityDict, 'pay', BRC>[] = [
action: 'create',
data: {
id: await generateNewIdAsync(),
delta: paid!- tax,
delta: paid! - tax,
entity: sysAccountEntity,
entityId: sysAccountEntityId,
payId: pay.id,
@ -425,17 +425,17 @@ const triggers: Trigger<EntityDict, 'pay', BRC>[] = [
cnt ++;
}
if (depositId) {
if (depositId) {
const payPrice = pay.price!;
const { price, loss } = deposit!;
assert(price! === payPrice);
const accountOpers: EntityDict['deposit']['Update']['data']['accountOper$entity'] = [
{
id: await generateNewIdAsync(),
data: {
id: await generateNewIdAsync(),
totalPlus: price - loss ,
totalPlus: price - loss,
availPlus: price - loss,
refundablePlus: pay.refundable ? price : 0,
accountId: deposit!.accountId,