export interface User {
  id: number
  email: string
  roles: string[]
  theme: string | null
  timezone: string
}

export interface Device {
  id: number
  mac: string
  name: string
  orientation: 'landscape' | 'portrait'
  rotationIntervalMinutes: number
  wakeHour: number | null
  timezone: string
  uniquenessWindow: number
  linkedAt: string
  lastSeenAt: string | null
  lockedImageId: number | null
  currentImageId: number | null
}

export interface CropParams {
  natX: number
  natY: number
  natW: number
  natH: number
}

export interface StickerLayer {
  id: string
  type: string
  x: number
  y: number
  scale: number
  rotation: number
}

export interface Image {
  id: number
  originalFilename: string
  thumbnailUrl: string
  originalUrl: string
  uploadedAt: string
  approvedDeviceIds: number[]
  cropParams: CropParams | null
  stickerState: StickerLayer[] | null
  cropOrientation: 'landscape' | 'portrait' | null
}

export interface RenderedAsset {
  id: number
  imageId: number
  deviceModel: string
  orientation: 'landscape' | 'portrait'
  status: 'pending' | 'processing' | 'ready' | 'failed'
}

export interface SharedImage {
  id: number
  imageId: number
  thumbnailUrl: string
  sharedBy: string
  sharedAt: string
  status: 'pending' | 'approved' | 'declined'
}

export interface SharedImagePage {
  items: SharedImage[]
  total: number
  page: number
  limit: number
  totalPages: number
}

export interface Token {
  uuid: string
  type: 'share_approve' | 'share_decline' | 'hard_delete_confirm'
  expiresAt: string
  usedAt: string | null
}

export interface ApiError {
  message: string
  errors?: Record<string, string[]>
}
