export interface FeieApiConfig {
  baseUrl?: string;
  user: string;
  ukey: string;
  timeout?: number;
  maxRetries?: number;
}

export interface FeiePrinterInfo {
  sn: string;
  key: string;
  name?: string;
  type?: '58mm' | '80mm';
}

export interface FeiePrintRequest {
  sn: string;
  content: string;
  times?: number;
}

export interface FeiePrintResponse {
  msg: string;
  ret: number;
  data: string;
  serverExecutedTime: number;
}

export interface FeiePrinterStatusResponse {
  msg: string;
  ret: number;
  data: Array<{
    sn: string;
    status: number;
    online: number;
    paper: number;
    heat: number;
  }>;
  serverExecutedTime: number;
}

export interface FeieOrderStatusResponse {
  msg: string;
  ret: number;
  data: string;
  serverExecutedTime: number;
}

export interface FeieAddPrinterResponse {
  msg: string;
  ret: number;
  data: string;
  serverExecutedTime: number;
}

export interface FeieDeletePrinterResponse {
  msg: string;
  ret: number;
  data: string;
  serverExecutedTime: number;
}

export enum PrinterStatus {
  ACTIVE = 'ACTIVE',
  INACTIVE = 'INACTIVE',
  ERROR = 'ERROR'
}

export enum PrintStatus {
  PENDING = 'PENDING',
  DELAYED = 'DELAYED',
  PRINTING = 'PRINTING',
  SUCCESS = 'SUCCESS',
  FAILED = 'FAILED',
  CANCELLED = 'CANCELLED'
}

export enum PrintType {
  RECEIPT = 'RECEIPT',
  SHIPPING = 'SHIPPING',
  ORDER = 'ORDER'
}

export enum CancelReason {
  REFUND = 'REFUND',
  MANUAL = 'MANUAL',
  TIMEOUT = 'TIMEOUT'
}

export interface CreatePrintTaskDto {
  orderId?: number;
  printerSn: string;
  content: string;
  printType: PrintType;
  delaySeconds?: number;
}

export interface PrinterDto {
  printerSn: string;
  printerKey: string;
  printerName?: string;
  printerType?: '58mm' | '80mm';
  isDefault?: boolean;
}

export interface UpdatePrinterDto {
  printerName?: string;
  printerType?: '58mm' | '80mm';
  printerStatus?: PrinterStatus;
  isDefault?: boolean;
}

export interface ConfigDto {
  configKey: string;
  configValue: string;
  configType: 'STRING' | 'JSON' | 'BOOLEAN' | 'NUMBER';
  description?: string;
}