// ============================================================
// Domain Entities — 业务实体定义
// Clean Architecture: Domain 层不依赖任何外部框架
// ============================================================

// ── Auth ────────────────────────────────────────────────────
export interface AdminUser {
  id: string;
  email: string;
  name: string;
  role: string;
}

export interface AuthTokens {
  accessToken: string;
  refreshToken: string;
  expiresIn: number;
}

// ── User ────────────────────────────────────────────────────
export type KycStatus = 'UNSUBMITTED' | 'PENDING' | 'APPROVED' | 'REJECTED';

export interface User {
  id: string;
  phone?: string;
  email?: string;
  name?: string;
  kycStatus: KycStatus;
  isActive: boolean;
  createdAt: string;
  updatedAt: string;
}

// ── Issuer ──────────────────────────────────────────────────
export type IssuerStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'SUSPENDED';

export interface Issuer {
  id: string;
  companyName: string;
  contactEmail: string;
  status: IssuerStatus;
  createdAt: string;
}

// ── AppVersion ──────────────────────────────────────────────
export type AppPlatform = 'ANDROID' | 'IOS';
export type AppType = 'GENEX_MOBILE' | 'ADMIN_APP';

export interface AppVersion {
  id: string;
  appType: AppType;
  platform: AppPlatform;
  versionName: string;
  versionCode: number;
  minOsVersion?: string;
  fileSize?: number;
  downloadUrl?: string;
  changelog?: string;
  isForceUpdate: boolean;
  isEnabled: boolean;
  releasedAt?: string;
  createdAt: string;
}

// ── Common ──────────────────────────────────────────────────
export interface PaginatedResult<T> {
  items: T[];
  total: number;
  page: number;
  pageSize: number;
}

export interface ApiResponse<T = unknown> {
  code: number;
  data: T;
  message: string;
}
