export type Platform = 'android' | 'ios'

export interface AppVersion {
  id: string
  platform: Platform
  versionCode: number
  versionName: string
  buildNumber: string
  downloadUrl: string
  fileSize: string
  fileSha256: string
  changelog: string
  isForceUpdate: boolean
  isEnabled: boolean
  minOsVersion: string | null
  releaseDate: string | null
  createdAt: string
  updatedAt: string
}

export interface CreateVersionInput {
  platform: Platform
  versionCode: number
  versionName: string
  buildNumber: string
  downloadUrl: string
  fileSize: string
  fileSha256: string
  changelog: string
  isForceUpdate: boolean
  minOsVersion?: string
  releaseDate?: string
}

export interface UpdateVersionInput {
  downloadUrl?: string
  fileSize?: string
  fileSha256?: string
  changelog?: string
  isForceUpdate?: boolean
  isEnabled?: boolean
  minOsVersion?: string | null
  releaseDate?: string | null
}

export interface UploadVersionInput {
  file: File
  platform: Platform
  versionName: string
  buildNumber: string
  changelog?: string
  isForceUpdate?: boolean
  minOsVersion?: string
  releaseDate?: string
}

export interface VersionListFilter {
  platform?: Platform
  includeDisabled?: boolean
}

export interface ParsedPackageInfo {
  packageName: string
  versionCode: number
  versionName: string
  minSdkVersion?: string
  targetSdkVersion?: string
}
