受发货限制的deposit在pay完成支付后创建ship并调用小程序接口(未测试)
This commit is contained in:
parent
872729030a
commit
98adc30b27
|
|
@ -6,4 +6,8 @@ export type AspectDict<ED extends EntityDict> = {
|
|||
price: number;
|
||||
withdrawAccountId?: string;
|
||||
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['withdraw']['CreateSingle']['data']>;
|
||||
getMpShipState: (params: {
|
||||
depositId?: string;
|
||||
orderId?: string;
|
||||
}, context: BackendRuntimeContext<ED>) => Promise<EntityDict['ship']['Schema']['iState']>;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import { getWithdrawCreateData } from './withdraw';
|
||||
import { getMpShipState } from './ship';
|
||||
const aspectDict = {
|
||||
getMpShipState,
|
||||
getWithdrawCreateData,
|
||||
};
|
||||
export default aspectDict;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import { BRC } from '../types/RuntimeCxt';
|
||||
/**
|
||||
* 获取小程序订单发货状态
|
||||
* @param params
|
||||
* @param context
|
||||
*/
|
||||
export declare function getMpShipState(params: {
|
||||
depositId?: string;
|
||||
orderId?: string;
|
||||
}, context: BRC): Promise<string | null | undefined>;
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
import { refreshShipState } from '../utils/ship';
|
||||
/**
|
||||
* 获取小程序订单发货状态
|
||||
* @param params
|
||||
* @param context
|
||||
*/
|
||||
export async function getMpShipState(params, context) {
|
||||
const application = context.getApplication();
|
||||
const { type, } = application;
|
||||
if (type === 'wechatMp') {
|
||||
const { depositId, orderId } = params;
|
||||
if (depositId) {
|
||||
//充值
|
||||
const deposits = await context.select('deposit', {
|
||||
data: {
|
||||
id: 1,
|
||||
iState: 1,
|
||||
shipId: 1,
|
||||
ship: {
|
||||
id: 1,
|
||||
iState: 1,
|
||||
},
|
||||
},
|
||||
filter: {
|
||||
id: depositId,
|
||||
}
|
||||
}, {});
|
||||
const deposit = deposits[0];
|
||||
if (deposit) {
|
||||
const shipState = await refreshShipState(context, deposit);
|
||||
return shipState;
|
||||
}
|
||||
}
|
||||
if (orderId) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6,57 +6,57 @@ export declare function getWithdrawCreateData(params: {
|
|||
}, context: BRC): Promise<(Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
accountId: import("oak-domain/lib/types").ForeignKey<"account">;
|
||||
account?: import("../oak-app-domain/Account/Schema").UpdateOperation;
|
||||
accountId: string;
|
||||
account?: import("../oak-app-domain/Account/Schema").UpdateOperation | undefined;
|
||||
} & {
|
||||
creatorId: import("oak-domain/lib/types").ForeignKey<"creator">;
|
||||
creator?: import("../oak-app-domain/User/Schema").UpdateOperation;
|
||||
creatorId: string;
|
||||
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
|
||||
} & {
|
||||
refund$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
accountId: import("oak-domain/lib/types").ForeignKey<"account">;
|
||||
account?: import("../oak-app-domain/Account/Schema").UpdateOperation;
|
||||
accountId: string;
|
||||
account?: import("../oak-app-domain/Account/Schema").UpdateOperation | undefined;
|
||||
} & {
|
||||
creator?: never;
|
||||
creatorId: import("oak-domain/lib/types").ForeignKey<"creator">;
|
||||
creator?: undefined;
|
||||
creatorId: string;
|
||||
} & {
|
||||
refund$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
account?: never;
|
||||
accountId: import("oak-domain/lib/types").ForeignKey<"account">;
|
||||
account?: undefined;
|
||||
accountId: string;
|
||||
} & {
|
||||
creatorId: import("oak-domain/lib/types").ForeignKey<"creator">;
|
||||
creator?: import("../oak-app-domain/User/Schema").UpdateOperation;
|
||||
creatorId: string;
|
||||
creator?: import("../oak-app-domain/User/Schema").UpdateOperation | undefined;
|
||||
} & {
|
||||
refund$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
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;
|
||||
}) | (Partial<Omit<import("../oak-app-domain/Withdraw/Schema").OpSchema, "accountId" | "creatorId">> & {
|
||||
id: string;
|
||||
} & {
|
||||
account?: never;
|
||||
accountId: import("oak-domain/lib/types").ForeignKey<"account">;
|
||||
account?: undefined;
|
||||
accountId: string;
|
||||
} & {
|
||||
creator?: never;
|
||||
creatorId: import("oak-domain/lib/types").ForeignKey<"creator">;
|
||||
creator?: undefined;
|
||||
creatorId: string;
|
||||
} & {
|
||||
refund$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/Refund/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/Refund/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/Refund/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/Refund/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
withdrawTransfer$withdraw?: import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], 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">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/WithdrawTransfer/Schema").CreateOperationData, "withdraw" | "withdrawId">> | import("oak-domain/lib/types").Operation<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperation["action"], Omit<import("../oak-app-domain/WithdrawTransfer/Schema").UpdateOperationData, "withdraw" | "withdrawId">, Omit<import("../oak-app-domain/WithdrawTransfer/Schema").Filter, "withdraw" | "withdrawId">>>;
|
||||
modiEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/ModiEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/OperEntity/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
accountOper$entity?: import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">[]> | Array<import("oak-domain/lib/types").Operation<"create", Omit<import("../oak-app-domain/AccountOper/Schema").CreateOperationData, "entity" | "entityId">>>;
|
||||
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;
|
||||
})>;
|
||||
|
|
|
|||
|
|
@ -4,15 +4,66 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef } from 'oak-frontend-base';
|
||||
import AbsFilterPanel from 'oak-frontend-base/es/components/filterPanel';
|
||||
import AbsList from 'oak-frontend-base/es/components/list';
|
||||
import AbsListPro from 'oak-frontend-base/es/components/listPro';
|
||||
import AbsDetail from 'oak-frontend-base/es/components/detail';
|
||||
import AbsUpsert from 'oak-frontend-base/es/components/upsert';
|
||||
declare const FilterPanel: <T extends keyof EntityDict>(...props: Parameters<typeof AbsFilterPanel<EntityDict, T>>) => React.ReactElement;
|
||||
declare const List: <T extends keyof EntityDict>(...props: Parameters<typeof AbsList<EntityDict, T>>) => React.ReactElement;
|
||||
declare const ListPro: <T extends keyof EntityDict>(...props: Parameters<typeof AbsListPro<EntityDict, T>>) => React.ReactElement;
|
||||
declare const Detail: <T extends keyof EntityDict>(...props: Parameters<typeof AbsDetail<EntityDict, T>>) => React.ReactElement;
|
||||
declare const Upsert: <T extends keyof EntityDict>(...props: Parameters<typeof AbsUpsert<EntityDict, T>>) => React.ReactElement;
|
||||
import { ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, ListButtonProps, OakAbsAttrUpsertDef } from 'oak-frontend-base';
|
||||
declare const FilterPanel: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
||||
entity: T;
|
||||
columns: ColumnProps<EntityDict, T>[];
|
||||
}>) => React.ReactElement;
|
||||
declare const List: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
||||
entity: T;
|
||||
extraActions: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]);
|
||||
onAction: onActionFnDef;
|
||||
disabledOp: boolean;
|
||||
attributes: OakAbsAttrDef[];
|
||||
data: RowWithActions<EntityDict, T>[];
|
||||
loading: boolean;
|
||||
tablePagination?: React.ReactNode;
|
||||
rowSelection?: any;
|
||||
hideHeader?: boolean | undefined;
|
||||
disableSerialNumber?: boolean | undefined;
|
||||
size?: "small" | "middle" | "large" | undefined;
|
||||
scroll?: any;
|
||||
empty?: React.ReactNode;
|
||||
opWidth?: number | undefined;
|
||||
ellipsis?: boolean | undefined;
|
||||
}>) => React.ReactElement;
|
||||
declare const ListPro: <T extends keyof EntityDict>(props: {
|
||||
title?: any;
|
||||
extraContent?: any;
|
||||
hideDefaultButtons?: boolean | undefined;
|
||||
buttonGroup?: ListButtonProps[] | undefined;
|
||||
onReload?: (() => void) | undefined;
|
||||
entity: T;
|
||||
extraActions?: OakExtraActionProps[] | ((row: RowWithActions<EntityDict, T>) => OakExtraActionProps[]) | undefined;
|
||||
onAction?: onActionFnDef | undefined;
|
||||
disabledOp?: boolean | undefined;
|
||||
attributes: OakAbsAttrDef[];
|
||||
data: RowWithActions<EntityDict, T>[];
|
||||
loading?: boolean | undefined;
|
||||
tablePagination?: any;
|
||||
rowSelection?: any;
|
||||
disableSerialNumber?: boolean | undefined;
|
||||
size?: "small" | "middle" | "large" | undefined;
|
||||
scroll?: any;
|
||||
empty?: any;
|
||||
opWidth?: number | undefined;
|
||||
oakPath?: string | undefined;
|
||||
}) => React.ReactElement;
|
||||
declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
||||
column?: number | Record<Breakpoint, number> | undefined;
|
||||
entity: T;
|
||||
attributes: OakAbsAttrDef[];
|
||||
data: Partial<EntityDict[T]["Schema"]>;
|
||||
title?: string | undefined;
|
||||
bordered?: boolean | undefined;
|
||||
layout?: "horizontal" | "vertical" | undefined;
|
||||
}>) => React.ReactElement;
|
||||
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
||||
helps: Record<string, string>;
|
||||
entity: T;
|
||||
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
|
||||
data: EntityDict[T]["Schema"];
|
||||
layout: "horizontal" | "vertical";
|
||||
mode: "default" | "card";
|
||||
}>) => React.ReactElement;
|
||||
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@ export default OakComponent({
|
|||
},
|
||||
},
|
||||
filter: {
|
||||
iState: 'depositing',
|
||||
iState: {
|
||||
$in: ['depositing', 'shipped'],
|
||||
},
|
||||
},
|
||||
},
|
||||
accountOper$account: {
|
||||
|
|
@ -62,13 +64,15 @@ export default OakComponent({
|
|||
onGoToHistory: () => undefined,
|
||||
},
|
||||
formData({ data }) {
|
||||
const unfinishedDepositId = data?.deposit$account?.[0]?.id;
|
||||
const unfinishedDepositId = data?.deposit$account?.filter((ele) => ele.iState === 'depositing')?.[0]?.id; //未完成支付的充值
|
||||
const unreceivedDepositId = data?.deposit$account?.filter((ele) => ele.iState === 'shipped')?.[0]?.id; //未确认收货的充值
|
||||
return {
|
||||
account: data,
|
||||
availStr: data?.avail && CentToString(data.avail, 2),
|
||||
totalStr: data?.total && CentToString(data.total, 2),
|
||||
loanStr: (data?.avail !== undefined && data?.total !== undefined) && CentToString(data.total - data.avail, 2),
|
||||
unfinishedDepositId,
|
||||
unreceivedDepositId,
|
||||
};
|
||||
},
|
||||
actions: ['deposit', 'withdraw'],
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
|
||||
"l-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/popup/index",
|
||||
"l-dialog": "@oak-frontend-base/miniprogram_npm/lin-ui/dialog/index",
|
||||
"l-notice-bar": "@oak-frontend-base/miniprogram_npm/lin-ui/notice-bar/index",
|
||||
"deposit-new": "../../deposit/new/index"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,7 @@
|
|||
<view class="container">
|
||||
<l-notice-bar show="{{unreceivedDepositId}}" front-icon-name="notification" end-icon-name="right">
|
||||
您有未确认的充值,请尽快前往确认
|
||||
</l-notice-bar>
|
||||
<view class="info" style="background-color:{{bgColor}};color:{{textColor}};">
|
||||
<view
|
||||
class="top label"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from "../../../oak-app-domain";
|
||||
export default function Render(props: {
|
||||
accountOpers: EntityDict['accountOper']['OpSchema'][];
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "offlineAccount", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export default function render(props) {
|
|||
}}/>
|
||||
</Form.Item>
|
||||
<Form.Item label={t('offlineAccount:attr.withdrawTransferLossRatio')} help={t('placeholder.withdrawTransferLossRatio')} required>
|
||||
<InputNumber value={offlineAccount.withdrawTransferLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
||||
<InputNumber value={offlineAccount.withdrawTransferLossRatio} max={5} min={0} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
||||
const withdrawTransferLossRatio = value;
|
||||
update({ withdrawTransferLossRatio });
|
||||
}}/>
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "order", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ import { EntityDict } from "../../../oak-app-domain";
|
|||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "order", false, {
|
||||
accountId: string;
|
||||
accountAvailMax: number;
|
||||
onSetPays: (pays: Partial<EntityDict["pay"]["CreateSingle"]["data"]>[]) => void;
|
||||
onSetPays: (pays: Partial<EntityDict['pay']['CreateSingle']['data']>[]) => void;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ export default OakComponent({
|
|||
},
|
||||
isList: false,
|
||||
properties: {
|
||||
accountId: '', // 是否可以使用帐户中的余额抵扣
|
||||
accountAvailMax: 0, // 本次交易可以使用的帐户中的Avail max值,调用者自己保证此数值的一致性,不要扣成负数
|
||||
accountId: '',
|
||||
accountAvailMax: 0,
|
||||
onSetPays: (pays) => undefined,
|
||||
},
|
||||
formData({ data }) {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
export default function Info(props: {
|
||||
price: number;
|
||||
t: (k: string) => string;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
import { PayChannelOption } from "../../../types/Pay";
|
||||
export default function Render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
import { PayChannelOption } from "../../../types/Pay";
|
||||
export default function Render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ export default OakComponent({
|
|||
accountId: 1,
|
||||
price: 1,
|
||||
loss: 1,
|
||||
iState: 1,
|
||||
shipId: 1,
|
||||
},
|
||||
order: {
|
||||
id: 1,
|
||||
|
|
@ -119,11 +121,17 @@ export default OakComponent({
|
|||
showCloseConfirmMp: false,
|
||||
showChannelSelectMp: false,
|
||||
unsub: undefined,
|
||||
unsubShip: undefined,
|
||||
},
|
||||
formData({ data }) {
|
||||
const application = this.features.application.getApplication();
|
||||
const iState = data?.iState;
|
||||
const iStateColor = iState && this.features.style.getColor('pay', 'iState', iState);
|
||||
let iStateStr = this.t(`pay:v.iState.${iState}`);
|
||||
let iStateColor = iState && this.features.style.getColor('pay', 'iState', iState);
|
||||
if (data?.depositId && data?.deposit?.shipId && data?.deposit?.iState === 'shipped') {
|
||||
iStateStr = this.t('ship.shipped');
|
||||
iStateColor = this.features.style.getColor('deposit', 'iState', data?.deposit?.iState);
|
||||
}
|
||||
const startPayable = iState === 'paying' && !['account', 'offlineAccount'].includes(data.entity) && (PayRoutineDict[data.entity] && PayRoutineDict[data.entity].judgeCanPay(data, this.features));
|
||||
const payChannels = this.features.pay.getPayChannels();
|
||||
const offlines = this.features.cache.get('offlineAccount', {
|
||||
|
|
@ -157,6 +165,9 @@ export default OakComponent({
|
|||
notSameApp: data && data.applicationId !== application.id && data.entity !== 'offlineAccount',
|
||||
priceStr: data?.price && CentToString(data.price, 2),
|
||||
oakExecutable: this.tryExecute(),
|
||||
iStateStr,
|
||||
shipId: data?.deposit?.shipId,
|
||||
depositId: data?.depositId,
|
||||
};
|
||||
},
|
||||
features: [{
|
||||
|
|
@ -303,9 +314,10 @@ export default OakComponent({
|
|||
});
|
||||
},
|
||||
detached() {
|
||||
const { unsub } = this.state;
|
||||
const { unsub, unsubShip } = this.state;
|
||||
unsub && unsub();
|
||||
}
|
||||
unsubShip && unsubShip();
|
||||
},
|
||||
},
|
||||
listeners: {
|
||||
startPayable(prev, next) {
|
||||
|
|
@ -317,6 +329,62 @@ export default OakComponent({
|
|||
if (!prev.pay && next.pay) {
|
||||
this.refreshOfflineAccounts();
|
||||
}
|
||||
},
|
||||
async shipId(prev, next) {
|
||||
const { depositId } = this.state;
|
||||
if (depositId && prev.shipId !== next.shipId && next.shipId) {
|
||||
if (prev.shipId) {
|
||||
const { unsubShip } = this.state;
|
||||
unsubShip && unsubShip();
|
||||
}
|
||||
const unsubShip = await this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.shipStateChanged}-${next.shipId}`], async (event, opRecords) => {
|
||||
if (process.env.OAK_PLATFORM === 'wechatMp') {
|
||||
//在充值虚拟发货成功后,小程序唤起确认收货组件
|
||||
for (const record of opRecords) {
|
||||
if (record.a === 'u') {
|
||||
const { e, d } = record;
|
||||
const { pay } = this.state;
|
||||
if (e === 'ship' && d.iState === 'ship' && pay.meta.transaction_id) {
|
||||
if (wx.openBusinessView) {
|
||||
wx.openBusinessView({
|
||||
businessType: 'weappOrderConfirm',
|
||||
extraData: {
|
||||
transaction_id: pay.meta.transaction_id,
|
||||
},
|
||||
async success() {
|
||||
console.log('success');
|
||||
const mpShipState = await this.features.cache.exec('getMpShipState', {
|
||||
depositId,
|
||||
});
|
||||
if (mpShipState === 'received') {
|
||||
this.setMessage({
|
||||
type: 'success',
|
||||
context: '确认收货成功'
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log(mpShipState);
|
||||
}
|
||||
},
|
||||
fail() {
|
||||
console.log('fail');
|
||||
},
|
||||
complete() {
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
//引导用户升级微信版本
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
this.setState({
|
||||
unsubShip,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<view class="title-bar-wrapper">
|
||||
<view class="title-bar">
|
||||
<view class="title">{{t('title')}}</view>
|
||||
<l-tag bg-color="{{iStateColor}}" type="reading">{{t('pay:v.iState.' + pay.iState)}}</l-tag>
|
||||
<l-tag bg-color="{{iStateColor}}" type="reading">{{iStateStr}}</l-tag>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list">
|
||||
|
|
|
|||
|
|
@ -36,5 +36,8 @@
|
|||
"externalId": {
|
||||
"label": "转账流水号",
|
||||
"help": "转账成功后有唯一流水号,将之正确填入可减少财务人员核对时的错误概率,给您带来更大便利"
|
||||
},
|
||||
"ship": {
|
||||
"shipped": "待确认"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "pay", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "system", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "refund", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,2 +1,3 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { EntityDict } from "../../../oak-app-domain";
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
||||
accountId: string;
|
||||
withdrawAccountFilter: EntityDict["withdrawAccount"]["Selection"]["filter"];
|
||||
withdrawAccountFilter: import("../../../oak-app-domain/WithdrawAccount/Schema").Filter | undefined;
|
||||
onNewWithdrawAccount: () => void;
|
||||
onCreateWithdraw: (id: string) => void;
|
||||
onGoToHistory: () => void;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
import { EntityDict } from "../../../oak-app-domain";
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdraw", false, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, keyof EntityDict, boolean, {
|
||||
withdraw: EntityDict["withdraw"]["Schema"];
|
||||
withdraw: import("../../../oak-app-domain/Withdraw/Schema").Schema;
|
||||
create: boolean;
|
||||
}>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
export default function render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="react" />
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
export default function render(props: {
|
||||
data: {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/// <reference types="wechat-miniprogram" />
|
||||
import { EntityDict } from '../../../oak-app-domain';
|
||||
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<EntityDict, "withdrawTransfer", true, WechatMiniprogram.Component.DataOption>) => React.ReactElement;
|
||||
export default _default;
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@ export default OakComponent({
|
|||
wpAccountId: 1,
|
||||
applicationId: 1,
|
||||
enabled: 1,
|
||||
shipping: 1,
|
||||
application: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
name: 1,
|
||||
config: 1,
|
||||
},
|
||||
},
|
||||
filters: [
|
||||
|
|
@ -43,6 +45,7 @@ export default OakComponent({
|
|||
id: 1,
|
||||
name: 1,
|
||||
type: 1,
|
||||
config: 1,
|
||||
},
|
||||
filter: {
|
||||
systemId,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export default OakComponent({
|
|||
wpAccountId: 1,
|
||||
applicationId: 1,
|
||||
enabled: 1,
|
||||
shipping: 1,
|
||||
application: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
|
|
@ -50,6 +51,7 @@ export default OakComponent({
|
|||
this.update({
|
||||
wpAccountId,
|
||||
enabled: true,
|
||||
shipping: false, //默认不受发货限制
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,13 @@ export default function render(props) {
|
|||
update({ enabled });
|
||||
}}/>
|
||||
</Form.Item>
|
||||
{wpProduct.type && wpProduct.type === 'mp' && (
|
||||
//仅小程序会受发货限制
|
||||
<Form.Item label={t('wpProduct:attr.shipping')} required tooltip={'开启后将接入小程序发货管理'}>
|
||||
<Switch value={wpProduct.shipping} onChange={(checked) => {
|
||||
update({ shipping: checked });
|
||||
}}/>
|
||||
</Form.Item>)}
|
||||
<Form.Item label={t('wpAccount:attr.taxLossRatio')} help={t('placeholder.taxLossRatio')}>
|
||||
<InputNumber value={wpProduct.taxLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
||||
const taxLossRatio = value;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
export declare const DATA_SUBSCRIBER_KEYS: {
|
||||
payStateChanged: string;
|
||||
accountNumberChanged: string;
|
||||
shipStateChanged: string;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
export const DATA_SUBSCRIBER_KEYS = {
|
||||
payStateChanged: 'oak-pay-business-psc',
|
||||
accountNumberChanged: 'oak-pay-business-anc',
|
||||
shipStateChanged: 'oak-pay-business-ssc',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,62 +5,244 @@ import { BackendRuntimeContext as DependentBackendRuntimeContext } from 'oak-gen
|
|||
export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends DependentBackendRuntimeContext<ED> implements RuntimeContext {
|
||||
protected applicationProjection: {
|
||||
[k: string]: any;
|
||||
"#id"?: import("oak-domain/lib/types").NodeId;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
description?: number;
|
||||
type?: number;
|
||||
systemId?: number;
|
||||
system?: import("../oak-app-domain/System/Schema").Projection;
|
||||
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>;
|
||||
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style>;
|
||||
domainId?: number;
|
||||
domain?: import("../oak-app-domain/Domain/Schema").Projection;
|
||||
applicationPassport$application?: import("../oak-app-domain/ApplicationPassport/Schema").Selection & {
|
||||
"#id"?: `node-${number}` | undefined;
|
||||
id?: number | undefined;
|
||||
$$createAt$$?: number | undefined;
|
||||
$$updateAt$$?: number | undefined;
|
||||
$$seq$$?: number | undefined;
|
||||
name?: number | undefined;
|
||||
description?: number | undefined;
|
||||
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;
|
||||
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;
|
||||
applicationPassport$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/ApplicationPassport/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/ApplicationPassport/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/ApplicationPassport/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "applicationPassport";
|
||||
};
|
||||
extraFile$application?: import("../oak-app-domain/ExtraFile/Schema").Selection & {
|
||||
}) | undefined;
|
||||
extraFile$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/ExtraFile/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/ExtraFile/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/ExtraFile/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
notification$application?: import("../oak-app-domain/Notification/Schema").Selection & {
|
||||
}) | undefined;
|
||||
notification$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/Notification/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/Notification/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/Notification/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "notification";
|
||||
};
|
||||
sessionMessage$application?: import("../oak-app-domain/SessionMessage/Schema").Selection & {
|
||||
}) | undefined;
|
||||
sessionMessage$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/SessionMessage/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/SessionMessage/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/SessionMessage/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
token$application?: import("../oak-app-domain/Token/Schema").Selection & {
|
||||
}) | undefined;
|
||||
token$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/Token/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/Token/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/Token/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "token";
|
||||
};
|
||||
wechatMenu$application?: import("../oak-app-domain/WechatMenu/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatMenu$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatMenu/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatMenu/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatMenu/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatMenu";
|
||||
};
|
||||
wechatPublicAutoReply$application?: import("../oak-app-domain/WechatPublicAutoReply/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatPublicAutoReply$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatPublicAutoReply/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatPublicAutoReply/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatPublicAutoReply/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicTag$application?: import("../oak-app-domain/WechatPublicTag/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatPublicTag$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatPublicTag/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatPublicTag/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatPublicTag/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
wechatQrCode$application?: import("../oak-app-domain/WechatQrCode/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatQrCode$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatQrCode/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatQrCode/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatQrCode/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatQrCode";
|
||||
};
|
||||
wechatTemplate$application?: import("../oak-app-domain/WechatTemplate/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatTemplate$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatTemplate/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatTemplate/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatTemplate/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatTemplate";
|
||||
};
|
||||
wechatUser$application?: import("../oak-app-domain/WechatUser/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatUser$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WechatUser/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WechatUser/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WechatUser/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
pay$application?: import("../oak-app-domain/Pay/Schema").Selection & {
|
||||
}) | undefined;
|
||||
pay$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/Pay/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/Pay/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/Pay/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "pay";
|
||||
};
|
||||
wpProduct$application?: import("../oak-app-domain/WpProduct/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wpProduct$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/WpProduct/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/WpProduct/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/WpProduct/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wpProduct";
|
||||
};
|
||||
session$entity?: import("../oak-app-domain/Session/Schema").Selection & {
|
||||
}) | undefined;
|
||||
session$entity?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("../oak-app-domain/Session/Schema").Projection;
|
||||
sorter?: import("../oak-app-domain/Session/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("../oak-app-domain/Session/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "session";
|
||||
};
|
||||
}) | undefined;
|
||||
} & Partial<import("oak-domain/lib/types").ExprOp<string>> & {
|
||||
applicationPassport$application$$aggr?: (import("../oak-app-domain/ApplicationPassport/Schema").Aggregation & {
|
||||
$entity: "applicationPassport";
|
||||
|
|
@ -539,56 +721,212 @@ export declare class BackendRuntimeContext<ED extends EntityDict & BaseEntityDic
|
|||
}) | undefined;
|
||||
} & {
|
||||
[k: string]: any;
|
||||
"#id"?: import("oak-domain/lib/types").NodeId;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
description?: number;
|
||||
type?: number;
|
||||
systemId?: number;
|
||||
system?: import("oak-general-business/lib/oak-app-domain/System/Schema").Projection;
|
||||
config?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/oak-app-domain/Application/Schema").WebConfig | import("oak-general-business/lib/oak-app-domain/Application/Schema").WechatMpConfig | import("oak-general-business/lib/oak-app-domain/Application/Schema").WechatPublicConfig | import("oak-general-business/lib/oak-app-domain/Application/Schema").NativeConfig>;
|
||||
style?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/types/Style").Style>;
|
||||
domainId?: number;
|
||||
domain?: import("oak-general-business/lib/oak-app-domain/Domain/Schema").Projection;
|
||||
applicationPassport$application?: import("oak-general-business/lib/oak-app-domain/ApplicationPassport/Schema").Selection & {
|
||||
"#id"?: `node-${number}` | undefined;
|
||||
id?: number | undefined;
|
||||
$$createAt$$?: number | undefined;
|
||||
$$updateAt$$?: number | undefined;
|
||||
$$seq$$?: number | undefined;
|
||||
name?: number | undefined;
|
||||
description?: number | undefined;
|
||||
type?: number | undefined;
|
||||
systemId?: number | undefined;
|
||||
system?: import("oak-general-business/lib/oak-app-domain/System/Schema").Projection | undefined;
|
||||
config?: number | import("oak-domain/lib/types").JsonProjection<import("oak-general-business/lib/oak-app-domain/Application/Schema").WebConfig | import("oak-general-business/lib/oak-app-domain/Application/Schema").WechatMpConfig | import("oak-general-business/lib/oak-app-domain/Application/Schema").WechatPublicConfig | import("oak-general-business/lib/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-general-business/lib/oak-app-domain/Domain/Schema").Projection | undefined;
|
||||
applicationPassport$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/ApplicationPassport/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/ApplicationPassport/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/ApplicationPassport/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "applicationPassport";
|
||||
};
|
||||
extraFile$application?: import("oak-general-business/lib/oak-app-domain/ExtraFile/Schema").Selection & {
|
||||
}) | undefined;
|
||||
extraFile$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/ExtraFile/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/ExtraFile/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/ExtraFile/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
notification$application?: import("oak-general-business/lib/oak-app-domain/Notification/Schema").Selection & {
|
||||
}) | undefined;
|
||||
notification$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/Notification/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/Notification/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/Notification/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "notification";
|
||||
};
|
||||
sessionMessage$application?: import("oak-general-business/lib/oak-app-domain/SessionMessage/Schema").Selection & {
|
||||
}) | undefined;
|
||||
sessionMessage$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/SessionMessage/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/SessionMessage/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/SessionMessage/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
token$application?: import("oak-general-business/lib/oak-app-domain/Token/Schema").Selection & {
|
||||
}) | undefined;
|
||||
token$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/Token/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/Token/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/Token/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "token";
|
||||
};
|
||||
wechatMenu$application?: import("oak-general-business/lib/oak-app-domain/WechatMenu/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatMenu$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatMenu/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatMenu/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatMenu/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatMenu";
|
||||
};
|
||||
wechatPublicAutoReply$application?: import("oak-general-business/lib/oak-app-domain/WechatPublicAutoReply/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatPublicAutoReply$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatPublicAutoReply/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatPublicAutoReply/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatPublicAutoReply/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatPublicAutoReply";
|
||||
};
|
||||
wechatPublicTag$application?: import("oak-general-business/lib/oak-app-domain/WechatPublicTag/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatPublicTag$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatPublicTag/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatPublicTag/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatPublicTag/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatPublicTag";
|
||||
};
|
||||
wechatQrCode$application?: import("oak-general-business/lib/oak-app-domain/WechatQrCode/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatQrCode$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatQrCode/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatQrCode/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatQrCode/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatQrCode";
|
||||
};
|
||||
wechatTemplate$application?: import("oak-general-business/lib/oak-app-domain/WechatTemplate/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatTemplate$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatTemplate/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatTemplate/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatTemplate/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatTemplate";
|
||||
};
|
||||
wechatUser$application?: import("oak-general-business/lib/oak-app-domain/WechatUser/Schema").Selection & {
|
||||
}) | undefined;
|
||||
wechatUser$application?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/WechatUser/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/WechatUser/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/WechatUser/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
session$entity?: import("oak-general-business/lib/oak-app-domain/Session/Schema").Selection & {
|
||||
}) | undefined;
|
||||
session$entity?: ({
|
||||
id?: string | undefined;
|
||||
action?: "select" | undefined;
|
||||
data: import("oak-general-business/lib/oak-app-domain/Session/Schema").Projection;
|
||||
sorter?: import("oak-general-business/lib/oak-app-domain/Session/Schema").Sorter | undefined;
|
||||
} & {
|
||||
filter?: import("oak-general-business/lib/oak-app-domain/Session/Schema").Filter | undefined;
|
||||
indexFrom?: number | undefined;
|
||||
count?: number | undefined;
|
||||
} & {
|
||||
randomRange?: number | undefined;
|
||||
total?: number | undefined;
|
||||
distinct?: true | undefined;
|
||||
} & {
|
||||
$entity: "session";
|
||||
};
|
||||
}) | undefined;
|
||||
} & {
|
||||
applicationPassport$application$$aggr?: (import("oak-general-business/lib/oak-app-domain/ApplicationPassport/Schema").Aggregation & {
|
||||
$entity: "applicationPassport";
|
||||
|
|
|
|||
|
|
@ -217,6 +217,9 @@ const i18ns = [
|
|||
"externalId": {
|
||||
"label": "转账流水号",
|
||||
"help": "转账成功后有唯一流水号,将之正确填入可减少财务人员核对时的错误概率,给您带来更大便利"
|
||||
},
|
||||
"ship": {
|
||||
"shipped": "待确认"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ import { EntityDesc, ActionDef } from 'oak-domain/lib/types';
|
|||
import { Schema as Account } from './Account';
|
||||
import { Schema as User } from './User';
|
||||
import { Schema as AccountOper } from './AccountOper';
|
||||
import { Schema as Ship } from './Ship';
|
||||
export interface Schema extends EntityShape {
|
||||
price: Price;
|
||||
loss: Price;
|
||||
account: Account;
|
||||
creator: User;
|
||||
opers: AccountOper[];
|
||||
ship?: Ship;
|
||||
}
|
||||
export type IAction = 'succeed' | 'fail';
|
||||
export type IState = 'depositing' | 'successful' | 'failed';
|
||||
export type IAction = 'succeed' | 'fail' | 'ship';
|
||||
export type IState = 'depositing' | 'successful' | 'failed' | 'shipped';
|
||||
export declare const IActionDef: ActionDef<IAction, IState>;
|
||||
type Action = IAction;
|
||||
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
;
|
||||
export const IActionDef = {
|
||||
stm: {
|
||||
succeed: ['depositing', 'successful'],
|
||||
fail: ['depositing', 'failed'],
|
||||
ship: ['depositing', 'shipped'],
|
||||
succeed: [['depositing', 'shipped'], 'successful'],
|
||||
fail: [['depositing', 'shipped'], 'failed'],
|
||||
},
|
||||
is: 'depositing',
|
||||
};
|
||||
|
|
@ -16,18 +17,21 @@ export const entityDesc = {
|
|||
loss: '充值损耗',
|
||||
account: '充值帐户',
|
||||
creator: '创建者',
|
||||
opers: '关键账户操作'
|
||||
opers: '关键账户操作',
|
||||
ship: '虚拟物流',
|
||||
},
|
||||
v: {
|
||||
iState: {
|
||||
depositing: '充值中',
|
||||
successful: '充值成功',
|
||||
failed: '充值失败',
|
||||
shipped: '待用户确认'
|
||||
},
|
||||
},
|
||||
action: {
|
||||
succeed: '充值成功',
|
||||
fail: '充值失败',
|
||||
ship: '虚拟发货'
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
@ -41,6 +45,7 @@ export const entityDesc = {
|
|||
depositing: '#3498DB',
|
||||
successful: '#52BE80',
|
||||
failed: '#5D6D7E',
|
||||
shipped: '#0000CD',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
import { String, Int } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { ActionDef, EntityDesc } from 'oak-domain/lib/types';
|
||||
import { Schema as ShipCompany } from './ShipCompany';
|
||||
import { Schema as Address } from 'oak-general-business/lib/entities/Address';
|
||||
export interface Schema extends EntityShape {
|
||||
type: 'virtual' | 'pickup' | 'express';
|
||||
shipCompany?: ShipCompany;
|
||||
serial?: String<64>;
|
||||
to?: Address;
|
||||
from?: Address;
|
||||
phantom1?: String<32>;
|
||||
phantom2?: String<32>;
|
||||
phantom3?: Int<4>;
|
||||
phantom4?: Int<8>;
|
||||
}
|
||||
type IState = 'unshipped' | 'shipping' | 'givenUp' | 'received' | 'rejected';
|
||||
type IAction = 'ship' | 'receive' | 'giveUp' | 'reject';
|
||||
export declare const IActionDef: ActionDef<IAction, IState>;
|
||||
type Action = IAction;
|
||||
export declare const entityDesc: EntityDesc<Schema, Action, '', {
|
||||
iState: IState;
|
||||
type: Schema['type'];
|
||||
}>;
|
||||
export {};
|
||||
|
|
@ -0,0 +1,100 @@
|
|||
;
|
||||
export const IActionDef = {
|
||||
stm: {
|
||||
ship: ['unshipped', 'shipping'],
|
||||
receive: ['shipping', 'received'],
|
||||
giveUp: [['unshipped', 'shipping'], 'givenUp'],
|
||||
reject: ['shipping', 'rejected'],
|
||||
},
|
||||
is: 'unshipped',
|
||||
};
|
||||
export const entityDesc = {
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_serial',
|
||||
attributes: [
|
||||
{
|
||||
name: 'serial',
|
||||
}
|
||||
],
|
||||
config: {
|
||||
unique: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'index_phantom1',
|
||||
attributes: [
|
||||
{
|
||||
name: 'phantom1',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'index_phantom3',
|
||||
attributes: [
|
||||
{
|
||||
name: 'phantom3',
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '物流公司系统连接',
|
||||
attr: {
|
||||
type: '物流类型',
|
||||
shipCompany: '物流公司',
|
||||
serial: '物流编号',
|
||||
to: '收件地址',
|
||||
from: '寄件地址',
|
||||
iState: '状态',
|
||||
phantom1: '索引项一',
|
||||
phantom2: '索引项二',
|
||||
phantom3: '索引项三',
|
||||
phantom4: '索引项四',
|
||||
},
|
||||
v: {
|
||||
iState: {
|
||||
unshipped: '未发货',
|
||||
shipping: '发货中',
|
||||
received: '已收货',
|
||||
rejected: '已拒绝',
|
||||
givenUp: '已放弃',
|
||||
},
|
||||
type: {
|
||||
virtual: '虚拟',
|
||||
pickup: '自提',
|
||||
express: '快递',
|
||||
}
|
||||
},
|
||||
action: {
|
||||
ship: '发货',
|
||||
receive: '收货',
|
||||
giveUp: '放弃',
|
||||
reject: '拒收',
|
||||
},
|
||||
},
|
||||
},
|
||||
style: {
|
||||
color: {
|
||||
iState: {
|
||||
unshipped: '#D2691E',
|
||||
shipping: '#1E90FF',
|
||||
received: '#90EE90',
|
||||
rejected: '#FF0000',
|
||||
givenUp: '#A9A9A9'
|
||||
},
|
||||
type: {
|
||||
virtual: '#EB984E',
|
||||
pickup: '#2ECC71',
|
||||
express: '#5DADE2',
|
||||
}
|
||||
},
|
||||
icon: {
|
||||
ship: '',
|
||||
receive: '',
|
||||
giveUp: '',
|
||||
reject: '',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import { String } 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 {
|
||||
name: String<32>;
|
||||
abbr: String<16>;
|
||||
wechatMpName?: String<4>;
|
||||
}
|
||||
export declare const entityDesc: EntityDesc<Schema>;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
;
|
||||
export const entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '物流公司',
|
||||
attr: {
|
||||
name: '名称',
|
||||
abbr: '缩写',
|
||||
wechatMpName: '小程序名称'
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { EntityDesc } from 'oak-domain/lib/types';
|
||||
import { Schema as ShipCompany } from './ShipCompany';
|
||||
import { Schema as System } from './System';
|
||||
export interface Schema extends EntityShape {
|
||||
shipCompany: ShipCompany;
|
||||
system: System;
|
||||
}
|
||||
export declare const entityDesc: EntityDesc<Schema>;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
;
|
||||
export const entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '物流公司系统连接',
|
||||
attr: {
|
||||
shipCompany: '物流公司',
|
||||
system: '系统连接'
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { EntityDesc } from 'oak-domain/lib/types';
|
||||
import { Schema as Ship } from './Ship';
|
||||
import { Schema as Order } from './Order';
|
||||
export interface Schema extends EntityShape {
|
||||
ship: Ship;
|
||||
order: Order;
|
||||
}
|
||||
export declare const entityDesc: EntityDesc<Schema>;
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
;
|
||||
export const entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '物流订单连接表',
|
||||
attr: {
|
||||
ship: '物流',
|
||||
order: '订单',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
@ -10,6 +10,7 @@ export interface Schema extends EntityShape {
|
|||
taxLossRatio?: Decimal<4, 2>;
|
||||
application: Application;
|
||||
enabled: Boolean;
|
||||
shipping: Boolean;
|
||||
pays: Pay[];
|
||||
}
|
||||
export declare const entityDesc: EntityDesc<Schema, '', '', {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ export const entityDesc = {
|
|||
application: '关联应用',
|
||||
enabled: '有效中',
|
||||
taxLossRatio: '产品手续费(百分比)',
|
||||
shipping: '受发货限制',
|
||||
pays: '支付',
|
||||
},
|
||||
v: {
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ export declare const actionDefDict: {
|
|||
refund: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
ship: {
|
||||
iState: import("oak-domain/lib/types").ActionDef<string, string>;
|
||||
};
|
||||
user: {
|
||||
idState: import("oak-domain/lib/types").ActionDef<import("oak-general-business/lib/entities/User").IdAction, import("oak-general-business/lib/entities/User").IdState>;
|
||||
userState: import("oak-domain/lib/types").ActionDef<import("oak-general-business/lib/entities/User").UserAction, import("oak-general-business/lib/entities/User").UserState>;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { actionDefDict as offlineAccount } from "./OfflineAccount/Action";
|
|||
import { actionDefDict as order } from "./Order/Action";
|
||||
import { actionDefDict as pay } from "./Pay/Action";
|
||||
import { actionDefDict as refund } from "./Refund/Action";
|
||||
import { actionDefDict as ship } from "./Ship/Action";
|
||||
import { actionDefDict as user } from "./User/Action";
|
||||
import { actionDefDict as withdraw } from "./Withdraw/Action";
|
||||
import { actionDefDict as withdrawAccount } from "./WithdrawAccount/Action";
|
||||
|
|
@ -53,6 +54,7 @@ export const actionDefDict = {
|
|||
order,
|
||||
pay,
|
||||
refund,
|
||||
ship,
|
||||
user,
|
||||
withdraw,
|
||||
withdrawAccount,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } 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 { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import * as Area from "../Area/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Ship from "../Ship/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
detail: String<32>;
|
||||
areaId: ForeignKey<"area">;
|
||||
|
|
@ -17,11 +18,19 @@ export type OpSchema = EntityShape & {
|
|||
entityId?: String<64> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
type Ship$toAggr = "ship$to$$aggr" | "ship$to$$0$$aggr" | "ship$to$$1$$aggr" | "ship$to$$2$$aggr" | "ship$to$$3$$aggr" | "ship$to$$4$$aggr" | "ship$to$$5$$aggr" | "ship$to$$6$$aggr" | "ship$to$$7$$aggr" | "ship$to$$8$$aggr" | "ship$to$$9$$aggr";
|
||||
type Ship$fromAggr = "ship$from$$aggr" | "ship$from$$0$$aggr" | "ship$from$$1$$aggr" | "ship$from$$2$$aggr" | "ship$from$$3$$aggr" | "ship$from$$4$$aggr" | "ship$from$$5$$aggr" | "ship$from$$6$$aggr" | "ship$from$$7$$aggr" | "ship$from$$8$$aggr" | "ship$from$$9$$aggr";
|
||||
export type Schema = OpSchema & {
|
||||
area: Area.Schema;
|
||||
user?: User.Schema;
|
||||
ship$to?: Array<Ship.Schema>;
|
||||
ship$from?: Array<Ship.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
} & {
|
||||
[A in Ship$toAggr]?: AggregationResult<Ship.Schema>;
|
||||
} & {
|
||||
[A in Ship$fromAggr]?: AggregationResult<Ship.Schema>;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
|
|
@ -38,6 +47,8 @@ type AttrFilter = {
|
|||
entity: Q_EnumValue<"user" | string>;
|
||||
entityId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
ship$to: Ship.Filter & SubQueryPredicateMetadata;
|
||||
ship$from: Ship.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
|
|
@ -57,7 +68,21 @@ export type Projection = {
|
|||
entity?: number;
|
||||
entityId?: number;
|
||||
user?: User.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
ship$to?: Ship.Selection & {
|
||||
$entity: "ship";
|
||||
};
|
||||
ship$from?: Ship.Selection & {
|
||||
$entity: "ship";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>> & {
|
||||
[A in Ship$toAggr]?: Ship.Aggregation & {
|
||||
$entity: "ship";
|
||||
};
|
||||
} & {
|
||||
[A in Ship$fromAggr]?: Ship.Aggregation & {
|
||||
$entity: "ship";
|
||||
};
|
||||
};
|
||||
type AddressIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
|
|
@ -125,7 +150,10 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
});
|
||||
}) & {
|
||||
ship$to?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "to" | "toId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "to" | "toId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">>>;
|
||||
ship$from?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "from" | "fromId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "from" | "fromId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
|
|
@ -142,6 +170,8 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "enti
|
|||
user?: never;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
ship$to?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "to" | "toId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "to" | "toId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "to" | "toId">, Omit<Ship.Filter, "to" | "toId">>>;
|
||||
ship$from?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "from" | "fromId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "from" | "fromId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "from" | "fromId">, Omit<Ship.Filter, "from" | "fromId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & ({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export type IAction = 'succeed' | 'fail' | string;
|
||||
export type IState = 'depositing' | 'successful' | 'failed' | string;
|
||||
export type IAction = 'succeed' | 'fail' | 'ship' | string;
|
||||
export type IState = 'depositing' | 'successful' | 'failed' | 'shipped' | string;
|
||||
export declare const IActionDef: ActionDef<IAction, IState>;
|
||||
export type ParticularAction = IAction;
|
||||
export declare const actions: string[];
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
export const IActionDef = {
|
||||
stm: {
|
||||
succeed: ['depositing', 'successful'],
|
||||
fail: ['depositing', 'failed'],
|
||||
ship: ['depositing', 'shipped'],
|
||||
succeed: [['depositing', 'shipped'], 'successful'],
|
||||
fail: [['depositing', 'shipped'], 'failed'],
|
||||
},
|
||||
is: 'depositing',
|
||||
};
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "succeed", "fail"];
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "succeed", "fail", "ship"];
|
||||
export const actionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { Action, ParticularAction, IState } from "./Action";
|
|||
import { Price } from "oak-domain/lib/types/DataType";
|
||||
import * as Account from "../Account/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Ship from "../Ship/Schema";
|
||||
import * as Pay from "../Pay/Schema";
|
||||
import * as AccountOper from "../AccountOper/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
|
|
@ -13,6 +14,7 @@ export type OpSchema = EntityShape & {
|
|||
loss: Price;
|
||||
accountId: ForeignKey<"account">;
|
||||
creatorId: ForeignKey<"user">;
|
||||
shipId?: ForeignKey<"ship"> | null;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
|
|
@ -21,6 +23,7 @@ type AccountOper$entityAggr = "accountOper$entity$$aggr" | "accountOper$entity$$
|
|||
export type Schema = OpSchema & {
|
||||
account: Account.Schema;
|
||||
creator: User.Schema;
|
||||
ship?: Ship.Schema | null;
|
||||
pay$deposit?: Array<Pay.Schema>;
|
||||
accountOper$entity?: Array<AccountOper.Schema>;
|
||||
} & {
|
||||
|
|
@ -41,6 +44,8 @@ type AttrFilter = {
|
|||
account: Account.Filter;
|
||||
creatorId: Q_StringValue;
|
||||
creator: User.Filter;
|
||||
shipId: Q_StringValue;
|
||||
ship: Ship.Filter;
|
||||
iState: Q_EnumValue<IState>;
|
||||
pay$deposit: Pay.Filter & SubQueryPredicateMetadata;
|
||||
accountOper$entity: AccountOper.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -59,6 +64,8 @@ export type Projection = {
|
|||
account?: Account.Projection;
|
||||
creatorId?: number;
|
||||
creator?: User.Projection;
|
||||
shipId?: number;
|
||||
ship?: Ship.Projection;
|
||||
iState?: number;
|
||||
pay$deposit?: Pay.Selection & {
|
||||
$entity: "pay";
|
||||
|
|
@ -84,6 +91,9 @@ type AccountIdProjection = OneOf<{
|
|||
type UserIdProjection = OneOf<{
|
||||
creatorId: number;
|
||||
}>;
|
||||
type ShipIdProjection = OneOf<{
|
||||
shipId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -104,6 +114,10 @@ export type SortAttr = {
|
|||
creatorId: number;
|
||||
} | {
|
||||
creator: User.SortAttr;
|
||||
} | {
|
||||
shipId: number;
|
||||
} | {
|
||||
ship: Ship.SortAttr;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
|
|
@ -117,7 +131,7 @@ export type Sorter = SortNode[];
|
|||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "accountId" | "creatorId">> & (({
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "accountId" | "creatorId" | "shipId">> & (({
|
||||
accountId?: never;
|
||||
account: Account.CreateSingleOperation;
|
||||
} | {
|
||||
|
|
@ -135,6 +149,15 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "accountId" | "c
|
|||
} | {
|
||||
creator?: never;
|
||||
creatorId: ForeignKey<"creator">;
|
||||
}) & ({
|
||||
shipId?: never;
|
||||
ship?: Ship.CreateSingleOperation;
|
||||
} | {
|
||||
shipId: ForeignKey<"ship">;
|
||||
ship?: Ship.UpdateOperation;
|
||||
} | {
|
||||
ship?: never;
|
||||
shipId?: ForeignKey<"ship">;
|
||||
})) & {
|
||||
pay$deposit?: OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">> | OakOperation<"create", Omit<Pay.CreateOperationData, "deposit" | "depositId">[]> | Array<OakOperation<"create", Omit<Pay.CreateOperationData, "deposit" | "depositId">> | OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">>>;
|
||||
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
|
||||
|
|
@ -142,7 +165,7 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "accountId" | "c
|
|||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "accountId" | "creatorId">> & (({
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "accountId" | "creatorId" | "shipId">> & (({
|
||||
account?: Account.CreateSingleOperation;
|
||||
accountId?: never;
|
||||
} | {
|
||||
|
|
@ -166,6 +189,18 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "accountId" | "c
|
|||
} | {
|
||||
creator?: never;
|
||||
creatorId?: ForeignKey<"creator">;
|
||||
}) & ({
|
||||
ship?: Ship.CreateSingleOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: Ship.UpdateOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: Ship.RemoveOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: never;
|
||||
shipId?: ForeignKey<"ship"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
pay$deposit?: OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">> | OakOperation<Pay.RemoveOperation["action"], Omit<Pay.RemoveOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">> | OakOperation<"create", Omit<Pay.CreateOperationData, "deposit" | "depositId">[]> | Array<OakOperation<"create", Omit<Pay.CreateOperationData, "deposit" | "depositId">> | OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">> | OakOperation<Pay.RemoveOperation["action"], Omit<Pay.RemoveOperationData, "deposit" | "depositId">, Omit<Pay.Filter, "deposit" | "depositId">>>;
|
||||
|
|
@ -176,11 +211,14 @@ export type RemoveOperationData = {} & (({
|
|||
account?: Account.UpdateOperation | Account.RemoveOperation;
|
||||
}) & ({
|
||||
creator?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
ship?: Ship.UpdateOperation | Ship.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type AccountIdSubQuery = Selection<AccountIdProjection>;
|
||||
export type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export type ShipIdSubQuery = Selection<ShipIdProjection>;
|
||||
export type DepositIdSubQuery = Selection<DepositIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,13 @@ export const desc = {
|
|||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
shipId: {
|
||||
type: "ref",
|
||||
ref: "ship"
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["depositing", "successful", "failed"]
|
||||
enumeration: ["depositing", "successful", "failed", "shipped"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ export const style = {
|
|||
depositing: '#3498DB',
|
||||
successful: '#52BE80',
|
||||
failed: '#5D6D7E',
|
||||
shipped: '#0000CD',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -6,17 +6,20 @@
|
|||
"loss": "充值损耗",
|
||||
"account": "充值帐户",
|
||||
"creator": "创建者",
|
||||
"opers": "关键账户操作"
|
||||
"opers": "关键账户操作",
|
||||
"ship": "虚拟物流"
|
||||
},
|
||||
"v": {
|
||||
"iState": {
|
||||
"depositing": "充值中",
|
||||
"successful": "充值成功",
|
||||
"failed": "充值失败"
|
||||
"failed": "充值失败",
|
||||
"shipped": "待用户确认"
|
||||
}
|
||||
},
|
||||
"action": {
|
||||
"succeed": "充值成功",
|
||||
"fail": "充值失败"
|
||||
"fail": "充值失败",
|
||||
"ship": "虚拟发货"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ import { EntityDef as OfflineAccount } from "./OfflineAccount/Schema";
|
|||
import { EntityDef as Order } from "./Order/Schema";
|
||||
import { EntityDef as Pay } from "./Pay/Schema";
|
||||
import { EntityDef as Refund } from "./Refund/Schema";
|
||||
import { EntityDef as Ship } from "./Ship/Schema";
|
||||
import { EntityDef as ShipCompany } from "./ShipCompany/Schema";
|
||||
import { EntityDef as ShipCompanySystem } from "./ShipCompanySystem/Schema";
|
||||
import { EntityDef as ShipOrder } from "./ShipOrder/Schema";
|
||||
import { EntityDef as SysAccountMove } from "./SysAccountMove/Schema";
|
||||
import { EntityDef as SysAccountOper } from "./SysAccountOper/Schema";
|
||||
import { EntityDef as WechatPay } from "./WechatPay/Schema";
|
||||
|
|
@ -140,6 +144,10 @@ export type EntityDict = {
|
|||
order: Order;
|
||||
pay: Pay;
|
||||
refund: Refund;
|
||||
ship: Ship;
|
||||
shipCompany: ShipCompany;
|
||||
shipCompanySystem: ShipCompanySystem;
|
||||
shipOrder: ShipOrder;
|
||||
sysAccountMove: SysAccountMove;
|
||||
sysAccountOper: SysAccountOper;
|
||||
wechatPay: WechatPay;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { Price, String, Text, Datetime, Boolean } from "oak-domain/lib/types/Dat
|
|||
import * as User from "../User/Schema";
|
||||
import * as System from "../System/Schema";
|
||||
import * as Pay from "../Pay/Schema";
|
||||
import * as ShipOrder from "../ShipOrder/Schema";
|
||||
import * as AccountOper from "../AccountOper/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
price: Price;
|
||||
|
|
@ -25,16 +26,20 @@ export type OpSchema = EntityShape & {
|
|||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
type Pay$orderAggr = "pay$order$$aggr" | "pay$order$$0$$aggr" | "pay$order$$1$$aggr" | "pay$order$$2$$aggr" | "pay$order$$3$$aggr" | "pay$order$$4$$aggr" | "pay$order$$5$$aggr" | "pay$order$$6$$aggr" | "pay$order$$7$$aggr" | "pay$order$$8$$aggr" | "pay$order$$9$$aggr";
|
||||
type ShipOrder$orderAggr = "shipOrder$order$$aggr" | "shipOrder$order$$0$$aggr" | "shipOrder$order$$1$$aggr" | "shipOrder$order$$2$$aggr" | "shipOrder$order$$3$$aggr" | "shipOrder$order$$4$$aggr" | "shipOrder$order$$5$$aggr" | "shipOrder$order$$6$$aggr" | "shipOrder$order$$7$$aggr" | "shipOrder$order$$8$$aggr" | "shipOrder$order$$9$$aggr";
|
||||
type AccountOper$entityAggr = "accountOper$entity$$aggr" | "accountOper$entity$$0$$aggr" | "accountOper$entity$$1$$aggr" | "accountOper$entity$$2$$aggr" | "accountOper$entity$$3$$aggr" | "accountOper$entity$$4$$aggr" | "accountOper$entity$$5$$aggr" | "accountOper$entity$$6$$aggr" | "accountOper$entity$$7$$aggr" | "accountOper$entity$$8$$aggr" | "accountOper$entity$$9$$aggr";
|
||||
export type Schema = OpSchema & {
|
||||
creator: User.Schema;
|
||||
system: System.Schema;
|
||||
pay$order?: Array<Pay.Schema>;
|
||||
shipOrder$order?: Array<ShipOrder.Schema>;
|
||||
accountOper$entity?: Array<AccountOper.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
} & {
|
||||
[A in Pay$orderAggr]?: AggregationResult<Pay.Schema>;
|
||||
} & {
|
||||
[A in ShipOrder$orderAggr]?: AggregationResult<ShipOrder.Schema>;
|
||||
} & {
|
||||
[A in AccountOper$entityAggr]?: AggregationResult<AccountOper.Schema>;
|
||||
};
|
||||
|
|
@ -59,6 +64,7 @@ type AttrFilter = {
|
|||
system: System.Filter;
|
||||
iState: Q_EnumValue<IState>;
|
||||
pay$order: Pay.Filter & SubQueryPredicateMetadata;
|
||||
shipOrder$order: ShipOrder.Filter & SubQueryPredicateMetadata;
|
||||
accountOper$entity: AccountOper.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
|
|
@ -87,6 +93,9 @@ export type Projection = {
|
|||
pay$order?: Pay.Selection & {
|
||||
$entity: "pay";
|
||||
};
|
||||
shipOrder$order?: ShipOrder.Selection & {
|
||||
$entity: "shipOrder";
|
||||
};
|
||||
accountOper$entity?: AccountOper.Selection & {
|
||||
$entity: "accountOper";
|
||||
};
|
||||
|
|
@ -94,6 +103,10 @@ export type Projection = {
|
|||
[A in Pay$orderAggr]?: Pay.Aggregation & {
|
||||
$entity: "pay";
|
||||
};
|
||||
} & {
|
||||
[A in ShipOrder$orderAggr]?: ShipOrder.Aggregation & {
|
||||
$entity: "shipOrder";
|
||||
};
|
||||
} & {
|
||||
[A in AccountOper$entityAggr]?: AccountOper.Aggregation & {
|
||||
$entity: "accountOper";
|
||||
|
|
@ -181,6 +194,7 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
[K: string]: any;
|
||||
}) & {
|
||||
pay$order?: OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">> | OakOperation<"create", Omit<Pay.CreateOperationData, "order" | "orderId">[]> | Array<OakOperation<"create", Omit<Pay.CreateOperationData, "order" | "orderId">> | OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">>>;
|
||||
shipOrder$order?: OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">> | OakOperation<"create", Omit<ShipOrder.CreateOperationData, "order" | "orderId">[]> | Array<OakOperation<"create", Omit<ShipOrder.CreateOperationData, "order" | "orderId">> | OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">>>;
|
||||
accountOper$entity?: OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<AccountOper.CreateOperationData, "entity" | "entityId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
|
|
@ -213,6 +227,7 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "creatorId" | "s
|
|||
})) & {
|
||||
[k: string]: any;
|
||||
pay$order?: OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">> | OakOperation<Pay.RemoveOperation["action"], Omit<Pay.RemoveOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">> | OakOperation<"create", Omit<Pay.CreateOperationData, "order" | "orderId">[]> | Array<OakOperation<"create", Omit<Pay.CreateOperationData, "order" | "orderId">> | OakOperation<Pay.UpdateOperation["action"], Omit<Pay.UpdateOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">> | OakOperation<Pay.RemoveOperation["action"], Omit<Pay.RemoveOperationData, "order" | "orderId">, Omit<Pay.Filter, "order" | "orderId">>>;
|
||||
shipOrder$order?: OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">> | OakOperation<ShipOrder.RemoveOperation["action"], Omit<ShipOrder.RemoveOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">> | OakOperation<"create", Omit<ShipOrder.CreateOperationData, "order" | "orderId">[]> | Array<OakOperation<"create", Omit<ShipOrder.CreateOperationData, "order" | "orderId">> | OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">> | OakOperation<ShipOrder.RemoveOperation["action"], Omit<ShipOrder.RemoveOperationData, "order" | "orderId">, Omit<ShipOrder.Filter, "order" | "orderId">>>;
|
||||
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>;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
import { ActionDef } from "oak-domain/lib/types/Action";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
export type IState = 'unshipped' | 'shipping' | 'givenUp' | 'received' | 'rejected' | string;
|
||||
export type IAction = 'ship' | 'receive' | 'giveUp' | 'reject' | string;
|
||||
export declare const IActionDef: ActionDef<IAction, IState>;
|
||||
export type ParticularAction = IAction;
|
||||
export declare const actions: string[];
|
||||
export type Action = GenericAction | ParticularAction | string;
|
||||
export declare const actionDefDict: {
|
||||
iState: ActionDef<string, string>;
|
||||
};
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
export const IActionDef = {
|
||||
stm: {
|
||||
ship: ['unshipped', 'shipping'],
|
||||
receive: ['shipping', 'received'],
|
||||
giveUp: [['unshipped', 'shipping'], 'givenUp'],
|
||||
reject: ['shipping', 'rejected'],
|
||||
},
|
||||
is: 'unshipped',
|
||||
};
|
||||
export const actions = ["count", "stat", "download", "select", "aggregate", "create", "remove", "update", "ship", "receive", "giveUp", "reject"];
|
||||
export const actionDefDict = {
|
||||
iState: IActionDef
|
||||
};
|
||||
|
|
@ -0,0 +1,253 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } 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, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Action, ParticularAction, IState } from "./Action";
|
||||
import { String, Int } from "oak-domain/lib/types/DataType";
|
||||
import * as ShipCompany from "../ShipCompany/Schema";
|
||||
import * as Address from "../Address/Schema";
|
||||
import * as Deposit from "../Deposit/Schema";
|
||||
import * as ShipOrder from "../ShipOrder/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
type: "virtual" | "pickup" | "express";
|
||||
shipCompanyId?: ForeignKey<"shipCompany"> | null;
|
||||
serial?: String<64> | null;
|
||||
toId?: ForeignKey<"address"> | null;
|
||||
fromId?: ForeignKey<"address"> | null;
|
||||
phantom1?: String<32> | null;
|
||||
phantom2?: String<32> | null;
|
||||
phantom3?: Int<4> | null;
|
||||
phantom4?: Int<8> | null;
|
||||
iState?: IState | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
type Deposit$shipAggr = "deposit$ship$$aggr" | "deposit$ship$$0$$aggr" | "deposit$ship$$1$$aggr" | "deposit$ship$$2$$aggr" | "deposit$ship$$3$$aggr" | "deposit$ship$$4$$aggr" | "deposit$ship$$5$$aggr" | "deposit$ship$$6$$aggr" | "deposit$ship$$7$$aggr" | "deposit$ship$$8$$aggr" | "deposit$ship$$9$$aggr";
|
||||
type ShipOrder$shipAggr = "shipOrder$ship$$aggr" | "shipOrder$ship$$0$$aggr" | "shipOrder$ship$$1$$aggr" | "shipOrder$ship$$2$$aggr" | "shipOrder$ship$$3$$aggr" | "shipOrder$ship$$4$$aggr" | "shipOrder$ship$$5$$aggr" | "shipOrder$ship$$6$$aggr" | "shipOrder$ship$$7$$aggr" | "shipOrder$ship$$8$$aggr" | "shipOrder$ship$$9$$aggr";
|
||||
export type Schema = OpSchema & {
|
||||
shipCompany?: ShipCompany.Schema | null;
|
||||
to?: Address.Schema | null;
|
||||
from?: Address.Schema | null;
|
||||
deposit$ship?: Array<Deposit.Schema>;
|
||||
shipOrder$ship?: Array<ShipOrder.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
} & {
|
||||
[A in Deposit$shipAggr]?: AggregationResult<Deposit.Schema>;
|
||||
} & {
|
||||
[A in ShipOrder$shipAggr]?: AggregationResult<ShipOrder.Schema>;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_NumberValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
type: Q_EnumValue<"virtual" | "pickup" | "express">;
|
||||
shipCompanyId: Q_StringValue;
|
||||
shipCompany: ShipCompany.Filter;
|
||||
serial: Q_StringValue;
|
||||
toId: Q_StringValue;
|
||||
to: Address.Filter;
|
||||
fromId: Q_StringValue;
|
||||
from: Address.Filter;
|
||||
phantom1: Q_StringValue;
|
||||
phantom2: Q_StringValue;
|
||||
phantom3: Q_NumberValue;
|
||||
phantom4: Q_NumberValue;
|
||||
iState: Q_EnumValue<IState>;
|
||||
deposit$ship: Deposit.Filter & SubQueryPredicateMetadata;
|
||||
shipOrder$ship: ShipOrder.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
type?: number;
|
||||
shipCompanyId?: number;
|
||||
shipCompany?: ShipCompany.Projection;
|
||||
serial?: number;
|
||||
toId?: number;
|
||||
to?: Address.Projection;
|
||||
fromId?: number;
|
||||
from?: Address.Projection;
|
||||
phantom1?: number;
|
||||
phantom2?: number;
|
||||
phantom3?: number;
|
||||
phantom4?: number;
|
||||
iState?: number;
|
||||
deposit$ship?: Deposit.Selection & {
|
||||
$entity: "deposit";
|
||||
};
|
||||
shipOrder$ship?: ShipOrder.Selection & {
|
||||
$entity: "shipOrder";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>> & {
|
||||
[A in Deposit$shipAggr]?: Deposit.Aggregation & {
|
||||
$entity: "deposit";
|
||||
};
|
||||
} & {
|
||||
[A in ShipOrder$shipAggr]?: ShipOrder.Aggregation & {
|
||||
$entity: "shipOrder";
|
||||
};
|
||||
};
|
||||
type ShipIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ShipCompanyIdProjection = OneOf<{
|
||||
shipCompanyId: number;
|
||||
}>;
|
||||
type AddressIdProjection = OneOf<{
|
||||
toId: number;
|
||||
fromId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
shipCompanyId: number;
|
||||
} | {
|
||||
shipCompany: ShipCompany.SortAttr;
|
||||
} | {
|
||||
serial: number;
|
||||
} | {
|
||||
toId: number;
|
||||
} | {
|
||||
to: Address.SortAttr;
|
||||
} | {
|
||||
fromId: number;
|
||||
} | {
|
||||
from: Address.SortAttr;
|
||||
} | {
|
||||
phantom1: number;
|
||||
} | {
|
||||
phantom2: number;
|
||||
} | {
|
||||
phantom3: number;
|
||||
} | {
|
||||
phantom4: number;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "shipCompanyId" | "toId" | "fromId">> & (({
|
||||
shipCompanyId?: never;
|
||||
shipCompany?: ShipCompany.CreateSingleOperation;
|
||||
} | {
|
||||
shipCompanyId: ForeignKey<"shipCompany">;
|
||||
shipCompany?: ShipCompany.UpdateOperation;
|
||||
} | {
|
||||
shipCompany?: never;
|
||||
shipCompanyId?: ForeignKey<"shipCompany">;
|
||||
}) & ({
|
||||
toId?: never;
|
||||
to?: Address.CreateSingleOperation;
|
||||
} | {
|
||||
toId: ForeignKey<"to">;
|
||||
to?: Address.UpdateOperation;
|
||||
} | {
|
||||
to?: never;
|
||||
toId?: ForeignKey<"to">;
|
||||
}) & ({
|
||||
fromId?: never;
|
||||
from?: Address.CreateSingleOperation;
|
||||
} | {
|
||||
fromId: ForeignKey<"from">;
|
||||
from?: Address.UpdateOperation;
|
||||
} | {
|
||||
from?: never;
|
||||
fromId?: ForeignKey<"from">;
|
||||
})) & {
|
||||
deposit$ship?: OakOperation<Deposit.UpdateOperation["action"], Omit<Deposit.UpdateOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">> | OakOperation<"create", Omit<Deposit.CreateOperationData, "ship" | "shipId">[]> | Array<OakOperation<"create", Omit<Deposit.CreateOperationData, "ship" | "shipId">> | OakOperation<Deposit.UpdateOperation["action"], Omit<Deposit.UpdateOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">>>;
|
||||
shipOrder$ship?: OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">> | OakOperation<"create", Omit<ShipOrder.CreateOperationData, "ship" | "shipId">[]> | Array<OakOperation<"create", Omit<ShipOrder.CreateOperationData, "ship" | "shipId">> | OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "shipCompanyId" | "toId" | "fromId">> & (({
|
||||
shipCompany?: ShipCompany.CreateSingleOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: ShipCompany.UpdateOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: ShipCompany.RemoveOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: never;
|
||||
shipCompanyId?: ForeignKey<"shipCompany"> | null;
|
||||
}) & ({
|
||||
to?: Address.CreateSingleOperation;
|
||||
toId?: never;
|
||||
} | {
|
||||
to?: Address.UpdateOperation;
|
||||
toId?: never;
|
||||
} | {
|
||||
to?: Address.RemoveOperation;
|
||||
toId?: never;
|
||||
} | {
|
||||
to?: never;
|
||||
toId?: ForeignKey<"to"> | null;
|
||||
}) & ({
|
||||
from?: Address.CreateSingleOperation;
|
||||
fromId?: never;
|
||||
} | {
|
||||
from?: Address.UpdateOperation;
|
||||
fromId?: never;
|
||||
} | {
|
||||
from?: Address.RemoveOperation;
|
||||
fromId?: never;
|
||||
} | {
|
||||
from?: never;
|
||||
fromId?: ForeignKey<"from"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
deposit$ship?: OakOperation<Deposit.UpdateOperation["action"], Omit<Deposit.UpdateOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">> | OakOperation<Deposit.RemoveOperation["action"], Omit<Deposit.RemoveOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">> | OakOperation<"create", Omit<Deposit.CreateOperationData, "ship" | "shipId">[]> | Array<OakOperation<"create", Omit<Deposit.CreateOperationData, "ship" | "shipId">> | OakOperation<Deposit.UpdateOperation["action"], Omit<Deposit.UpdateOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">> | OakOperation<Deposit.RemoveOperation["action"], Omit<Deposit.RemoveOperationData, "ship" | "shipId">, Omit<Deposit.Filter, "ship" | "shipId">>>;
|
||||
shipOrder$ship?: OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">> | OakOperation<ShipOrder.RemoveOperation["action"], Omit<ShipOrder.RemoveOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">> | OakOperation<"create", Omit<ShipOrder.CreateOperationData, "ship" | "shipId">[]> | Array<OakOperation<"create", Omit<ShipOrder.CreateOperationData, "ship" | "shipId">> | OakOperation<ShipOrder.UpdateOperation["action"], Omit<ShipOrder.UpdateOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">> | OakOperation<ShipOrder.RemoveOperation["action"], Omit<ShipOrder.RemoveOperationData, "ship" | "shipId">, Omit<ShipOrder.Filter, "ship" | "shipId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
shipCompany?: ShipCompany.UpdateOperation | ShipCompany.RemoveOperation;
|
||||
}) & ({
|
||||
to?: Address.UpdateOperation | Address.RemoveOperation;
|
||||
}) & ({
|
||||
from?: Address.UpdateOperation | Address.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ShipCompanyIdSubQuery = Selection<ShipCompanyIdProjection>;
|
||||
export type AddressIdSubQuery = Selection<AddressIdProjection>;
|
||||
export type ShipIdSubQuery = Selection<ShipIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<Action> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
ParticularAction: ParticularAction;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
import { actions } from "./Action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["virtual", "pickup", "express"]
|
||||
},
|
||||
shipCompanyId: {
|
||||
type: "ref",
|
||||
ref: "shipCompany"
|
||||
},
|
||||
serial: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
},
|
||||
toId: {
|
||||
type: "ref",
|
||||
ref: "address"
|
||||
},
|
||||
fromId: {
|
||||
type: "ref",
|
||||
ref: "address"
|
||||
},
|
||||
phantom1: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
phantom2: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
phantom3: {
|
||||
type: "int",
|
||||
params: {
|
||||
width: 4,
|
||||
signed: true
|
||||
}
|
||||
},
|
||||
phantom4: {
|
||||
type: "int",
|
||||
params: {
|
||||
width: 8,
|
||||
signed: true
|
||||
}
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["unshipped", "shipping", "givenUp", "received", "rejected"]
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
indexes: [
|
||||
{
|
||||
name: 'index_serial',
|
||||
attributes: [
|
||||
{
|
||||
name: 'serial',
|
||||
}
|
||||
],
|
||||
config: {
|
||||
unique: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'index_phantom1',
|
||||
attributes: [
|
||||
{
|
||||
name: 'phantom1',
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'index_phantom3',
|
||||
attributes: [
|
||||
{
|
||||
name: 'phantom3',
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { EntityDef } from "./Schema";
|
||||
import { StyleDef } from "oak-domain/lib/types/Style";
|
||||
export declare const style: StyleDef<EntityDef["OpSchema"], EntityDef["Action"]>;
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
export const style = {
|
||||
color: {
|
||||
iState: {
|
||||
unshipped: '#D2691E',
|
||||
shipping: '#1E90FF',
|
||||
received: '#90EE90',
|
||||
rejected: '#FF0000',
|
||||
givenUp: '#A9A9A9'
|
||||
},
|
||||
type: {
|
||||
virtual: '#EB984E',
|
||||
pickup: '#2ECC71',
|
||||
express: '#5DADE2',
|
||||
}
|
||||
},
|
||||
icon: {
|
||||
ship: '',
|
||||
receive: '',
|
||||
giveUp: '',
|
||||
reject: '',
|
||||
},
|
||||
};
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
"name": "物流公司系统连接",
|
||||
"attr": {
|
||||
"type": "物流类型",
|
||||
"shipCompany": "物流公司",
|
||||
"serial": "物流编号",
|
||||
"to": "收件地址",
|
||||
"from": "寄件地址",
|
||||
"iState": "状态",
|
||||
"phantom1": "索引项一",
|
||||
"phantom2": "索引项二",
|
||||
"phantom3": "索引项三",
|
||||
"phantom4": "索引项四"
|
||||
},
|
||||
"v": {
|
||||
"iState": {
|
||||
"unshipped": "未发货",
|
||||
"shipping": "发货中",
|
||||
"received": "已收货",
|
||||
"rejected": "已拒绝",
|
||||
"givenUp": "已放弃"
|
||||
},
|
||||
"type": {
|
||||
"virtual": "虚拟",
|
||||
"pickup": "自提",
|
||||
"express": "快递"
|
||||
}
|
||||
},
|
||||
"action": {
|
||||
"ship": "发货",
|
||||
"receive": "收货",
|
||||
"giveUp": "放弃",
|
||||
"reject": "拒收"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
import { Q_DateValue, Q_NumberValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } 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, AggregationResult, EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import * as Ship from "../Ship/Schema";
|
||||
import * as ShipCompanySystem from "../ShipCompanySystem/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
abbr: String<16>;
|
||||
wechatMpName?: String<4> | null;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
type Ship$shipCompanyAggr = "ship$shipCompany$$aggr" | "ship$shipCompany$$0$$aggr" | "ship$shipCompany$$1$$aggr" | "ship$shipCompany$$2$$aggr" | "ship$shipCompany$$3$$aggr" | "ship$shipCompany$$4$$aggr" | "ship$shipCompany$$5$$aggr" | "ship$shipCompany$$6$$aggr" | "ship$shipCompany$$7$$aggr" | "ship$shipCompany$$8$$aggr" | "ship$shipCompany$$9$$aggr";
|
||||
type ShipCompanySystem$shipCompanyAggr = "shipCompanySystem$shipCompany$$aggr" | "shipCompanySystem$shipCompany$$0$$aggr" | "shipCompanySystem$shipCompany$$1$$aggr" | "shipCompanySystem$shipCompany$$2$$aggr" | "shipCompanySystem$shipCompany$$3$$aggr" | "shipCompanySystem$shipCompany$$4$$aggr" | "shipCompanySystem$shipCompany$$5$$aggr" | "shipCompanySystem$shipCompany$$6$$aggr" | "shipCompanySystem$shipCompany$$7$$aggr" | "shipCompanySystem$shipCompany$$8$$aggr" | "shipCompanySystem$shipCompany$$9$$aggr";
|
||||
export type Schema = OpSchema & {
|
||||
ship$shipCompany?: Array<Ship.Schema>;
|
||||
shipCompanySystem$shipCompany?: Array<ShipCompanySystem.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
} & {
|
||||
[A in Ship$shipCompanyAggr]?: AggregationResult<Ship.Schema>;
|
||||
} & {
|
||||
[A in ShipCompanySystem$shipCompanyAggr]?: AggregationResult<ShipCompanySystem.Schema>;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_NumberValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
name: Q_StringValue;
|
||||
abbr: Q_StringValue;
|
||||
wechatMpName: Q_StringValue;
|
||||
ship$shipCompany: Ship.Filter & SubQueryPredicateMetadata;
|
||||
shipCompanySystem$shipCompany: ShipCompanySystem.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
name?: number;
|
||||
abbr?: number;
|
||||
wechatMpName?: number;
|
||||
ship$shipCompany?: Ship.Selection & {
|
||||
$entity: "ship";
|
||||
};
|
||||
shipCompanySystem$shipCompany?: ShipCompanySystem.Selection & {
|
||||
$entity: "shipCompanySystem";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>> & {
|
||||
[A in Ship$shipCompanyAggr]?: Ship.Aggregation & {
|
||||
$entity: "ship";
|
||||
};
|
||||
} & {
|
||||
[A in ShipCompanySystem$shipCompanyAggr]?: ShipCompanySystem.Aggregation & {
|
||||
$entity: "shipCompanySystem";
|
||||
};
|
||||
};
|
||||
type ShipCompanyIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
name: number;
|
||||
} | {
|
||||
abbr: number;
|
||||
} | {
|
||||
wechatMpName: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<OpSchema> & {
|
||||
ship$shipCompany?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "shipCompany" | "shipCompanyId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "shipCompany" | "shipCompanyId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">>>;
|
||||
shipCompanySystem$shipCompany?: OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "shipCompany" | "shipCompanyId">[]> | Array<OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "shipCompany" | "shipCompanyId">> | OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">>>;
|
||||
};
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
ship$shipCompany?: OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<"create", Omit<Ship.CreateOperationData, "shipCompany" | "shipCompanyId">[]> | Array<OakOperation<"create", Omit<Ship.CreateOperationData, "shipCompany" | "shipCompanyId">> | OakOperation<Ship.UpdateOperation["action"], Omit<Ship.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<Ship.RemoveOperation["action"], Omit<Ship.RemoveOperationData, "shipCompany" | "shipCompanyId">, Omit<Ship.Filter, "shipCompany" | "shipCompanyId">>>;
|
||||
shipCompanySystem$shipCompany?: OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<ShipCompanySystem.RemoveOperation["action"], Omit<ShipCompanySystem.RemoveOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "shipCompany" | "shipCompanyId">[]> | Array<OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "shipCompany" | "shipCompanyId">> | OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">> | OakOperation<ShipCompanySystem.RemoveOperation["action"], Omit<ShipCompanySystem.RemoveOperationData, "shipCompany" | "shipCompanyId">, Omit<ShipCompanySystem.Filter, "shipCompany" | "shipCompanyId">>>;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {};
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ShipCompanyIdSubQuery = Selection<ShipCompanyIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
name: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
abbr: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
}
|
||||
},
|
||||
wechatMpName: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 4
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"name": "物流公司",
|
||||
"attr": {
|
||||
"name": "名称",
|
||||
"abbr": "缩写",
|
||||
"wechatMpName": "小程序名称"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
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 { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as ShipCompany from "../ShipCompany/Schema";
|
||||
import * as System from "../System/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
shipCompanyId: ForeignKey<"shipCompany">;
|
||||
systemId: ForeignKey<"system">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = OpSchema & {
|
||||
shipCompany: ShipCompany.Schema;
|
||||
system: System.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_NumberValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
shipCompanyId: Q_StringValue;
|
||||
shipCompany: ShipCompany.Filter;
|
||||
systemId: Q_StringValue;
|
||||
system: System.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
shipCompanyId?: number;
|
||||
shipCompany?: ShipCompany.Projection;
|
||||
systemId?: number;
|
||||
system?: System.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ShipCompanySystemIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ShipCompanyIdProjection = OneOf<{
|
||||
shipCompanyId: number;
|
||||
}>;
|
||||
type SystemIdProjection = OneOf<{
|
||||
systemId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
shipCompanyId: number;
|
||||
} | {
|
||||
shipCompany: ShipCompany.SortAttr;
|
||||
} | {
|
||||
systemId: number;
|
||||
} | {
|
||||
system: System.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "shipCompanyId" | "systemId">> & (({
|
||||
shipCompanyId?: never;
|
||||
shipCompany: ShipCompany.CreateSingleOperation;
|
||||
} | {
|
||||
shipCompanyId: ForeignKey<"shipCompany">;
|
||||
shipCompany?: ShipCompany.UpdateOperation;
|
||||
} | {
|
||||
shipCompany?: never;
|
||||
shipCompanyId: ForeignKey<"shipCompany">;
|
||||
}) & ({
|
||||
systemId?: never;
|
||||
system: System.CreateSingleOperation;
|
||||
} | {
|
||||
systemId: ForeignKey<"system">;
|
||||
system?: System.UpdateOperation;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId: ForeignKey<"system">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "shipCompanyId" | "systemId">> & (({
|
||||
shipCompany?: ShipCompany.CreateSingleOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: ShipCompany.UpdateOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: ShipCompany.RemoveOperation;
|
||||
shipCompanyId?: never;
|
||||
} | {
|
||||
shipCompany?: never;
|
||||
shipCompanyId?: ForeignKey<"shipCompany">;
|
||||
}) & ({
|
||||
system?: System.CreateSingleOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: System.UpdateOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: System.RemoveOperation;
|
||||
systemId?: never;
|
||||
} | {
|
||||
system?: never;
|
||||
systemId?: ForeignKey<"system">;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
shipCompany?: ShipCompany.UpdateOperation | ShipCompany.RemoveOperation;
|
||||
}) & ({
|
||||
system?: System.UpdateOperation | System.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ShipCompanyIdSubQuery = Selection<ShipCompanyIdProjection>;
|
||||
export type SystemIdSubQuery = Selection<SystemIdProjection>;
|
||||
export type ShipCompanySystemIdSubQuery = Selection<ShipCompanySystemIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
shipCompanyId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "shipCompany"
|
||||
},
|
||||
systemId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "system"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "物流公司系统连接",
|
||||
"attr": {
|
||||
"shipCompany": "物流公司",
|
||||
"system": "系统连接"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
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 { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import * as Ship from "../Ship/Schema";
|
||||
import * as Order from "../Order/Schema";
|
||||
export type OpSchema = EntityShape & {
|
||||
shipId: ForeignKey<"ship">;
|
||||
orderId: ForeignKey<"order">;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
export type Schema = OpSchema & {
|
||||
ship: Ship.Schema;
|
||||
order: Order.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_NumberValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
shipId: Q_StringValue;
|
||||
ship: Ship.Filter;
|
||||
orderId: Q_StringValue;
|
||||
order: Order.Filter;
|
||||
};
|
||||
export type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
shipId?: number;
|
||||
ship?: Ship.Projection;
|
||||
orderId?: number;
|
||||
order?: Order.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
type ShipOrderIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
type ShipIdProjection = OneOf<{
|
||||
shipId: number;
|
||||
}>;
|
||||
type OrderIdProjection = OneOf<{
|
||||
orderId: number;
|
||||
}>;
|
||||
export type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
shipId: number;
|
||||
} | {
|
||||
ship: Ship.SortAttr;
|
||||
} | {
|
||||
orderId: number;
|
||||
} | {
|
||||
order: Order.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export type Sorter = SortNode[];
|
||||
export type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export type CreateOperationData = FormCreateData<Omit<OpSchema, "shipId" | "orderId">> & (({
|
||||
shipId?: never;
|
||||
ship: Ship.CreateSingleOperation;
|
||||
} | {
|
||||
shipId: ForeignKey<"ship">;
|
||||
ship?: Ship.UpdateOperation;
|
||||
} | {
|
||||
ship?: never;
|
||||
shipId: ForeignKey<"ship">;
|
||||
}) & ({
|
||||
orderId?: never;
|
||||
order: Order.CreateSingleOperation;
|
||||
} | {
|
||||
orderId: ForeignKey<"order">;
|
||||
order?: Order.UpdateOperation;
|
||||
} | {
|
||||
order?: never;
|
||||
orderId: ForeignKey<"order">;
|
||||
}));
|
||||
export type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "shipId" | "orderId">> & (({
|
||||
ship?: Ship.CreateSingleOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: Ship.UpdateOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: Ship.RemoveOperation;
|
||||
shipId?: never;
|
||||
} | {
|
||||
ship?: never;
|
||||
shipId?: ForeignKey<"ship">;
|
||||
}) & ({
|
||||
order?: Order.CreateSingleOperation;
|
||||
orderId?: never;
|
||||
} | {
|
||||
order?: Order.UpdateOperation;
|
||||
orderId?: never;
|
||||
} | {
|
||||
order?: Order.RemoveOperation;
|
||||
orderId?: never;
|
||||
} | {
|
||||
order?: never;
|
||||
orderId?: ForeignKey<"order">;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export type RemoveOperationData = {} & (({
|
||||
ship?: Ship.UpdateOperation | Ship.RemoveOperation;
|
||||
}) & ({
|
||||
order?: Order.UpdateOperation | Order.RemoveOperation;
|
||||
}));
|
||||
export type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export type ShipIdSubQuery = Selection<ShipIdProjection>;
|
||||
export type OrderIdSubQuery = Selection<OrderIdProjection>;
|
||||
export type ShipOrderIdSubQuery = Selection<ShipOrderIdProjection>;
|
||||
export type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
shipId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "ship"
|
||||
},
|
||||
orderId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "order"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"name": "物流订单连接表",
|
||||
"attr": {
|
||||
"ship": "物流",
|
||||
"order": "订单"
|
||||
}
|
||||
}
|
||||
|
|
@ -64,6 +64,10 @@ import { desc as offlineAccountDesc } from "./OfflineAccount/Storage";
|
|||
import { desc as orderDesc } from "./Order/Storage";
|
||||
import { desc as payDesc } from "./Pay/Storage";
|
||||
import { desc as refundDesc } from "./Refund/Storage";
|
||||
import { desc as shipDesc } from "./Ship/Storage";
|
||||
import { desc as shipCompanyDesc } from "./ShipCompany/Storage";
|
||||
import { desc as shipCompanySystemDesc } from "./ShipCompanySystem/Storage";
|
||||
import { desc as shipOrderDesc } from "./ShipOrder/Storage";
|
||||
import { desc as sysAccountMoveDesc } from "./SysAccountMove/Storage";
|
||||
import { desc as sysAccountOperDesc } from "./SysAccountOper/Storage";
|
||||
import { desc as wechatPayDesc } from "./WechatPay/Storage";
|
||||
|
|
@ -140,6 +144,10 @@ export const storageSchema = {
|
|||
order: orderDesc,
|
||||
pay: payDesc,
|
||||
refund: refundDesc,
|
||||
ship: shipDesc,
|
||||
shipCompany: shipCompanyDesc,
|
||||
shipCompanySystem: shipCompanySystemDesc,
|
||||
shipOrder: shipOrderDesc,
|
||||
sysAccountMove: sysAccountMoveDesc,
|
||||
sysAccountOper: sysAccountOperDesc,
|
||||
wechatPay: wechatPayDesc,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import { style as offlineAccount } from "./OfflineAccount/Style";
|
|||
import { style as order } from "./Order/Style";
|
||||
import { style as pay } from "./Pay/Style";
|
||||
import { style as refund } from "./Refund/Style";
|
||||
import { style as ship } from "./Ship/Style";
|
||||
import { style as sysAccountOper } from "./SysAccountOper/Style";
|
||||
import { style as user } from "./User/Style";
|
||||
import { style as withdraw } from "./Withdraw/Style";
|
||||
|
|
@ -77,6 +78,7 @@ export const styleDict = {
|
|||
order,
|
||||
pay,
|
||||
refund,
|
||||
ship,
|
||||
sysAccountOper,
|
||||
user,
|
||||
withdraw,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import * as UserSystem from "../UserSystem/Schema";
|
|||
import * as Account from "../Account/Schema";
|
||||
import * as OfflineAccount from "../OfflineAccount/Schema";
|
||||
import * as Order from "../Order/Schema";
|
||||
import * as ShipCompanySystem from "../ShipCompanySystem/Schema";
|
||||
import * as SysAccountMove from "../SysAccountMove/Schema";
|
||||
import * as WechatPay from "../WechatPay/Schema";
|
||||
import * as WithdrawAccount from "../WithdrawAccount/Schema";
|
||||
|
|
@ -58,6 +59,7 @@ type Account$ofSystemAggr = "account$ofSystem$$aggr" | "account$ofSystem$$0$$agg
|
|||
type Account$entityAggr = "account$entity$$aggr" | "account$entity$$0$$aggr" | "account$entity$$1$$aggr" | "account$entity$$2$$aggr" | "account$entity$$3$$aggr" | "account$entity$$4$$aggr" | "account$entity$$5$$aggr" | "account$entity$$6$$aggr" | "account$entity$$7$$aggr" | "account$entity$$8$$aggr" | "account$entity$$9$$aggr";
|
||||
type OfflineAccount$systemAggr = "offlineAccount$system$$aggr" | "offlineAccount$system$$0$$aggr" | "offlineAccount$system$$1$$aggr" | "offlineAccount$system$$2$$aggr" | "offlineAccount$system$$3$$aggr" | "offlineAccount$system$$4$$aggr" | "offlineAccount$system$$5$$aggr" | "offlineAccount$system$$6$$aggr" | "offlineAccount$system$$7$$aggr" | "offlineAccount$system$$8$$aggr" | "offlineAccount$system$$9$$aggr";
|
||||
type Order$systemAggr = "order$system$$aggr" | "order$system$$0$$aggr" | "order$system$$1$$aggr" | "order$system$$2$$aggr" | "order$system$$3$$aggr" | "order$system$$4$$aggr" | "order$system$$5$$aggr" | "order$system$$6$$aggr" | "order$system$$7$$aggr" | "order$system$$8$$aggr" | "order$system$$9$$aggr";
|
||||
type ShipCompanySystem$systemAggr = "shipCompanySystem$system$$aggr" | "shipCompanySystem$system$$0$$aggr" | "shipCompanySystem$system$$1$$aggr" | "shipCompanySystem$system$$2$$aggr" | "shipCompanySystem$system$$3$$aggr" | "shipCompanySystem$system$$4$$aggr" | "shipCompanySystem$system$$5$$aggr" | "shipCompanySystem$system$$6$$aggr" | "shipCompanySystem$system$$7$$aggr" | "shipCompanySystem$system$$8$$aggr" | "shipCompanySystem$system$$9$$aggr";
|
||||
type SysAccountMove$systemAggr = "sysAccountMove$system$$aggr" | "sysAccountMove$system$$0$$aggr" | "sysAccountMove$system$$1$$aggr" | "sysAccountMove$system$$2$$aggr" | "sysAccountMove$system$$3$$aggr" | "sysAccountMove$system$$4$$aggr" | "sysAccountMove$system$$5$$aggr" | "sysAccountMove$system$$6$$aggr" | "sysAccountMove$system$$7$$aggr" | "sysAccountMove$system$$8$$aggr" | "sysAccountMove$system$$9$$aggr";
|
||||
type WechatPay$systemAggr = "wechatPay$system$$aggr" | "wechatPay$system$$0$$aggr" | "wechatPay$system$$1$$aggr" | "wechatPay$system$$2$$aggr" | "wechatPay$system$$3$$aggr" | "wechatPay$system$$4$$aggr" | "wechatPay$system$$5$$aggr" | "wechatPay$system$$6$$aggr" | "wechatPay$system$$7$$aggr" | "wechatPay$system$$8$$aggr" | "wechatPay$system$$9$$aggr";
|
||||
type WithdrawAccount$ofSystemAggr = "withdrawAccount$ofSystem$$aggr" | "withdrawAccount$ofSystem$$0$$aggr" | "withdrawAccount$ofSystem$$1$$aggr" | "withdrawAccount$ofSystem$$2$$aggr" | "withdrawAccount$ofSystem$$3$$aggr" | "withdrawAccount$ofSystem$$4$$aggr" | "withdrawAccount$ofSystem$$5$$aggr" | "withdrawAccount$ofSystem$$6$$aggr" | "withdrawAccount$ofSystem$$7$$aggr" | "withdrawAccount$ofSystem$$8$$aggr" | "withdrawAccount$ofSystem$$9$$aggr";
|
||||
|
|
@ -76,6 +78,7 @@ export type Schema = OpSchema & {
|
|||
account$entity?: Array<Account.Schema>;
|
||||
offlineAccount$system?: Array<OfflineAccount.Schema>;
|
||||
order$system?: Array<Order.Schema>;
|
||||
shipCompanySystem$system?: Array<ShipCompanySystem.Schema>;
|
||||
sysAccountMove$system?: Array<SysAccountMove.Schema>;
|
||||
wechatPay$system?: Array<WechatPay.Schema>;
|
||||
withdrawAccount$ofSystem?: Array<WithdrawAccount.Schema>;
|
||||
|
|
@ -104,6 +107,8 @@ export type Schema = OpSchema & {
|
|||
[A in OfflineAccount$systemAggr]?: AggregationResult<OfflineAccount.Schema>;
|
||||
} & {
|
||||
[A in Order$systemAggr]?: AggregationResult<Order.Schema>;
|
||||
} & {
|
||||
[A in ShipCompanySystem$systemAggr]?: AggregationResult<ShipCompanySystem.Schema>;
|
||||
} & {
|
||||
[A in SysAccountMove$systemAggr]?: AggregationResult<SysAccountMove.Schema>;
|
||||
} & {
|
||||
|
|
@ -143,6 +148,7 @@ type AttrFilter = {
|
|||
account$entity: Account.Filter & SubQueryPredicateMetadata;
|
||||
offlineAccount$system: OfflineAccount.Filter & SubQueryPredicateMetadata;
|
||||
order$system: Order.Filter & SubQueryPredicateMetadata;
|
||||
shipCompanySystem$system: ShipCompanySystem.Filter & SubQueryPredicateMetadata;
|
||||
sysAccountMove$system: SysAccountMove.Filter & SubQueryPredicateMetadata;
|
||||
wechatPay$system: WechatPay.Filter & SubQueryPredicateMetadata;
|
||||
withdrawAccount$ofSystem: WithdrawAccount.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -199,6 +205,9 @@ export type Projection = {
|
|||
order$system?: Order.Selection & {
|
||||
$entity: "order";
|
||||
};
|
||||
shipCompanySystem$system?: ShipCompanySystem.Selection & {
|
||||
$entity: "shipCompanySystem";
|
||||
};
|
||||
sysAccountMove$system?: SysAccountMove.Selection & {
|
||||
$entity: "sysAccountMove";
|
||||
};
|
||||
|
|
@ -257,6 +266,10 @@ export type Projection = {
|
|||
[A in Order$systemAggr]?: Order.Aggregation & {
|
||||
$entity: "order";
|
||||
};
|
||||
} & {
|
||||
[A in ShipCompanySystem$systemAggr]?: ShipCompanySystem.Aggregation & {
|
||||
$entity: "shipCompanySystem";
|
||||
};
|
||||
} & {
|
||||
[A in SysAccountMove$systemAggr]?: SysAccountMove.Aggregation & {
|
||||
$entity: "sysAccountMove";
|
||||
|
|
@ -353,6 +366,7 @@ export type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "enti
|
|||
account$entity?: OakOperation<Account.UpdateOperation["action"], Omit<Account.UpdateOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Account.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Account.CreateOperationData, "entity" | "entityId">> | OakOperation<Account.UpdateOperation["action"], Omit<Account.UpdateOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">>>;
|
||||
offlineAccount$system?: OakOperation<OfflineAccount.UpdateOperation["action"], Omit<OfflineAccount.UpdateOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">> | OakOperation<"create", Omit<OfflineAccount.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<OfflineAccount.CreateOperationData, "system" | "systemId">> | OakOperation<OfflineAccount.UpdateOperation["action"], Omit<OfflineAccount.UpdateOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">>>;
|
||||
order$system?: OakOperation<Order.UpdateOperation["action"], Omit<Order.UpdateOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">> | OakOperation<"create", Omit<Order.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Order.CreateOperationData, "system" | "systemId">> | OakOperation<Order.UpdateOperation["action"], Omit<Order.UpdateOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">>>;
|
||||
shipCompanySystem$system?: OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">> | OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "system" | "systemId">> | OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">>>;
|
||||
sysAccountMove$system?: OakOperation<"create", Omit<SysAccountMove.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<SysAccountMove.CreateOperationData, "system" | "systemId">>>;
|
||||
wechatPay$system?: OakOperation<WechatPay.UpdateOperation["action"], Omit<WechatPay.UpdateOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">> | OakOperation<"create", Omit<WechatPay.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<WechatPay.CreateOperationData, "system" | "systemId">> | OakOperation<WechatPay.UpdateOperation["action"], Omit<WechatPay.UpdateOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">>>;
|
||||
withdrawAccount$ofSystem?: OakOperation<WithdrawAccount.UpdateOperation["action"], Omit<WithdrawAccount.UpdateOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">> | OakOperation<"create", Omit<WithdrawAccount.CreateOperationData, "ofSystem" | "ofSystemId">[]> | Array<OakOperation<"create", Omit<WithdrawAccount.CreateOperationData, "ofSystem" | "ofSystemId">> | OakOperation<WithdrawAccount.UpdateOperation["action"], Omit<WithdrawAccount.UpdateOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">>>;
|
||||
|
|
@ -387,6 +401,7 @@ export type UpdateOperationData = FormUpdateData<Omit<OpSchema, "platformId">> &
|
|||
account$entity?: OakOperation<Account.UpdateOperation["action"], Omit<Account.UpdateOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">> | OakOperation<Account.RemoveOperation["action"], Omit<Account.RemoveOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Account.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Account.CreateOperationData, "entity" | "entityId">> | OakOperation<Account.UpdateOperation["action"], Omit<Account.UpdateOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">> | OakOperation<Account.RemoveOperation["action"], Omit<Account.RemoveOperationData, "entity" | "entityId">, Omit<Account.Filter, "entity" | "entityId">>>;
|
||||
offlineAccount$system?: OakOperation<OfflineAccount.UpdateOperation["action"], Omit<OfflineAccount.UpdateOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">> | OakOperation<OfflineAccount.RemoveOperation["action"], Omit<OfflineAccount.RemoveOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">> | OakOperation<"create", Omit<OfflineAccount.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<OfflineAccount.CreateOperationData, "system" | "systemId">> | OakOperation<OfflineAccount.UpdateOperation["action"], Omit<OfflineAccount.UpdateOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">> | OakOperation<OfflineAccount.RemoveOperation["action"], Omit<OfflineAccount.RemoveOperationData, "system" | "systemId">, Omit<OfflineAccount.Filter, "system" | "systemId">>>;
|
||||
order$system?: OakOperation<Order.UpdateOperation["action"], Omit<Order.UpdateOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">> | OakOperation<Order.RemoveOperation["action"], Omit<Order.RemoveOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">> | OakOperation<"create", Omit<Order.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<Order.CreateOperationData, "system" | "systemId">> | OakOperation<Order.UpdateOperation["action"], Omit<Order.UpdateOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">> | OakOperation<Order.RemoveOperation["action"], Omit<Order.RemoveOperationData, "system" | "systemId">, Omit<Order.Filter, "system" | "systemId">>>;
|
||||
shipCompanySystem$system?: OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">> | OakOperation<ShipCompanySystem.RemoveOperation["action"], Omit<ShipCompanySystem.RemoveOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">> | OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<ShipCompanySystem.CreateOperationData, "system" | "systemId">> | OakOperation<ShipCompanySystem.UpdateOperation["action"], Omit<ShipCompanySystem.UpdateOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">> | OakOperation<ShipCompanySystem.RemoveOperation["action"], Omit<ShipCompanySystem.RemoveOperationData, "system" | "systemId">, Omit<ShipCompanySystem.Filter, "system" | "systemId">>>;
|
||||
sysAccountMove$system?: OakOperation<"create", Omit<SysAccountMove.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<SysAccountMove.CreateOperationData, "system" | "systemId">>>;
|
||||
wechatPay$system?: OakOperation<WechatPay.UpdateOperation["action"], Omit<WechatPay.UpdateOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">> | OakOperation<WechatPay.RemoveOperation["action"], Omit<WechatPay.RemoveOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">> | OakOperation<"create", Omit<WechatPay.CreateOperationData, "system" | "systemId">[]> | Array<OakOperation<"create", Omit<WechatPay.CreateOperationData, "system" | "systemId">> | OakOperation<WechatPay.UpdateOperation["action"], Omit<WechatPay.UpdateOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">> | OakOperation<WechatPay.RemoveOperation["action"], Omit<WechatPay.RemoveOperationData, "system" | "systemId">, Omit<WechatPay.Filter, "system" | "systemId">>>;
|
||||
withdrawAccount$ofSystem?: OakOperation<WithdrawAccount.UpdateOperation["action"], Omit<WithdrawAccount.UpdateOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">> | OakOperation<WithdrawAccount.RemoveOperation["action"], Omit<WithdrawAccount.RemoveOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">> | OakOperation<"create", Omit<WithdrawAccount.CreateOperationData, "ofSystem" | "ofSystemId">[]> | Array<OakOperation<"create", Omit<WithdrawAccount.CreateOperationData, "ofSystem" | "ofSystemId">> | OakOperation<WithdrawAccount.UpdateOperation["action"], Omit<WithdrawAccount.UpdateOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">> | OakOperation<WithdrawAccount.RemoveOperation["action"], Omit<WithdrawAccount.RemoveOperationData, "ofSystem" | "ofSystemId">, Omit<WithdrawAccount.Filter, "ofSystem" | "ofSystemId">>>;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,8 @@ export const desc = {
|
|||
type: "ref",
|
||||
ref: "platform"
|
||||
},
|
||||
folder: {
|
||||
folder // 提现的loss在用户提现时计算
|
||||
: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 16
|
||||
|
|
@ -28,8 +29,7 @@ export const desc = {
|
|||
super: {
|
||||
type: "boolean"
|
||||
},
|
||||
style // 如果为true,则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio,则全额退款)
|
||||
: {
|
||||
style: {
|
||||
type: "object"
|
||||
},
|
||||
entity // 如果为true,则按照渠道taxLossRatio和refundCompensateRatio进行扣取(如果因为depositLossRatio已经大于taxLossRatio,则全额退款)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export type OpSchema = EntityShape & {
|
|||
taxLossRatio?: Decimal<4, 2> | null;
|
||||
applicationId: ForeignKey<"application">;
|
||||
enabled: Boolean;
|
||||
shipping: Boolean;
|
||||
};
|
||||
export type OpAttr = keyof OpSchema;
|
||||
type ModiEntity$entityAggr = "modiEntity$entity$$aggr" | "modiEntity$entity$$0$$aggr" | "modiEntity$entity$$1$$aggr" | "modiEntity$entity$$2$$aggr" | "modiEntity$entity$$3$$aggr" | "modiEntity$entity$$4$$aggr" | "modiEntity$entity$$5$$aggr" | "modiEntity$entity$$6$$aggr" | "modiEntity$entity$$7$$aggr" | "modiEntity$entity$$8$$aggr" | "modiEntity$entity$$9$$aggr";
|
||||
|
|
@ -47,6 +48,7 @@ type AttrFilter = {
|
|||
applicationId: Q_StringValue;
|
||||
application: Application.Filter;
|
||||
enabled: Q_BooleanValue;
|
||||
shipping: Q_BooleanValue;
|
||||
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
||||
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
||||
pay$entity: Pay.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -66,6 +68,7 @@ export type Projection = {
|
|||
applicationId?: number;
|
||||
application?: Application.Projection;
|
||||
enabled?: number;
|
||||
shipping?: number;
|
||||
modiEntity$entity?: ModiEntity.Selection & {
|
||||
$entity: "modiEntity";
|
||||
};
|
||||
|
|
@ -119,6 +122,8 @@ export type SortAttr = {
|
|||
application: Application.SortAttr;
|
||||
} | {
|
||||
enabled: number;
|
||||
} | {
|
||||
shipping: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,10 @@ export const desc = {
|
|||
enabled: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
},
|
||||
shipping: {
|
||||
notNull: true,
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"application": "关联应用",
|
||||
"enabled": "有效中",
|
||||
"taxLossRatio": "产品手续费(百分比)",
|
||||
"shipping": "受发货限制",
|
||||
"pays": "支付"
|
||||
},
|
||||
"v": {
|
||||
|
|
|
|||
|
|
@ -64,6 +64,10 @@ import * as OfflineAccount from "./OfflineAccount/Schema";
|
|||
import * as Order from "./Order/Schema";
|
||||
import * as Pay from "./Pay/Schema";
|
||||
import * as Refund from "./Refund/Schema";
|
||||
import * as Ship from "./Ship/Schema";
|
||||
import * as ShipCompany from "./ShipCompany/Schema";
|
||||
import * as ShipCompanySystem from "./ShipCompanySystem/Schema";
|
||||
import * as ShipOrder from "./ShipOrder/Schema";
|
||||
import * as SysAccountMove from "./SysAccountMove/Schema";
|
||||
import * as SysAccountOper from "./SysAccountOper/Schema";
|
||||
import * as WechatPay from "./WechatPay/Schema";
|
||||
|
|
@ -232,7 +236,9 @@ export type UserRelationIdSubQuery = {
|
|||
}) | any;
|
||||
};
|
||||
export type AddressIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (Address.AddressIdSubQuery & {
|
||||
[K in "$in" | "$nin"]?: (Ship.AddressIdSubQuery & {
|
||||
entity: "ship";
|
||||
}) | (Address.AddressIdSubQuery & {
|
||||
entity: "address";
|
||||
}) | any;
|
||||
};
|
||||
|
|
@ -491,6 +497,8 @@ export type SystemIdSubQuery = {
|
|||
entity: "offlineAccount";
|
||||
}) | (Order.SystemIdSubQuery & {
|
||||
entity: "order";
|
||||
}) | (ShipCompanySystem.SystemIdSubQuery & {
|
||||
entity: "shipCompanySystem";
|
||||
}) | (SysAccountMove.SystemIdSubQuery & {
|
||||
entity: "sysAccountMove";
|
||||
}) | (WechatPay.SystemIdSubQuery & {
|
||||
|
|
@ -633,6 +641,8 @@ export type OfflineAccountIdSubQuery = {
|
|||
export type OrderIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (Pay.OrderIdSubQuery & {
|
||||
entity: "pay";
|
||||
}) | (ShipOrder.OrderIdSubQuery & {
|
||||
entity: "shipOrder";
|
||||
}) | (AccountOper.OrderIdSubQuery & {
|
||||
entity: "accountOper";
|
||||
}) | (Order.OrderIdSubQuery & {
|
||||
|
|
@ -659,6 +669,34 @@ export type RefundIdSubQuery = {
|
|||
entity: "refund";
|
||||
}) | any;
|
||||
};
|
||||
export type ShipIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (Deposit.ShipIdSubQuery & {
|
||||
entity: "deposit";
|
||||
}) | (ShipOrder.ShipIdSubQuery & {
|
||||
entity: "shipOrder";
|
||||
}) | (Ship.ShipIdSubQuery & {
|
||||
entity: "ship";
|
||||
}) | any;
|
||||
};
|
||||
export type ShipCompanyIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (Ship.ShipCompanyIdSubQuery & {
|
||||
entity: "ship";
|
||||
}) | (ShipCompanySystem.ShipCompanyIdSubQuery & {
|
||||
entity: "shipCompanySystem";
|
||||
}) | (ShipCompany.ShipCompanyIdSubQuery & {
|
||||
entity: "shipCompany";
|
||||
}) | any;
|
||||
};
|
||||
export type ShipCompanySystemIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ShipCompanySystem.ShipCompanySystemIdSubQuery & {
|
||||
entity: "shipCompanySystem";
|
||||
}) | any;
|
||||
};
|
||||
export type ShipOrderIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ShipOrder.ShipOrderIdSubQuery & {
|
||||
entity: "shipOrder";
|
||||
}) | any;
|
||||
};
|
||||
export type SysAccountMoveIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (SysAccountOper.SysAccountMoveIdSubQuery & {
|
||||
entity: "sysAccountOper";
|
||||
|
|
|
|||
|
|
@ -1 +1,5 @@
|
|||
export {};
|
||||
import { Trigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
declare const triggers: Trigger<EntityDict, 'deposit', BRC>[];
|
||||
export default triggers;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,148 @@
|
|||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import assert from 'assert';
|
||||
import { getPayClazz } from '../utils/payClazz';
|
||||
const triggers = [
|
||||
/* {
|
||||
entity: 'deposit',
|
||||
name: '当充值完成后,生成相应的accountOper',
|
||||
action: 'after',
|
||||
when: 'before',
|
||||
fn: async ({ operation }, context) => {
|
||||
// 先放到pay succeedPaying的trigger里去一并处理了
|
||||
return 0;
|
||||
/* {
|
||||
entity: 'deposit',
|
||||
name: '当充值完成后,生成相应的accountOper',
|
||||
action: 'after',
|
||||
when: 'before',
|
||||
fn: async ({ operation }, context) => {
|
||||
// 先放到pay succeedPaying的trigger里去一并处理了
|
||||
return 0;
|
||||
}
|
||||
} as UpdateTriggerInTxn<EntityDict, 'deposit', BRC> */
|
||||
{
|
||||
entity: 'deposit',
|
||||
name: '当受发货限制的deposit充值成功后,计算相应的account以及system account中的余额变化',
|
||||
action: 'succeed',
|
||||
when: 'after',
|
||||
asRoot: true,
|
||||
fn: async ({ operation }, context) => {
|
||||
const { data, filter } = operation;
|
||||
assert(typeof filter.id === 'string');
|
||||
const deposits = await context.select('deposit', {
|
||||
data: {
|
||||
id: 1,
|
||||
price: 1,
|
||||
loss: 1,
|
||||
accountId: 1,
|
||||
pay$deposit: {
|
||||
$entity: 'pay',
|
||||
data: {
|
||||
id: 1,
|
||||
paid: 1,
|
||||
price: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
iState: 1,
|
||||
orderId: 1,
|
||||
application: {
|
||||
systemId: 1,
|
||||
},
|
||||
refundable: 1,
|
||||
wpProduct: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
shipping: 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
filter,
|
||||
}, {});
|
||||
assert(deposits.length === 1);
|
||||
const [deposit] = deposits;
|
||||
const { pay$deposit: pays, price, loss } = deposit;
|
||||
let cnt = 1;
|
||||
if (pays && pays.length > 0) {
|
||||
for (const pay of pays) {
|
||||
const { price: payPrice, paid, application, entity, entityId, wpProduct } = pay;
|
||||
if (entity === 'wpProduct' && wpProduct?.shipping && pay.iState === 'paid') {
|
||||
//受发货限制的微信支付充值
|
||||
const clazz = await getPayClazz(entity, entityId, context);
|
||||
const [tax, sysAccountEntity, sysAccountEntityId] = clazz.calcPayTax(paid);
|
||||
await context.operate('sysAccountOper', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
delta: paid - tax,
|
||||
entity: sysAccountEntity,
|
||||
entityId: sysAccountEntityId,
|
||||
payId: pay.id,
|
||||
type: 'pay',
|
||||
}
|
||||
}, {});
|
||||
cnt++;
|
||||
if (tax !== 0) {
|
||||
// tax产生的损失由sys account来承担
|
||||
const [account] = await context.select('account', {
|
||||
data: {
|
||||
id: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: 'system',
|
||||
entityId: application.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: 'pay',
|
||||
entityId: pay.id,
|
||||
},
|
||||
}, {});
|
||||
}
|
||||
const accountOpers = [
|
||||
{
|
||||
id: await generateNewIdAsync(),
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
totalPlus: payPrice - loss,
|
||||
availPlus: payPrice - loss,
|
||||
refundablePlus: pay.refundable ? price : 0,
|
||||
accountId: deposit.accountId,
|
||||
type: 'deposit',
|
||||
},
|
||||
action: 'create',
|
||||
}
|
||||
];
|
||||
if (loss > 0) {
|
||||
// 如果有loss就充入system的account账户
|
||||
const [account] = await context.select('account', {
|
||||
data: {
|
||||
id: 1,
|
||||
},
|
||||
filter: {
|
||||
entity: 'system',
|
||||
entityId: application?.systemId,
|
||||
},
|
||||
}, { dontCollect: true });
|
||||
accountOpers.push({
|
||||
id: await generateNewIdAsync(),
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
totalPlus: loss,
|
||||
availPlus: loss,
|
||||
accountId: account.id,
|
||||
type: 'earn',
|
||||
},
|
||||
action: 'create',
|
||||
});
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
} as UpdateTriggerInTxn<EntityDict, 'deposit', BRC> */
|
||||
];
|
||||
export {};
|
||||
export default triggers;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@ import systemTriggers from './system';
|
|||
import abstractTriggers from './abstract';
|
||||
import withdrawAccountTriggers from './withdrawAccount';
|
||||
import withdrawTransferTriggers from './withdrawTransfer';
|
||||
import depositTriggers from './deposit';
|
||||
import shipTriggers from './ship';
|
||||
const triggers = [
|
||||
...shipTriggers,
|
||||
...depositTriggers,
|
||||
...withdrawTransferTriggers,
|
||||
...abstractTriggers,
|
||||
...aoTriggers,
|
||||
|
|
|
|||
|
|
@ -435,7 +435,7 @@ const triggers = [
|
|||
},
|
||||
},
|
||||
{
|
||||
name: '当pay完成支付时,计算相应的account以及system account中的余额变化,使deposit完成',
|
||||
name: '当pay完成支付时,计算相应的account以及system account中的余额变化,使deposit完成,对于受发货限制的微信支付创建ship',
|
||||
entity: 'pay',
|
||||
action: 'succeedPaying',
|
||||
when: 'after',
|
||||
|
|
@ -462,6 +462,11 @@ const triggers = [
|
|||
accountId: 1,
|
||||
},
|
||||
refundable: 1,
|
||||
wpProduct: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
shipping: 1,
|
||||
}
|
||||
};
|
||||
const pays = await context.select('pay', {
|
||||
data: projection,
|
||||
|
|
@ -469,9 +474,34 @@ const triggers = [
|
|||
}, {});
|
||||
assert(pays.length === 1);
|
||||
const [pay] = pays;
|
||||
const { price, paid, entity, entityId, iState, applicationId, application, depositId, deposit } = pay;
|
||||
const { price, paid, entity, entityId, iState, applicationId, application, depositId, deposit, wpProduct } = pay;
|
||||
assert(iState === 'paid' && paid === price);
|
||||
let cnt = 1;
|
||||
if (entity === 'wpProduct' && wpProduct && wpProduct.type === 'mp' && wpProduct.shipping) {
|
||||
//小程序支付受到发货限制,对deposit执行ship并级联创建虚拟发货的ship,系统账户的金额变化延后至确认收货后操作
|
||||
if (depositId) {
|
||||
//充值deposit执行ship,并创建关联的虚拟ship
|
||||
await context.operate('deposit', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'ship',
|
||||
data: {
|
||||
ship: {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: await generateNewIdAsync(),
|
||||
type: 'virtual'
|
||||
}
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
id: depositId,
|
||||
},
|
||||
}, {});
|
||||
cnt++;
|
||||
}
|
||||
return cnt;
|
||||
}
|
||||
if (entity !== 'account') {
|
||||
const clazz = await getPayClazz(entity, entityId, context);
|
||||
const [tax, sysAccountEntity, sysAccountEntityId] = clazz.calcPayTax(paid);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,5 @@
|
|||
import { Trigger } from 'oak-domain/lib/types/Trigger';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { BRC } from '../types/RuntimeCxt';
|
||||
declare const triggers: Trigger<EntityDict, 'ship', BRC>[];
|
||||
export default triggers;
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { DATA_SUBSCRIBER_KEYS } from '../config/constants';
|
||||
import { uploadShippingInfo } from '../utils/ship';
|
||||
const triggers = [
|
||||
{
|
||||
name: '当虚拟发货创建后自动发货',
|
||||
entity: 'ship',
|
||||
action: 'create',
|
||||
when: 'commit',
|
||||
asRoot: true,
|
||||
fn: async ({ ids }, context, option) => {
|
||||
for (const id of ids) {
|
||||
const [ship] = await context.select('ship', {
|
||||
data: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
deposit$ship: {
|
||||
$entity: 'deposit',
|
||||
data: {
|
||||
id: 1,
|
||||
iState: 1,
|
||||
}
|
||||
}
|
||||
},
|
||||
filter: {
|
||||
id,
|
||||
}
|
||||
}, {});
|
||||
const { type } = ship;
|
||||
if (type === 'virtual') {
|
||||
await context.operate('ship', {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'ship',
|
||||
data: {},
|
||||
filter: {
|
||||
id,
|
||||
}
|
||||
}, option);
|
||||
}
|
||||
}
|
||||
return;
|
||||
},
|
||||
},
|
||||
{
|
||||
entity: 'ship',
|
||||
name: '当虚拟的ship变为shipping状态时,调用小程序发货信息录入接口',
|
||||
action: 'ship',
|
||||
when: 'before',
|
||||
asRoot: true,
|
||||
priority: 99,
|
||||
fn: async ({ operation }, context) => {
|
||||
const { data, filter } = operation;
|
||||
const [ship] = await context.select('ship', {
|
||||
data: {
|
||||
id: 1,
|
||||
type: 1,
|
||||
deposit$ship: {
|
||||
$entity: 'deposit',
|
||||
data: {
|
||||
id: 1,
|
||||
pay$deposit: {
|
||||
$entity: 'pay',
|
||||
data: {
|
||||
id: 1,
|
||||
entity: 1,
|
||||
entityId: 1,
|
||||
meta: 1,
|
||||
applicationId: 1,
|
||||
},
|
||||
filter: {
|
||||
iState: 'paid',
|
||||
},
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
}
|
||||
},
|
||||
indexFrom: 0,
|
||||
count: 1,
|
||||
}
|
||||
},
|
||||
filter,
|
||||
}, {});
|
||||
const { type, deposit$ship: deposits } = ship || {};
|
||||
if (type === 'virtual') {
|
||||
const deposit = deposits?.[0];
|
||||
const result = await uploadShippingInfo({ depositId: deposit?.id, }, context);
|
||||
if (result) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
{
|
||||
entity: 'ship',
|
||||
name: '当ship状态发生变化时,尝试向订阅者推送',
|
||||
action: ['ship', 'receive', 'giveUp', 'reject'],
|
||||
when: 'after',
|
||||
fn: async ({ operation }, context, option) => {
|
||||
const { filter, id } = operation;
|
||||
const { id: shipId } = filter;
|
||||
if (shipId) {
|
||||
context.saveOperationToEvent(id, `${DATA_SUBSCRIBER_KEYS.shipStateChanged}-${shipId}`);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
];
|
||||
export default triggers;
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue