fix(admin): align supplier carrier master data

This commit is contained in:
2026-08-27 10:12:20 +08:00
parent 29bb641524
commit 3e3c7e237a
14 changed files with 168 additions and 44 deletions
@@ -2,6 +2,7 @@ import { http, unwrapApiResponse, type ApiEnvelope } from '@/shared/api/http'
export type PlatformPartnerType = 'CARRIER' | 'SHIPPER' | 'CONSIGNEE'
export type PlatformPartnerStatus = 'ACTIVE' | 'INACTIVE'
export type PlatformPartnerCarrierCode = 'MATSON' | 'SML' | 'ZIM' | 'COSCO' | 'EMC' | 'HEDE' | 'OTHER'
export interface PlatformPartnerResource {
id: number | string
@@ -11,6 +12,7 @@ export interface PlatformPartnerResource {
partnerName: string
partnerType: PlatformPartnerType
types: PlatformPartnerType[]
carrierCode: PlatformPartnerCarrierCode | null
contactName: string
contactPhone: string
contactEmail: string | null
@@ -54,6 +56,7 @@ export interface SavePlatformPartnerRequest {
partnerName: string
partnerType: PlatformPartnerType
types: PlatformPartnerType[]
carrierCode: PlatformPartnerCarrierCode | null
contactName: string
contactPhone: string
contactEmail: string | null
@@ -89,6 +92,7 @@ function normalizePartner(resource: PlatformPartnerResource): PlatformPartnerRes
...resource,
dataScopeId: resource.dataScopeId ?? resource.tenantId,
types: resource.types?.length ? resource.types : [resource.partnerType],
carrierCode: resource.carrierCode ?? null,
remark: resource.remark ?? null,
}
}