@@ -1,6 +1,24 @@
|
||||
import type { FulfillmentProviderStatus, FulfillmentProviderType } from './enums';
|
||||
import type { WarehouseFulfillmentMode } from './enums';
|
||||
|
||||
/** 小飞侠仓配凭证(存 FulfillmentProvider.configJson) */
|
||||
export interface XiaofeixiaProviderConfig {
|
||||
apiUrl: string;
|
||||
mchId: string;
|
||||
apiKey: string;
|
||||
signType?: 'MD5' | 'HMAC-SHA256';
|
||||
appId?: string;
|
||||
}
|
||||
|
||||
/** 回显用(不含明文 apiKey) */
|
||||
export interface XiaofeixiaProviderConfigPublic {
|
||||
apiUrl: string;
|
||||
mchId: string;
|
||||
signType: 'MD5' | 'HMAC-SHA256';
|
||||
appId?: string;
|
||||
hasApiKey: boolean;
|
||||
}
|
||||
|
||||
export interface FulfillmentProviderDto {
|
||||
id: string;
|
||||
code: string;
|
||||
@@ -14,6 +32,8 @@ export interface FulfillmentProviderDto {
|
||||
cancel?: boolean;
|
||||
} | null;
|
||||
hasConfig: boolean;
|
||||
/** 小飞侠等承运商结构化配置(脱敏) */
|
||||
xiaofeixiaConfig?: XiaofeixiaProviderConfigPublic | null;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -25,6 +45,8 @@ export interface CreateFulfillmentProviderInput {
|
||||
status?: FulfillmentProviderStatus;
|
||||
configJson?: string;
|
||||
capabilitiesJson?: string;
|
||||
/** 结构化小飞侠配置;有则覆盖写入 configJson */
|
||||
xiaofeixiaConfig?: Partial<XiaofeixiaProviderConfig>;
|
||||
}
|
||||
|
||||
export interface UpdateFulfillmentProviderInput {
|
||||
@@ -33,6 +55,7 @@ export interface UpdateFulfillmentProviderInput {
|
||||
status?: FulfillmentProviderStatus;
|
||||
configJson?: string;
|
||||
capabilitiesJson?: string;
|
||||
xiaofeixiaConfig?: Partial<XiaofeixiaProviderConfig>;
|
||||
}
|
||||
|
||||
export interface ManualShipOrderInput {
|
||||
@@ -49,3 +72,9 @@ export interface WarehouseFulfillmentConfig {
|
||||
lng?: number | null;
|
||||
lat?: number | null;
|
||||
}
|
||||
|
||||
export const XFX_PROVIDER_CODES = ['XFX', 'XIAOFEIXIA'] as const;
|
||||
|
||||
export function isXfxProviderCode(code: string): boolean {
|
||||
return (XFX_PROVIDER_CODES as readonly string[]).includes(code.trim().toUpperCase());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user