/**
 * 发票相关类型定义
 */

/** 发票类型 */
export type InvoiceType = 'normal' | 'special'

/** 发票状态 */
export type InvoiceStatus = 'pending' | 'approved' | 'rejected' | 'issued' | 'cancelled'

/** 发票抬头类型 */
export type InvoiceTitleType = 'personal' | 'enterprise'

/**
 * 发票抬头
 */
export interface InvoiceTitle {
  id?: number
  type?: InvoiceTitleType
  name?: string
  taxNo?: string
  bank?: string
  account?: string
  phone?: string
  address?: string
  email?: string
  isDefault?: boolean
  createTime?: string
}

/**
 * 发票申请
 */
export interface Invoice {
  id?: number
  invoiceNo?: string
  enterpriseId?: number
  enterpriseName?: string
  titleId?: number
  titleName?: string
  titleType?: InvoiceTitleType
  type?: InvoiceType
  amount?: number
  status?: InvoiceStatus
  billingNo?: string
  expressNo?: string
  remark?: string
  rejectReason?: string
  invoiceDate?: string
  createTime?: string
  updateTime?: string
}

/**
 * 发票申请参数
 */
export interface InvoiceApplyParam {
  titleId: number
  type: InvoiceType
  amount: number
  remark?: string
}

/**
 * 发票搜索参数
 */
export interface InvoiceParam {
  page?: number
  limit?: number
  enterpriseId?: number
  status?: InvoiceStatus
  type?: InvoiceType
  timeStart?: string
  timeEnd?: string
}
