/**
 * 企业客户管理相关类型定义
 */

// 企业信息
export interface EnterpriseItem {
  id: number
  enterprise_code: string
  enterprise_name: string
  business_license: string
  legal_person: string
  province: string
  city: string
  district: string
  address: string
  contact_name: string
  contact_phone: string
  login_phone: string
  owner_shop_id: number | null
  owner_shop_name: string
  status: number // 0=禁用, 1=启用
  status_name: string
  created_at: string
}

// 企业客户分页结果
export interface EnterprisePageResult {
  items: EnterpriseItem[]
  page: number
  size: number
  total: number
}

// 查询企业客户列表参数
export interface EnterpriseQueryParams {
  id?: number
  page?: number
  page_size?: number
  enterprise_name?: string
  login_phone?: string
  contact_phone?: string
  owner_shop_id?: number | null
  status?: number | null
}

// 新增企业客户参数
export interface CreateEnterpriseParams {
  enterprise_code: string
  enterprise_name: string
  business_license?: string
  legal_person?: string
  province?: string
  city?: string
  district?: string
  address?: string
  contact_name: string
  contact_phone: string
  login_phone: string
  password: string
  owner_shop_id?: number | null
}

// 编辑企业信息参数
export interface UpdateEnterpriseParams {
  enterprise_code?: string
  enterprise_name?: string
  business_license?: string
  legal_person?: string
  province?: string
  city?: string
  district?: string
  address?: string
  contact_name?: string
  contact_phone?: string
  owner_shop_id?: number | null
}

// 修改企业账号密码参数
export interface UpdateEnterprisePasswordParams {
  password: string
}

// 启用/禁用企业参数
export interface UpdateEnterpriseStatusParams {
  status: 0 | 1
}

// 新增企业客户响应
export interface CreateEnterpriseResponse {
  account_id: number
  enterprise: EnterpriseItem
}
