2026-07-30 17:59:42 +08:00
|
|
|
import { apiRequest } from '@/api/http'
|
|
|
|
|
|
2026-07-31 13:43:16 +08:00
|
|
|
export type MerchantPartnerType = 'CUSTOMER' | 'SUPPLIER' | 'BOTH'
|
2026-07-30 17:59:42 +08:00
|
|
|
|
|
|
|
|
export interface MerchantPartner {
|
|
|
|
|
id: number | string
|
|
|
|
|
partnerCode: string
|
|
|
|
|
partnerName: string
|
|
|
|
|
partnerType: MerchantPartnerType | string
|
|
|
|
|
contactName: string | null
|
|
|
|
|
contactPhone: string | null
|
|
|
|
|
contactEmail: string | null
|
|
|
|
|
countryCode: string | null
|
|
|
|
|
province: string | null
|
|
|
|
|
city: string | null
|
|
|
|
|
district: string | null
|
|
|
|
|
addressLine: string | null
|
|
|
|
|
postalCode: string | null
|
|
|
|
|
status: 'ACTIVE' | 'INACTIVE' | 'DISABLED' | string
|
|
|
|
|
}
|
|
|
|
|
|
2026-07-31 13:43:16 +08:00
|
|
|
export function getMerchantPartnerCandidates(type?: MerchantPartnerType, keyword?: string) {
|
2026-07-30 17:59:42 +08:00
|
|
|
return apiRequest<MerchantPartner[]>({
|
|
|
|
|
method: 'GET',
|
|
|
|
|
url: '/merchant/v1/partners/candidates',
|
|
|
|
|
params: { type, keyword: keyword?.trim() || undefined },
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function getMerchantPartner(id: number | string) {
|
|
|
|
|
return apiRequest<MerchantPartner>({ method: 'GET', url: `/merchant/v1/partners/${id}` })
|
|
|
|
|
}
|