退款报错提示
This commit is contained in:
parent
645790d8ec
commit
0bc19ab8df
|
|
@ -3,7 +3,7 @@ export declare function getWithdrawCreateData(params: {
|
|||
accountId: string;
|
||||
price: number;
|
||||
withdrawAccountId?: string;
|
||||
}, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
}, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
accountId: string;
|
||||
|
|
@ -17,7 +17,7 @@ export declare function getWithdrawCreateData(params: {
|
|||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
accountId: string;
|
||||
|
|
@ -31,7 +31,7 @@ export declare function getWithdrawCreateData(params: {
|
|||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
account?: undefined;
|
||||
|
|
@ -45,7 +45,7 @@ export declare function getWithdrawCreateData(params: {
|
|||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "creatorId" | "accountId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
account?: undefined;
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ const checkers = [
|
|||
},
|
||||
},
|
||||
action: 'create',
|
||||
errMsg: 'error::refund.create.hasAnotherRefunding',
|
||||
},
|
||||
{
|
||||
entity: 'refund',
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<Enti
|
|||
rowSelection?: any;
|
||||
hideHeader?: boolean | undefined;
|
||||
disableSerialNumber?: boolean | undefined;
|
||||
size?: "large" | "middle" | "small" | undefined;
|
||||
size?: "small" | "middle" | "large" | undefined;
|
||||
scroll?: any;
|
||||
locale?: any;
|
||||
opWidth?: number | undefined;
|
||||
|
|
@ -41,7 +41,7 @@ declare const ListPro: <T extends keyof EntityDict>(props: {
|
|||
tablePagination?: any;
|
||||
rowSelection?: any;
|
||||
disableSerialNumber?: boolean | undefined;
|
||||
size?: "large" | "middle" | "small" | undefined;
|
||||
size?: "small" | "middle" | "large" | undefined;
|
||||
scroll?: any;
|
||||
locale?: any;
|
||||
opWidth?: number | undefined;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -753,6 +753,11 @@ const i18ns = [
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,5 +16,10 @@
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ export const desc = {
|
|||
: {
|
||||
type: "object"
|
||||
},
|
||||
entity // 如果为true,则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio,则全额退款)
|
||||
: {
|
||||
entity: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
|
|
|
|||
|
|
@ -24,6 +24,9 @@ async function startRefunding(context, data) {
|
|||
settled: 1,
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
id: data.payId,
|
||||
}
|
||||
}, { dontCollect: true });
|
||||
const { paid, refunded, deposit, order } = pay;
|
||||
assert(paid - refunded >= data.price);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ import { BRC } from '../types/RuntimeCxt';
|
|||
* @param context
|
||||
* @param refunds
|
||||
*/
|
||||
export declare function updateWithdrawState(context: BRC, id: string): Promise<0 | 1>;
|
||||
export declare function updateWithdrawState(context: BRC, id: string): Promise<1 | 0>;
|
||||
declare const triggers: Trigger<EntityDict, 'withdraw', BRC>[];
|
||||
export default triggers;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ const checkers = [
|
|||
},
|
||||
},
|
||||
action: 'create',
|
||||
errMsg: 'error::refund.create.hasAnotherRefunding',
|
||||
},
|
||||
{
|
||||
entity: 'refund',
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -755,6 +755,11 @@ const i18ns = [
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,5 +16,10 @@
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ exports.desc = {
|
|||
: {
|
||||
type: "object"
|
||||
},
|
||||
entity // 如果为true,则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio,则全额退款)
|
||||
: {
|
||||
entity: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ async function startRefunding(context, data) {
|
|||
settled: 1,
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
id: data.payId,
|
||||
}
|
||||
}, { dontCollect: true });
|
||||
const { paid, refunded, deposit, order } = pay;
|
||||
(0, assert_1.default)(paid - refunded >= data.price);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ const checkers: Checker<EntityDict, 'refund', RuntimeCxt>[] = [
|
|||
},
|
||||
},
|
||||
action: 'create',
|
||||
errMsg: 'error::refund.create.hasAnotherRefunding',
|
||||
},
|
||||
{
|
||||
entity: 'refund',
|
||||
|
|
|
|||
|
|
@ -755,6 +755,11 @@ const i18ns: I18n[] = [
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,5 +16,10 @@
|
|||
"order": {
|
||||
"payAmountNotEnough": "支付的额度总和不足",
|
||||
"nonePay": "没有传入支付信息"
|
||||
},
|
||||
"refund": {
|
||||
"create": {
|
||||
"hasAnotherRefunding": "您有一笔退款正在进行中"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -30,6 +30,9 @@ async function startRefunding(context: BRC, data: EntityDict['refund']['CreateSi
|
|||
settled: 1,
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
id: data.payId,
|
||||
}
|
||||
}, { dontCollect: true });
|
||||
|
||||
const { paid, refunded, deposit, order } = pay;
|
||||
|
|
@ -43,7 +46,7 @@ async function startRefunding(context: BRC, data: EntityDict['refund']['CreateSi
|
|||
if (order.settled) {
|
||||
// 如果已经分账,退款的钱要有明确的来源account
|
||||
const { accountOper$entity: opers } = data;
|
||||
|
||||
|
||||
assert(opers && opers instanceof Array, '订单退款一定要有相应的account来源');
|
||||
let amount = 0;
|
||||
opers.forEach(
|
||||
|
|
@ -340,7 +343,7 @@ const triggers: Trigger<EntityDict, 'refund', BRC>[] = [
|
|||
id: ids[0],
|
||||
},
|
||||
}, {});
|
||||
|
||||
|
||||
const { id, price, pay } = refund;
|
||||
const { price: payPrice, refunded, entity, entityId, applicationId } = pay!;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue