From adaf42bce66f975d1541f69c7f60afcdc1efc063 Mon Sep 17 00:00:00 2001 From: Xc Date: Fri, 7 Jun 2024 14:57:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E7=9A=84=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/checkers/account.js | 15 +- lib/checkers/accountOper.js | 6 + lib/checkers/index.d.ts | 2 +- lib/components/payConfig/system/web.pc.js | 87 +++++++++- lib/components/wpAccount/config/index.js | 4 +- lib/configuration/attrUpdateMatrix.js | 10 +- lib/data/i18n.js | 41 +++-- lib/entities/AbstractAccount.d.ts | 10 +- lib/entities/AbstractAccount.js | 18 +-- lib/entities/AccountOper.d.ts | 2 +- lib/entities/AccountOper.js | 2 + lib/entities/OfflineAccount.d.ts | 7 - lib/entities/OfflineAccount.js | 9 +- lib/entities/System.d.ts | 16 ++ lib/entities/System.js | 1 + lib/entities/WpAccount.d.ts | 4 +- lib/entities/WpAccount.js | 18 +-- lib/entities/WpProduct.d.ts | 2 +- lib/entities/WpProduct.js | 2 +- lib/features/Pay.js | 2 +- lib/locales/common/zh_CN.json | 4 +- .../AbstractAccount/Schema.d.ts | 34 ++-- lib/oak-app-domain/AbstractAccount/Storage.js | 21 +-- lib/oak-app-domain/AbstractAccount/Style.js | 6 - .../AbstractAccount/locales/zh_CN.json | 2 +- lib/oak-app-domain/Account/Schema.d.ts | 16 -- lib/oak-app-domain/AccountOper/Schema.d.ts | 2 +- lib/oak-app-domain/AccountOper/Storage.js | 2 +- lib/oak-app-domain/AccountOper/Style.js | 1 + .../AccountOper/locales/zh_CN.json | 2 +- lib/oak-app-domain/OfflineAccount/Schema.d.ts | 48 ++---- lib/oak-app-domain/OfflineAccount/Storage.js | 35 +---- .../OfflineAccount/locales/zh_CN.json | 6 +- lib/oak-app-domain/System/Schema.d.ts | 20 +++ lib/oak-app-domain/System/Storage.js | 9 +- lib/oak-app-domain/System/locales/zh_CN.json | 2 +- .../WithdrawAccount/Schema.d.ts | 6 - lib/oak-app-domain/WpAccount/Schema.d.ts | 34 ++-- lib/oak-app-domain/WpAccount/Storage.js | 21 +-- .../WpAccount/locales/zh_CN.json | 2 +- lib/oak-app-domain/WpProduct/Schema.d.ts | 10 +- lib/oak-app-domain/WpProduct/Storage.js | 2 +- .../WpProduct/locales/zh_CN.json | 2 +- lib/ports/index.d.ts | 2 +- lib/routines/start.d.ts | 2 +- lib/timers/index.d.ts | 2 +- lib/triggers/index.d.ts | 2 +- lib/triggers/pay.d.ts | 4 +- lib/triggers/pay.js | 148 ++++++++++++------ lib/triggers/refund.js | 10 +- lib/types/Exception.d.ts | 2 +- lib/utils/application.js | 15 +- lib/utils/pay.d.ts | 6 +- lib/utils/pay.js | 129 ++++++--------- lib/watchers/index.d.ts | 2 +- src/components/payConfig/system/web.pc.tsx | 3 +- src/configuration/attrUpdateMatrix.ts | 6 + src/entities/WpAccount.ts | 6 - src/registry.ts | 1 - src/triggers/pay.ts | 2 +- src/utils/pay.ts | 10 +- 61 files changed, 454 insertions(+), 443 deletions(-) diff --git a/lib/checkers/account.js b/lib/checkers/account.js index 30b4b3db..c774574b 100644 --- a/lib/checkers/account.js +++ b/lib/checkers/account.js @@ -1,4 +1,17 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const checkers = []; +const checkers = [ + { + entity: 'account', + type: 'row', + filter: { + system: { + account$entity: { + "#sqp": 'not in', + }, + }, + }, + action: 'create', + } +]; exports.default = checkers; diff --git a/lib/checkers/accountOper.js b/lib/checkers/accountOper.js index 0098bcde..ea9db261 100644 --- a/lib/checkers/accountOper.js +++ b/lib/checkers/accountOper.js @@ -84,6 +84,12 @@ const checkers = [ } break; } + case 'tax': { + if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) { + throw new types_1.OakInputIllegalException('accountOper', ['totalPlus', 'availPlus'], 'accountOper为tax时,其totalPlus/availPlus必须为负且相等'); + } + break; + } default: { (0, assert_1.default)(false); break; diff --git a/lib/checkers/index.d.ts b/lib/checkers/index.d.ts index d62330c3..ed33463f 100644 --- a/lib/checkers/index.d.ts +++ b/lib/checkers/index.d.ts @@ -1,4 +1,4 @@ -import { EntityDict } from '../oak-app-domain/index'; +import { EntityDict } from '@oak-app-domain'; import { Checker } from 'oak-domain/lib/types'; import { RuntimeCxt } from '../types/RuntimeCxt'; declare const checkers: Checker[]; diff --git a/lib/components/payConfig/system/web.pc.js b/lib/components/payConfig/system/web.pc.js index 0b80a94a..0aa3ac5d 100644 --- a/lib/components/payConfig/system/web.pc.js +++ b/lib/components/payConfig/system/web.pc.js @@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.registerPayChannelComponent = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); -const react_1 = require("react"); const antd_1 = require("antd"); const web_pc_module_less_1 = tslib_1.__importDefault(require("./web.pc.module.less")); const config_1 = tslib_1.__importDefault(require("../../offlineAccount/config")); @@ -15,12 +14,94 @@ function registerPayChannelComponent(entity, component) { PayChannelConfigDict[entity] = component; } exports.registerPayChannelComponent = registerPayChannelComponent; +function PayConfig(props) { + const { payConfig, update, t } = props; + const withdrawLoss = payConfig?.withdrawLoss; + const depositLoss = payConfig?.depositLoss; + const updateDepositLoss = (data) => { + update({ + depositLoss: { + ...depositLoss, + ...data, + }, + withdrawLoss: withdrawLoss || { + conservative: !!(withdrawLoss?.conservative), + }, + }); + }; + const updateWithdrawLoss = (data) => { + update({ + depositLoss: depositLoss || {}, + withdrawLoss: { + conservative: !!(withdrawLoss?.conservative), + ...withdrawLoss, + ...data, + }, + }); + }; + return ((0, jsx_runtime_1.jsxs)(antd_1.Flex, { gap: "middle", children: [(0, jsx_runtime_1.jsx)(antd_1.Card, { title: t('payConfig.label.depositLoss'), extra: (0, jsx_runtime_1.jsx)(antd_1.Popover, { content: t("payConfig.help.depositLoss"), children: (0, jsx_runtime_1.jsx)("span", { className: web_pc_module_less_1.default.help, children: t("help") }) }), children: (0, jsx_runtime_1.jsxs)(antd_1.Form, { labelCol: { span: 8 }, wrapperCol: { span: 18 }, layout: "horizontal", style: { width: '100%' }, children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.ratio'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { value: depositLoss?.ratio, max: 20, min: 0.01, addonAfter: "%", step: 0.01, precision: 2, onChange: (value) => { + const ratio = value; + updateDepositLoss({ + ratio: ratio || 0 + }); + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.highest'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { value: depositLoss?.highest, min: 0, step: 1, onChange: (value) => { + const highest = value; + updateDepositLoss({ + highest: highest || undefined + }); + return; + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.lowest'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { value: depositLoss?.lowest, min: 0, step: 1, onChange: (value) => { + const lowest = value; + updateDepositLoss({ + lowest: lowest || undefined + }); + return; + } }) })] }) }), (0, jsx_runtime_1.jsx)(antd_1.Card, { title: t('payConfig.label.withdrawLoss'), extra: (0, jsx_runtime_1.jsx)(antd_1.Popover, { content: t('payConfig.help.withdrawLoss'), children: (0, jsx_runtime_1.jsx)("span", { className: web_pc_module_less_1.default.help, children: t("help") }) }), children: (0, jsx_runtime_1.jsxs)(antd_1.Form, { labelCol: { span: 8 }, wrapperCol: { span: 18 }, layout: "horizontal", style: { width: '100%' }, children: [(0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.conservative'), children: (0, jsx_runtime_1.jsx)(antd_1.Switch, { value: withdrawLoss?.conservative, onChange: (conservative) => { + updateWithdrawLoss({ conservative }); + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.ratio'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { disabled: !!withdrawLoss?.conservative, value: withdrawLoss?.ratio, max: 20, min: 0.01, addonAfter: "%", step: 0.01, precision: 2, onChange: (value) => { + const ratio = value; + updateWithdrawLoss({ + ratio: ratio || 0 + }); + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.highest'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { disabled: !!withdrawLoss?.conservative, value: withdrawLoss?.highest, min: 0, step: 1, onChange: (value) => { + const highest = value; + updateWithdrawLoss({ + highest: highest || undefined + }); + return; + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.lowest'), children: (0, jsx_runtime_1.jsx)(antd_1.InputNumber, { disabled: !!withdrawLoss?.conservative, value: withdrawLoss?.lowest, min: 0, step: 1, onChange: (value) => { + const lowest = value; + updateWithdrawLoss({ + lowest: lowest || undefined + }); + return; + } }) }), (0, jsx_runtime_1.jsx)(antd_1.Form.Item, { label: t('payConfig.label.trim'), children: (0, jsx_runtime_1.jsx)(antd_1.Radio.Group, { disabled: !!withdrawLoss?.conservative, options: [ + { + label: t('payConfig.label.jiao'), + value: 'jiao', + }, + { + label: t('payConfig.label.yuan'), + value: 'yuan', + }, + { + label: t('payConfig.label.null'), + value: '', + } + ], value: withdrawLoss?.trim, onChange: ({ target }) => updateWithdrawLoss({ + trim: target.value, + }) }) })] }) })] })); +} function render(props) { const { system, oakFullpath, operation, oakDirty, serverUrl, oakExecutable } = props.data; - const { t, update, setMessage, execute } = props.methods; - const [key, setKey] = (0, react_1.useState)(''); + const { t, update, clean, execute } = props.methods; if (system && oakFullpath) { return ((0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.container, children: (0, jsx_runtime_1.jsx)(antd_1.Tabs, { className: web_pc_module_less_1.default.tabs, tabPosition: "left", items: [ + { + label: ((0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.systemLabel, children: t('system') })), + key: 'system', + children: ((0, jsx_runtime_1.jsxs)(antd_1.Flex, { vertical: true, children: [(0, jsx_runtime_1.jsx)(PayConfig, { payConfig: system.payConfig, update: (payConfig) => update({ payConfig }), t: t }), (0, jsx_runtime_1.jsxs)(antd_1.Flex, { gap: "middle", justify: 'end', children: [(0, jsx_runtime_1.jsx)(antd_1.Button, { type: "primary", disabled: oakExecutable !== true, onClick: () => execute(), children: t('common::confirm') }), (0, jsx_runtime_1.jsx)(antd_1.Button, { disabled: !oakDirty, onClick: () => clean(), children: t('common::reset') })] })] })), + }, { label: ((0, jsx_runtime_1.jsx)("div", { className: web_pc_module_less_1.default.systemLabel, children: t('offlineAccount:name') })), key: 'offlineAccount', diff --git a/lib/components/wpAccount/config/index.js b/lib/components/wpAccount/config/index.js index 5cc1691a..8a4d3e54 100644 --- a/lib/components/wpAccount/config/index.js +++ b/lib/components/wpAccount/config/index.js @@ -8,9 +8,7 @@ exports.default = OakComponent({ price: 1, mchId: 1, refundGapDays: 1, - refundLossRatio: 1, - refundLossFloor: 1, - taxlossRatio: 1, + taxLossRatio: 1, enabled: 1, }, formData({ data, legalActions }) { diff --git a/lib/configuration/attrUpdateMatrix.js b/lib/configuration/attrUpdateMatrix.js index 078dcd90..593f90cb 100644 --- a/lib/configuration/attrUpdateMatrix.js +++ b/lib/configuration/attrUpdateMatrix.js @@ -110,12 +110,18 @@ const attrUpdateMatrix = { enabled: { actions: ['update'], }, - taxlossRatio: { + taxLossRatio: { actions: ['update'], }, depositLossRatio: { actions: ['update'], }, + refundCompensateRatio: { + actions: ['update'], + }, + refundGapDays: { + actions: ['update'], + }, price: { actions: ['pay', 'refund', 'deposit', 'withdraw', 'tax'], }, @@ -136,7 +142,7 @@ const attrUpdateMatrix = { wechatPay: { actions: ['update'], }, - taxlossRatio: { + taxLossRatio: { actions: ['update'], }, depositLossRatio: { diff --git a/lib/data/i18n.js b/lib/data/i18n.js index 06ca9470..daa8d136 100644 --- a/lib/data/i18n.js +++ b/lib/data/i18n.js @@ -117,8 +117,9 @@ const i18ns = [ "shouqianba": "请将二维码解析后的字符串填入", "others": "请将二维码解析后的字符串填入" }, - "taxlossRatio": "渠道收款时收取的手续费百分比,0.6代表千分之六", - "depositLossRatio": "充值时收取的手续费百分比,0.6代表千分之六" + "taxLossRatio": "渠道收款时收取的手续费百分比,0.6代表千分之六", + "refundGapDays": "超过这个天数后将无法退款", + "refundCompensateRatio": "渠道退款时,返回的手续费比例(50代表渠道将返回当时收取的手续费的一半)" }, "help": { "allowDeposit": "是否允许用户在系统中主动向此账号发起充值", @@ -231,9 +232,26 @@ const i18ns = [ module: "oak-pay-business", position: "src/components/payConfig/system", data: { - "system": "系统配置", - "appsBelow": "以下为application", - "mayLossUpdate": "%{name}上的更新可能会丢失,请尽快保存" + "system": "系统相关配置", + "help": "说明", + "payConfig": { + "label": { + "depositLoss": "充值手续费", + "withdrawLoss": "提现手续费", + "conservative": "保守策略", + "ratio": "按比例", + "lowest": "最低(分)", + "highest": "最高(分)", + "trim": "去尾", + "jiao": "角", + "yuan": "元", + "null": "不去尾" + }, + "help": { + "depositLoss": "若不配置手续费,用户充值时渠道的手续费损失将被计算到system关联的账户之中", + "withdrawLoss": "若配置为保守策略,系统将自动计算渠道的损耗,在system账户不贴现的前提下让用户可提现的额度最大化" + } + } } }, { @@ -474,14 +492,13 @@ const i18ns = [ "placeholder": { "privateKeyFilePath": "服务器上存放apiclient_key.pem的路径,注意访问权限", "publicKeyFilePath": "服务器上存放apiclient_cert.pem的路径,注意访问权限", - "taxlossRatio": "微信支付收取的手续费百分比,一般为0.6(代表千分之六)", + "taxLossRatio": "微信支付收取的手续费百分比,一般为0.6(代表千分之六)", + "refundCompensateRatio": "渠道退款时,返回的手续费比例(50代表渠道将返回当时收取的手续费的一半)", "depositLossRatio": "充值收取的手续费百分比,一般为0.6(代表千分之六)", "payNotifyUrl": "endpoint", "refundNotifyUrl": "endpoint", "apiV3Key": "需要登录商户后台获取", - "refundGapDays": "超过这个天数后无法退款", - "refundLossRatio": "退款时将按这个百分比扣除损耗(0.6就代表千分之六)", - "refundLossFloor": "退款时按位向下取整(如按元取整,则忽略角位和分位)" + "refundGapDays": "超过这个天数后无法退款" }, "wechatPayIsShared": "以上配置是全局的,请谨慎修改" } @@ -508,7 +525,7 @@ const i18ns = [ position: "src/components/wpProduct/upsert", data: { "placeholder": { - "taxlossRatio": "如果配置了产品的手续费,则覆盖微信支付账号上配置的手续费" + "taxLossRatio": "如果配置了产品的手续费,则覆盖微信支付账号上配置的手续费" } } }, @@ -578,7 +595,9 @@ const i18ns = [ }, "deposit": { "lossReason": { - "ratio": "按百分比%{value}%扣除" + "ratio": "按百分比%{value}%扣除", + "highest": "按单笔充值最高手续费%{value}扣除", + "lowest": "按单笔充值最低手续费%{value}扣除" } } } diff --git a/lib/entities/AbstractAccount.d.ts b/lib/entities/AbstractAccount.d.ts index b49c58f3..b2e6cf56 100644 --- a/lib/entities/AbstractAccount.d.ts +++ b/lib/entities/AbstractAccount.d.ts @@ -2,13 +2,9 @@ import { Int, Decimal } from 'oak-domain/lib/types/DataType'; import { EntityShape } from 'oak-domain/lib/types/Entity'; import { EntityDesc } from 'oak-domain/lib/types'; export interface Schema extends EntityShape { - taxlossRatio: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2>; + taxLossRatio: Decimal<4, 2>; refundGapDays?: Int<4>; - refundLossRatio?: Decimal<4, 2>; - refundLossFloor?: 'yuan' | 'jiao'; + refundCompensateRatio?: Int<4>; } export type Action = 'pay' | 'refund' | 'deposit' | 'withdraw' | 'tax'; -export declare const entityDesc: EntityDesc; -}>; +export declare const entityDesc: EntityDesc; diff --git a/lib/entities/AbstractAccount.js b/lib/entities/AbstractAccount.js index 93e0827b..ea8e58c0 100644 --- a/lib/entities/AbstractAccount.js +++ b/lib/entities/AbstractAccount.js @@ -7,17 +7,9 @@ exports.entityDesc = { zh_CN: { name: '抽象支付帐号', attr: { - taxlossRatio: '渠道手续费(百分比)', - depositLossRatio: '充值损耗百分比', + taxLossRatio: '渠道手续费(百分比)', refundGapDays: '(支付后)允许退款的天数', - refundLossRatio: '退款损耗百分比', - refundLossFloor: '退款向下取整位数', - }, - v: { - refundLossFloor: { - yuan: '元', - jiao: '角' - }, + refundCompensateRatio: '退款补偿百分比', }, action: { pay: '支付', @@ -29,12 +21,6 @@ exports.entityDesc = { }, }, style: { - color: { - refundLossFloor: { - yuan: '#FFFF00', - jiao: '#00FF00' - } - }, icon: { pay: '', refund: '', diff --git a/lib/entities/AccountOper.d.ts b/lib/entities/AccountOper.d.ts index f3ff56a9..0ce10c15 100644 --- a/lib/entities/AccountOper.d.ts +++ b/lib/entities/AccountOper.d.ts @@ -2,7 +2,7 @@ import { String, Price } from 'oak-domain/lib/types/DataType'; import { EntityShape } from 'oak-domain/lib/types/Entity'; import { EntityDesc } from 'oak-domain/lib/types'; import { Schema as Account } from './Account'; -type Type = 'deposit' | 'withdraw' | 'consume' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | 'encash' | 'cutoffRefundable'; +type Type = 'deposit' | 'withdraw' | 'consume' | 'loan' | 'repay' | 'withdrawBack' | 'earn' | 'encash' | 'cutoffRefundable' | 'tax'; export interface Schema extends EntityShape { account: Account; type: Type; diff --git a/lib/entities/AccountOper.js b/lib/entities/AccountOper.js index b8f4e46e..f42eea47 100644 --- a/lib/entities/AccountOper.js +++ b/lib/entities/AccountOper.js @@ -25,6 +25,7 @@ exports.entityDesc = { withdrawBack: '提现失败', earn: '赚取', encash: '兑现', + tax: '渠道费', cutoffRefundable: '削减可自由退额度' }, }, @@ -41,6 +42,7 @@ exports.entityDesc = { repay: '#82E0AA', earn: '#FF3333', encash: '#FF3399', + tax: '#A569BD', cutoffRefundable: '#2E4053', } } diff --git a/lib/entities/OfflineAccount.d.ts b/lib/entities/OfflineAccount.d.ts index 7358ef3e..12d3196c 100644 --- a/lib/entities/OfflineAccount.d.ts +++ b/lib/entities/OfflineAccount.d.ts @@ -1,9 +1,4 @@ -<<<<<<< HEAD import { String, Text, Price, Boolean } from 'oak-domain/lib/types/DataType'; -======= -import { String, Text, Price, Boolean, Decimal } from 'oak-domain/lib/types/DataType'; -import { EntityShape } from 'oak-domain/lib/types/Entity'; ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce import { EntityDesc } from 'oak-domain/lib/types'; import { Schema as System } from './System'; import { Schema as Pay } from './Pay'; @@ -12,8 +7,6 @@ import { Schema as AbstractAccount } from './AbstractAccount'; export interface Schema extends AbstractAccount { type: 'bank' | 'alipay' | 'wechat' | 'shouqianba' | 'others'; channel?: String<32>; - taxlossRatio?: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2>; name?: String<64>; qrCode?: Text; allowDeposit: Boolean; diff --git a/lib/entities/OfflineAccount.js b/lib/entities/OfflineAccount.js index 68d1b9ab..3520ca38 100644 --- a/lib/entities/OfflineAccount.js +++ b/lib/entities/OfflineAccount.js @@ -11,14 +11,9 @@ exports.entityDesc = { channel: '通道', name: '用户/帐号', qrCode: '收款二维码', - taxlossRatio: '商户号手续费(百分比)', - depositLossRatio: '充值损耗百分比', -<<<<<<< HEAD + taxLossRatio: '商户号手续费(百分比)', + refundCompensateRatio: '退款补偿百分比', refundGapDays: '(支付后)允许退款的天数', - refundLossRatio: '退款损耗百分比', - refundLossFloor: '退款向下取整位数', -======= ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce allowDeposit: '允许主动充值', allowPay: '允许主动支付', system: '所属系统', diff --git a/lib/entities/System.d.ts b/lib/entities/System.d.ts index 74758293..4040102c 100644 --- a/lib/entities/System.d.ts +++ b/lib/entities/System.d.ts @@ -2,8 +2,24 @@ import { EntityDesc } from 'oak-domain/lib/types/EntityDesc'; import { Schema as System } from 'oak-general-business/lib/entities/System'; import { Schema as Account } from './Account'; import { Schema as WithdrawAccount } from './WithdrawAccount'; +type PayConfig = { + withdrawLoss: { + conservative: boolean; + ratio?: number; + lowest?: number; + highest?: number; + trim?: "jiao" | "yuan"; + }; + depositLoss: { + ratio?: number; + lowest?: number; + highest?: number; + }; +}; export interface Schema extends System { accounts: Account[]; withdrawAccounts: WithdrawAccount[]; + payConfig?: PayConfig; } export declare const entityDesc: EntityDesc; +export {}; diff --git a/lib/entities/System.js b/lib/entities/System.js index 3a336479..a2192764 100644 --- a/lib/entities/System.js +++ b/lib/entities/System.js @@ -10,6 +10,7 @@ exports.entityDesc = { name: '名称', description: '描述', config: '设置', + payConfig: '支付相关设置', platform: '平台', super: '超级系统', folder: '代码目录名', diff --git a/lib/entities/WpAccount.d.ts b/lib/entities/WpAccount.d.ts index 11f49b7b..3ed8f557 100644 --- a/lib/entities/WpAccount.d.ts +++ b/lib/entities/WpAccount.d.ts @@ -16,6 +16,4 @@ export interface Schema extends AbstractAccount { enabled: Boolean; } export type Action = 'pay' | 'refund' | 'deposit' | 'withdraw' | 'tax'; -export declare const entityDesc: EntityDesc; -}>; +export declare const entityDesc: EntityDesc; diff --git a/lib/entities/WpAccount.js b/lib/entities/WpAccount.js index 4f6aaf9b..56070e92 100644 --- a/lib/entities/WpAccount.js +++ b/lib/entities/WpAccount.js @@ -8,11 +8,9 @@ exports.entityDesc = { name: '微信支付帐号', attr: { wechatPay: '微信支付', - taxlossRatio: '商户号手续费(百分比)', - depositLossRatio: '充值损耗百分比', + taxLossRatio: '商户号手续费(百分比)', + refundCompensateRatio: '退款补偿百分比', refundGapDays: '(支付后)允许退款的天数', - refundLossRatio: '退款损耗百分比', - refundLossFloor: '退款向下取整位数', mchId: '商户号', publicKeyFilePath: '公钥文件路径', privateKeyFilePath: '私钥文件路径', @@ -22,12 +20,6 @@ exports.entityDesc = { opers: '操作记录', enabled: '是否启用', }, - v: { - refundLossFloor: { - yuan: '元', - jiao: '角' - }, - }, action: { pay: '支付', refund: '退款', @@ -38,12 +30,6 @@ exports.entityDesc = { }, }, style: { - color: { - refundLossFloor: { - yuan: '#FFFF00', - jiao: '#00FF00' - } - }, icon: { pay: '', refund: '', diff --git a/lib/entities/WpProduct.d.ts b/lib/entities/WpProduct.d.ts index 770e16ef..439f9c8b 100644 --- a/lib/entities/WpProduct.d.ts +++ b/lib/entities/WpProduct.d.ts @@ -7,7 +7,7 @@ import { Schema as Pay } from './Pay'; export interface Schema extends EntityShape { wpAccount: WpAccount; type: 'native' | 'mp' | 'jsapi' | 'h5' | 'app'; - taxlossRatio?: Decimal<4, 2>; + taxLossRatio?: Decimal<4, 2>; application: Application; enabled: Boolean; pays: Pay[]; diff --git a/lib/entities/WpProduct.js b/lib/entities/WpProduct.js index b10b6be0..9da7056e 100644 --- a/lib/entities/WpProduct.js +++ b/lib/entities/WpProduct.js @@ -11,7 +11,7 @@ exports.entityDesc = { type: '类型', application: '关联应用', enabled: '有效中', - taxlossRatio: '产品手续费(百分比)', + taxLossRatio: '产品手续费(百分比)', pays: '支付', }, v: { diff --git a/lib/features/Pay.js b/lib/features/Pay.js index 333369f8..70b0cf31 100644 --- a/lib/features/Pay.js +++ b/lib/features/Pay.js @@ -52,7 +52,7 @@ class Pay extends oak_frontend_base_1.Feature { } calcDepositLoss(price, channel) { const { entity, entityId } = channel; - return (0, pay_1.getDepositLoss)(price, entity, entityId, this.application.getApplication()); + return (0, pay_1.getDepositLoss)(price, this.application.getApplication()); } getDepositRatio(channel) { throw new Error('method not implemented'); diff --git a/lib/locales/common/zh_CN.json b/lib/locales/common/zh_CN.json index e962f93e..72b70601 100644 --- a/lib/locales/common/zh_CN.json +++ b/lib/locales/common/zh_CN.json @@ -58,7 +58,9 @@ }, "deposit": { "lossReason": { - "ratio": "按百分比%{value}%扣除" + "ratio": "按百分比%{value}%扣除", + "highest": "按单笔充值最高手续费%{value}扣除", + "lowest": "按单笔充值最低手续费%{value}扣除" } } } diff --git a/lib/oak-app-domain/AbstractAccount/Schema.d.ts b/lib/oak-app-domain/AbstractAccount/Schema.d.ts index 5f99b475..9f82a097 100644 --- a/lib/oak-app-domain/AbstractAccount/Schema.d.ts +++ b/lib/oak-app-domain/AbstractAccount/Schema.d.ts @@ -1,22 +1,18 @@ -import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; +import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity"; import { Action, ParticularAction } from "./Action"; import { Decimal, Int } from "oak-domain/lib/types/DataType"; export type OpSchema = EntityShape & { - taxlossRatio: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2> | null; + taxLossRatio: Decimal<4, 2>; refundGapDays?: Int<4> | null; - refundLossRatio?: Decimal<4, 2> | null; - refundLossFloor?: ("yuan" | "jiao") | null; + refundCompensateRatio?: Int<4> | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { - taxlossRatio: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2> | null; + taxLossRatio: Decimal<4, 2>; refundGapDays?: Int<4> | null; - refundLossRatio?: Decimal<4, 2> | null; - refundLossFloor?: ("yuan" | "jiao") | null; + refundCompensateRatio?: Int<4> | null; } & { [A in ExpressionKey]?: any; }; @@ -25,11 +21,9 @@ type AttrFilter = { $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; - taxlossRatio: Q_NumberValue; - depositLossRatio: Q_NumberValue; + taxLossRatio: Q_NumberValue; refundGapDays: Q_NumberValue; - refundLossRatio: Q_NumberValue; - refundLossFloor: Q_EnumValue<"yuan" | "jiao">; + refundCompensateRatio: Q_NumberValue; }; export type Filter = MakeFilter>; export type Projection = { @@ -39,11 +33,9 @@ export type Projection = { $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; - taxlossRatio?: number; - depositLossRatio?: number; + taxLossRatio?: number; refundGapDays?: number; - refundLossRatio?: number; - refundLossFloor?: number; + refundCompensateRatio?: number; } & Partial>; type AbstractAccountIdProjection = OneOf<{ id: number; @@ -57,15 +49,11 @@ export type SortAttr = { } | { $$updateAt$$: number; } | { - taxlossRatio: number; -} | { - depositLossRatio: number; + taxLossRatio: number; } | { refundGapDays: number; } | { - refundLossRatio: number; -} | { - refundLossFloor: number; + refundCompensateRatio: number; } | { [k: string]: any; } | OneOf>; diff --git a/lib/oak-app-domain/AbstractAccount/Storage.js b/lib/oak-app-domain/AbstractAccount/Storage.js index 43a49be0..fdcdb439 100644 --- a/lib/oak-app-domain/AbstractAccount/Storage.js +++ b/lib/oak-app-domain/AbstractAccount/Storage.js @@ -4,7 +4,7 @@ exports.desc = void 0; const Action_1 = require("./Action"); exports.desc = { attributes: { - taxlossRatio: { + taxLossRatio: { notNull: true, type: "decimal", params: { @@ -12,13 +12,6 @@ exports.desc = { scale: 2 } }, - depositLossRatio: { - type: "decimal", - params: { - precision: 4, - scale: 2 - } - }, refundGapDays: { type: "int", params: { @@ -26,16 +19,12 @@ exports.desc = { signed: true } }, - refundLossRatio: { - type: "decimal", + refundCompensateRatio: { + type: "int", params: { - precision: 4, - scale: 2 + width: 4, + signed: true } - }, - refundLossFloor: { - type: "enum", - enumeration: ["yuan", "jiao"] } }, actionType: "crud", diff --git a/lib/oak-app-domain/AbstractAccount/Style.js b/lib/oak-app-domain/AbstractAccount/Style.js index 901a2d27..30ac9ea7 100644 --- a/lib/oak-app-domain/AbstractAccount/Style.js +++ b/lib/oak-app-domain/AbstractAccount/Style.js @@ -2,12 +2,6 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.style = void 0; exports.style = { - color: { - refundLossFloor: { - yuan: '#FFFF00', - jiao: '#00FF00' - } - }, icon: { pay: '', refund: '', diff --git a/lib/oak-app-domain/AbstractAccount/locales/zh_CN.json b/lib/oak-app-domain/AbstractAccount/locales/zh_CN.json index 60ab0437..389c61ec 100644 --- a/lib/oak-app-domain/AbstractAccount/locales/zh_CN.json +++ b/lib/oak-app-domain/AbstractAccount/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "抽象支付帐号", "attr": { "taxlossRatio": "渠道手续费(百分比)", "depositLossRatio": "充值损耗百分比", "refundGapDays": "(支付后)允许退款的天数", "refundLossRatio": "退款损耗百分比", "refundLossFloor": "退款向下取整位数" }, "v": { "refundLossFloor": { "yuan": "元", "jiao": "角" } }, "action": { "pay": "支付", "refund": "退款", "deposit": "充值", "withdraw": "提现", "tax": "渠道费" } } +{ "name": "抽象支付帐号", "attr": { "taxLossRatio": "渠道手续费(百分比)", "refundGapDays": "(支付后)允许退款的天数", "refundCompensateRatio": "退款补偿百分比" }, "action": { "pay": "支付", "refund": "退款", "deposit": "充值", "withdraw": "提现", "tax": "渠道费" } } diff --git a/lib/oak-app-domain/Account/Schema.d.ts b/lib/oak-app-domain/Account/Schema.d.ts index 508e957b..e62d1b0b 100644 --- a/lib/oak-app-domain/Account/Schema.d.ts +++ b/lib/oak-app-domain/Account/Schema.d.ts @@ -155,7 +155,6 @@ export type Sorter = SortNode[]; export type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export type Selection

= SelectOperation

; export type Aggregation = DeduceAggregation; -<<<<<<< HEAD export type CreateOperationData = FormCreateData> & (({ ofSystemId?: never; ofSystem: System.CreateSingleOperation; @@ -166,9 +165,6 @@ export type CreateOperationData = FormCreateData; })) & ({ -======= -export type CreateOperationData = FormCreateData> & ({ ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce entity?: never; entityId?: never; system: System.CreateSingleOperation; @@ -205,7 +201,6 @@ export type CreateOperationData = FormCreateData; export type CreateMultipleOperation = OakOperation<"create", Array>; export type CreateOperation = CreateSingleOperation | CreateMultipleOperation; -<<<<<<< HEAD export type UpdateOperationData = FormUpdateData> & (({ ofSystem?: System.CreateSingleOperation; ofSystemId?: never; @@ -223,13 +218,6 @@ export type UpdateOperationData = FormUpdateData> & ({ - system?: System.CreateSingleOperation | System.UpdateOperation | System.RemoveOperation; - entityId?: never; - entity?: never; -} | { ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation; entityId?: never; entity?: never; @@ -246,13 +234,9 @@ export type UpdateOperationData = FormUpdateData, Omit> | OakOperation, Omit> | OakOperation<"create", Omit[]> | Array> | OakOperation, Omit> | OakOperation, Omit>>; }; export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>; -<<<<<<< HEAD export type RemoveOperationData = {} & (({ ofSystem?: System.UpdateOperation | System.RemoveOperation; })) & ({ -======= -export type RemoveOperationData = {} & ({ ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce system?: System.UpdateOperation | System.RemoveOperation; } | { user?: User.UpdateOperation | User.RemoveOperation; diff --git a/lib/oak-app-domain/AccountOper/Schema.d.ts b/lib/oak-app-domain/AccountOper/Schema.d.ts index 9800718c..60132bea 100644 --- a/lib/oak-app-domain/AccountOper/Schema.d.ts +++ b/lib/oak-app-domain/AccountOper/Schema.d.ts @@ -8,7 +8,7 @@ import * as Account from "../Account/Schema"; import * as Deposit from "../Deposit/Schema"; import * as Pay from "../Pay/Schema"; import * as Withdraw from "../Withdraw/Schema"; -type Type = "deposit" | "withdraw" | "consume" | "loan" | "repay" | "withdrawBack" | "earn" | "encash" | "cutoffRefundable"; +type Type = "deposit" | "withdraw" | "consume" | "loan" | "repay" | "withdrawBack" | "earn" | "encash" | "cutoffRefundable" | "tax"; export type OpSchema = EntityShape & { accountId: ForeignKey<"account">; type: Type; diff --git a/lib/oak-app-domain/AccountOper/Storage.js b/lib/oak-app-domain/AccountOper/Storage.js index 212a87aa..4a32f824 100644 --- a/lib/oak-app-domain/AccountOper/Storage.js +++ b/lib/oak-app-domain/AccountOper/Storage.js @@ -12,7 +12,7 @@ exports.desc = { type: { notNull: true, type: "enum", - enumeration: ["deposit", "withdraw", "consume", "loan", "repay", "withdrawBack", "earn", "encash", "cutoffRefundable"] + enumeration: ["deposit", "withdraw", "consume", "loan", "repay", "withdrawBack", "earn", "encash", "cutoffRefundable", "tax"] }, totalPlus: { notNull: true, diff --git a/lib/oak-app-domain/AccountOper/Style.js b/lib/oak-app-domain/AccountOper/Style.js index fcf263b8..8f962b9c 100644 --- a/lib/oak-app-domain/AccountOper/Style.js +++ b/lib/oak-app-domain/AccountOper/Style.js @@ -12,6 +12,7 @@ exports.style = { repay: '#82E0AA', earn: '#FF3333', encash: '#FF3399', + tax: '#A569BD', cutoffRefundable: '#2E4053', } } diff --git a/lib/oak-app-domain/AccountOper/locales/zh_CN.json b/lib/oak-app-domain/AccountOper/locales/zh_CN.json index 260608e0..cef44ded 100644 --- a/lib/oak-app-domain/AccountOper/locales/zh_CN.json +++ b/lib/oak-app-domain/AccountOper/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "帐号操作", "attr": { "account": "帐号", "type": "类型", "totalPlus": "余额变化", "availPlus": "可用余额变化", "refundablePlus": "可退款余额变化", "entity": "关联对象", "entityId": "关联对象Id" }, "v": { "type": { "deposit": "充值", "withdraw": "提现", "consume": "消费", "loan": "抵押", "repay": "偿还", "withdrawBack": "提现失败", "earn": "赚取", "encash": "兑现", "cutoffRefundable": "削减可自由退额度" } } } +{ "name": "帐号操作", "attr": { "account": "帐号", "type": "类型", "totalPlus": "余额变化", "availPlus": "可用余额变化", "refundablePlus": "可退款余额变化", "entity": "关联对象", "entityId": "关联对象Id" }, "v": { "type": { "deposit": "充值", "withdraw": "提现", "consume": "消费", "loan": "抵押", "repay": "偿还", "withdrawBack": "提现失败", "earn": "赚取", "encash": "兑现", "tax": "渠道费", "cutoffRefundable": "削减可自由退额度" } } } diff --git a/lib/oak-app-domain/OfflineAccount/Schema.d.ts b/lib/oak-app-domain/OfflineAccount/Schema.d.ts index 95475b64..e1885489 100644 --- a/lib/oak-app-domain/OfflineAccount/Schema.d.ts +++ b/lib/oak-app-domain/OfflineAccount/Schema.d.ts @@ -3,24 +3,16 @@ import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, import { OneOf } from "oak-domain/lib/types/Polyfill"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity"; import { Action, ParticularAction } from "./Action"; -<<<<<<< HEAD import { Decimal, Int, String, Text, Boolean, Price } from "oak-domain/lib/types/DataType"; -======= -import { String, Decimal, Text, Boolean, Price } from "oak-domain/lib/types/DataType"; ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce import * as System from "../System/Schema"; import * as Pay from "../Pay/Schema"; import * as SysAccountOper from "../SysAccountOper/Schema"; export type OpSchema = EntityShape & { - taxlossRatio: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2> | null; + taxLossRatio: Decimal<4, 2>; refundGapDays?: Int<4> | null; - refundLossRatio?: Decimal<4, 2> | null; - refundLossFloor?: ("yuan" | "jiao") | null; + refundCompensateRatio?: Int<4> | null; type: "bank" | "alipay" | "wechat" | "shouqianba" | "others"; channel?: String<32> | null; - taxlossRatio?: Decimal<4, 2> | null; - depositLossRatio?: Decimal<4, 2> | null; name?: String<64> | null; qrCode?: Text | null; allowDeposit: Boolean; @@ -31,15 +23,11 @@ export type OpSchema = EntityShape & { }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { - taxlossRatio: Decimal<4, 2>; - depositLossRatio?: Decimal<4, 2> | null; + taxLossRatio: Decimal<4, 2>; refundGapDays?: Int<4> | null; - refundLossRatio?: Decimal<4, 2> | null; - refundLossFloor?: ("yuan" | "jiao") | null; + refundCompensateRatio?: Int<4> | null; type: "bank" | "alipay" | "wechat" | "shouqianba" | "others"; channel?: String<32> | null; - taxlossRatio?: Decimal<4, 2> | null; - depositLossRatio?: Decimal<4, 2> | null; name?: String<64> | null; qrCode?: Text | null; allowDeposit: Boolean; @@ -60,15 +48,11 @@ type AttrFilter = { $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; - taxlossRatio: Q_NumberValue; - depositLossRatio: Q_NumberValue; + taxLossRatio: Q_NumberValue; refundGapDays: Q_NumberValue; - refundLossRatio: Q_NumberValue; - refundLossFloor: Q_EnumValue<"yuan" | "jiao">; + refundCompensateRatio: Q_NumberValue; type: Q_EnumValue<"bank" | "alipay" | "wechat" | "shouqianba" | "others">; channel: Q_StringValue; - taxlossRatio: Q_NumberValue; - depositLossRatio: Q_NumberValue; name: Q_StringValue; qrCode: Q_StringValue; allowDeposit: Q_BooleanValue; @@ -88,15 +72,11 @@ export type Projection = { $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; - taxlossRatio?: number; - depositLossRatio?: number; + taxLossRatio?: number; refundGapDays?: number; - refundLossRatio?: number; - refundLossFloor?: number; + refundCompensateRatio?: number; type?: number; channel?: number; - taxlossRatio?: number; - depositLossRatio?: number; name?: number; qrCode?: number; allowDeposit?: number; @@ -133,23 +113,15 @@ export type SortAttr = { } | { $$updateAt$$: number; } | { - taxlossRatio: number; -} | { - depositLossRatio: number; + taxLossRatio: number; } | { refundGapDays: number; } | { - refundLossRatio: number; -} | { - refundLossFloor: number; + refundCompensateRatio: number; } | { type: number; } | { channel: number; -} | { - taxlossRatio: number; -} | { - depositLossRatio: number; } | { name: number; } | { diff --git a/lib/oak-app-domain/OfflineAccount/Storage.js b/lib/oak-app-domain/OfflineAccount/Storage.js index 893c54b8..aa9d66a7 100644 --- a/lib/oak-app-domain/OfflineAccount/Storage.js +++ b/lib/oak-app-domain/OfflineAccount/Storage.js @@ -4,7 +4,7 @@ exports.desc = void 0; const Action_1 = require("./Action"); exports.desc = { attributes: { - taxlossRatio: { + taxLossRatio: { notNull: true, type: "decimal", params: { @@ -12,13 +12,6 @@ exports.desc = { scale: 2 } }, - depositLossRatio: { - type: "decimal", - params: { - precision: 4, - scale: 2 - } - }, refundGapDays: { type: "int", params: { @@ -26,17 +19,13 @@ exports.desc = { signed: true } }, - refundLossRatio: { - type: "decimal", + refundCompensateRatio: { + type: "int", params: { - precision: 4, - scale: 2 + width: 4, + signed: true } }, - refundLossFloor: { - type: "enum", - enumeration: ["yuan", "jiao"] - }, type: { notNull: true, type: "enum", @@ -48,20 +37,6 @@ exports.desc = { length: 32 } }, - taxlossRatio: { - type: "decimal", - params: { - precision: 4, - scale: 2 - } - }, - depositLossRatio: { - type: "decimal", - params: { - precision: 4, - scale: 2 - } - }, name: { type: "varchar", params: { diff --git a/lib/oak-app-domain/OfflineAccount/locales/zh_CN.json b/lib/oak-app-domain/OfflineAccount/locales/zh_CN.json index 3e8e412f..8ce0a7cb 100644 --- a/lib/oak-app-domain/OfflineAccount/locales/zh_CN.json +++ b/lib/oak-app-domain/OfflineAccount/locales/zh_CN.json @@ -1,5 +1 @@ -<<<<<<< HEAD -{ "name": "线下账户", "attr": { "type": "类型", "channel": "通道", "name": "用户/帐号", "qrCode": "收款二维码", "taxlossRatio": "商户号手续费(百分比)", "depositLossRatio": "充值损耗百分比", "refundGapDays": "(支付后)允许退款的天数", "refundLossRatio": "退款损耗百分比", "refundLossFloor": "退款向下取整位数", "allowDeposit": "允许主动充值", "allowPay": "允许主动支付", "system": "所属系统", "price": "余额", "pays": "支付", "opers": "操作记录", "enabled": "是否启用" }, "v": { "type": { "bank": "银行", "alipay": "支付宝", "wechat": "微信", "shouqianba": "收钱吧", "others": "其它" } }, "action": { "pay": "支付", "refund": "退款", "deposit": "充值", "withdraw": "提现", "tax": "渠道费" } } -======= -{ "name": "线下账户", "attr": { "type": "类型", "channel": "通道", "name": "用户/帐号", "qrCode": "收款二维码", "taxlossRatio": "商户号手续费(百分比)", "depositLossRatio": "充值损耗百分比", "allowDeposit": "允许主动充值", "allowPay": "允许主动支付", "system": "所属系统", "price": "余额", "pays": "支付", "opers": "操作记录", "enabled": "是否启用" }, "v": { "type": { "bank": "银行", "alipay": "支付宝", "wechat": "微信", "shouqianba": "收钱吧", "others": "其它" } }, "action": { "pay": "支付", "refund": "退款", "deposit": "充值", "withdraw": "提现", "tax": "渠道费" } } ->>>>>>> 99d2876ae88266ffcff6aa944c537941daeab7ce +{ "name": "线下账户", "attr": { "type": "类型", "channel": "通道", "name": "用户/帐号", "qrCode": "收款二维码", "taxLossRatio": "商户号手续费(百分比)", "refundCompensateRatio": "退款补偿百分比", "refundGapDays": "(支付后)允许退款的天数", "allowDeposit": "允许主动充值", "allowPay": "允许主动支付", "system": "所属系统", "price": "余额", "pays": "支付", "opers": "操作记录", "enabled": "是否启用" }, "v": { "type": { "bank": "银行", "alipay": "支付宝", "wechat": "微信", "shouqianba": "收钱吧", "others": "其它" } }, "action": { "pay": "支付", "refund": "退款", "deposit": "充值", "withdraw": "提现", "tax": "渠道费" } } diff --git a/lib/oak-app-domain/System/Schema.d.ts b/lib/oak-app-domain/System/Schema.d.ts index 7122ee83..8bd0a46e 100644 --- a/lib/oak-app-domain/System/Schema.d.ts +++ b/lib/oak-app-domain/System/Schema.d.ts @@ -18,6 +18,20 @@ import * as WechatPay from "../WechatPay/Schema"; import * as WithdrawAccount from "../WithdrawAccount/Schema"; import * as WithdrawChannel from "../WithdrawChannel/Schema"; import * as WpAccount from "../WpAccount/Schema"; +type PayConfig = { + withdrawLoss: { + conservative: boolean; + ratio?: number; + lowest?: number; + highest?: number; + trim?: "jiao" | "yuan"; + }; + depositLoss: { + ratio?: number; + lowest?: number; + highest?: number; + }; +}; export type OpSchema = EntityShape & { name: String<32>; description: Text; @@ -28,6 +42,7 @@ export type OpSchema = EntityShape & { style?: Style | null; entity?: String<32> | null; entityId?: String<64> | null; + payConfig?: PayConfig | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { @@ -40,6 +55,7 @@ export type Schema = EntityShape & { style?: Style | null; entity?: String<32> | null; entityId?: String<64> | null; + payConfig?: PayConfig | null; platform?: Platform.Schema | null; application$system?: Array; application$system$$aggr?: AggregationResult; @@ -85,6 +101,7 @@ type AttrFilter = { style: JsonFilter