65 lines
3.1 KiB
TypeScript
65 lines
3.1 KiB
TypeScript
import { EntityDict } from "../../../oak-app-domain";
|
|
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
|
import BackendRuntimeContext from '../../../context/BackendRuntimeContext';
|
|
import ShipClazz from "../../../types/ShipClazz";
|
|
import { WechatMpInstance } from "oak-external-sdk";
|
|
import { AddExpressOrderData } from 'oak-external-sdk/lib/types/Wechat';
|
|
type ExtraAddExpressOrderData = Omit<AddExpressOrderData, 'order_id' | 'openid' | 'delivery_id' | 'add_source' | 'sender' | 'receiver' | 'service' | 'expect_time'>;
|
|
export default class WechatMpShipDebug<ED extends EntityDict & BaseEntityDict, Context extends BackendRuntimeContext<ED>> implements ShipClazz<ED, Context> {
|
|
private wechatMpShipId;
|
|
private wechatMpShip?;
|
|
getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
|
openId?: string;
|
|
appWxId?: string;
|
|
}>;
|
|
private getExtraData;
|
|
constructor(wechatMpShipId: string, getReceiverInfo: (orderIds: string[], applicationId: string, context: Context) => Promise<{
|
|
openId?: string;
|
|
appWxId?: string;
|
|
}>, getExtraData: (shipId: string, context: Context) => Promise<ExtraAddExpressOrderData>);
|
|
private getWechatMpShip;
|
|
available(shipServiceId: string, orderIds: string[], context: Context): Promise<boolean>;
|
|
protected getInstance(context: Context): Promise<WechatMpInstance>;
|
|
protected prepareOrder(shipId: string, context: Context): Promise<AddExpressOrderData>;
|
|
protected prepareCancelOrder(shipId: string, context: Context): Promise<{
|
|
openid: string | undefined;
|
|
delivery_id: string;
|
|
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
|
order_id: string;
|
|
}>;
|
|
protected prepareGetWaybillToken(shipId: string, context: Context): Promise<{
|
|
openid: string | undefined;
|
|
sender_phone: string;
|
|
receiver_phone: string;
|
|
delivery_id: string;
|
|
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
|
goods_info: {
|
|
detail_list: {
|
|
goods_name: string;
|
|
goods_img_url: string;
|
|
goods_desc?: string | undefined;
|
|
}[];
|
|
};
|
|
}>;
|
|
protected prepareGetPath(shipId: string, context: Context): Promise<{
|
|
openid: string | undefined;
|
|
delivery_id: string;
|
|
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
|
}>;
|
|
protected prepareGetOrder(shipId: string, context: Context): Promise<{
|
|
order_id: string;
|
|
openid: string | undefined;
|
|
delivery_id: string;
|
|
waybill_id: NonNullable<ED["ship"]["Schema"]["extraShipId"]>;
|
|
}>;
|
|
eOrder(shipId: string, context: Context): Promise<string>;
|
|
cancelOrder(shipId: string, context: Context): Promise<void>;
|
|
syncState(shipId: string, context: Context): Promise<EntityDict["ship"]["OpSchema"]["iState"]>;
|
|
syncPaths(shipId: string, context: Context): Promise<EntityDict["ship"]["OpSchema"]["extraPaths"]>;
|
|
getPrintInfo(shipId: string, context: Context): Promise<{
|
|
type: "html";
|
|
data: string;
|
|
}>;
|
|
}
|
|
export {};
|