This commit is contained in:
2026-08-07 14:47:00 +08:00
parent 54fe05d864
commit 0bd872fdbf
12 changed files with 461 additions and 36 deletions
+59
View File
@@ -6,6 +6,8 @@ export type ApiPickupMethod = 'SELF_EXPRESS' | 'PICKUP' | 'SELF_TRUCK'
export type ApiTaxMode = 'BUY_DECLARATION' | 'TAX_REFUND'
export type ApiContainerMode = 'FULL_CONTAINER' | 'LCL'
export type ApiDestinationType = 'FBA' | 'OVERSEAS' | 'PRIVATE'
export type ApiPricingTaxMode = 'TAX_INCLUDED' | 'TAX_EXCLUDED'
export type ApiPriceModel = 'FBA_WAREHOUSE_RATE' | 'REGION_WEIGHT_TIER'
export interface PageResult<T> {
records: T[]
@@ -114,6 +116,7 @@ export interface FirstLegOrderSaveRequest {
receivingTime?: string | null
channelCode: string
channelName: string
pricingTaxMode: ApiPricingTaxMode
taxMode: ApiTaxMode
containerMode?: ApiContainerMode
customsInspection: boolean
@@ -143,6 +146,7 @@ export interface MerchantFirstLegOrder {
receivingTime?: string | null
channelCode: string
channelName: string
pricingTaxMode?: ApiPricingTaxMode | null
carrierId?: number | string | null
carrierName?: string | null
taxMode: ApiTaxMode
@@ -200,6 +204,45 @@ export interface FirstLegOrderQuery {
size?: number
}
export interface MerchantPricingChannel {
priceBookVersionId: number | string
channelCode: string
channelName: string
priceModel: ApiPriceModel
pricingTaxModes: ApiPricingTaxMode[]
estimatedDepartureDate: string | null
estimatedDepartureText: string | null
latestWarehouseEntry: string | null
referenceTransit: string | null
surchargeDescription: string | null
remark: string | null
}
export interface MerchantPriceEstimateRequest {
originWarehouseId: number | string
channelCode: string
destinationCode?: string
destinationType: Exclude<ApiDestinationType, 'PRIVATE'>
destinationWarehouseId?: number | string
destinationName?: string
pricingTaxMode: ApiPricingTaxMode
actualWeightKg: number
actualVolumeCbm: number
}
export interface MerchantPriceEstimate {
priceBookVersionId: number | string
channelCode: string
priceModel: ApiPriceModel
pricingTaxMode: ApiPricingTaxMode
chargeableQuantity: number
chargeUnit: string
unitPrice: number
estimatedAmount: number
currency: string
disclaimer: string
}
export function getMerchantWarehouses(params: MerchantWarehouseQuery = {}) {
return apiRequest<PageResult<MerchantWarehouse>>({
method: 'GET',
@@ -212,6 +255,22 @@ export function getMerchantWarehouseDetail(id: number | string) {
return apiRequest<MerchantWarehouseDetail>({ method: 'GET', url: `/merchant/v1/warehouses/${id}` })
}
export function getMerchantPricingChannels(originWarehouseId: number | string) {
return apiRequest<MerchantPricingChannel[]>({
method: 'GET',
url: '/merchant/v1/first-leg/pricing/channels',
params: { originWarehouseId },
})
}
export function estimateMerchantFirstLegPrice(payload: MerchantPriceEstimateRequest) {
return apiRequest<MerchantPriceEstimate>({
method: 'POST',
url: '/merchant/v1/first-leg/pricing/estimate',
data: payload,
})
}
export function getMerchantFirstLegOrders(params: FirstLegOrderQuery = {}) {
return apiRequest<PageResult<MerchantFirstLegOrder>>({ method: 'GET', url: '/merchant/v1/orders/first-leg', params: { page: 1, size: 200, ...params } })
}