export type PhotoMediaKind = 'image' | 'video' | 'live_photo' | 'audio';

export type PhotoProcessingStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'skipped';

export type PhotoFaceExtractionStatus =
  | 'pending'
  | 'processing'
  | 'completed'
  | 'failed'
  | 'skipped'
  | 'no_face';

export type PhotoClassificationStatus = 'pending' | 'processing' | 'completed' | 'failed';

export interface Photo {
  readonly id: string;
  readonly deviceId: string;
  readonly albumId: string | null;
  readonly externalId: string;
  readonly filename: string;
  /** MIME string ("image/jpeg") — predates the imajin port; not the enum. */
  readonly mediaType: string;
  /** Enum classifier — added in 2026-05-17 port. Nullable until backfilled. */
  readonly mediaKind: PhotoMediaKind | null;
  readonly mimeType: string | null;
  readonly width: number;
  readonly height: number;
  readonly duration: number | null;
  readonly takenAt: string | null;
  readonly modifiedAt: string | null;
  readonly importedAt: string;
  readonly storageBucket: string | null;
  readonly storageKey: string | null;
  readonly thumbnailKey: string | null;
  readonly previewKey: string | null;
  readonly latitude: number | null;
  readonly longitude: number | null;
  readonly locationName: string | null;
  readonly isFavorite: boolean;
  readonly isHidden: boolean;
  readonly isScreenshot: boolean;
  readonly isSelfie: boolean;
  readonly isBurst: boolean;
  readonly burstIdentifier: string | null;
  readonly exif: Readonly<Record<string, unknown>> | null;
  readonly contentHash: string | null;
  readonly processingStatus: PhotoProcessingStatus;
  readonly processingError: string | null;
  readonly category: string | null;
  readonly semanticTags: readonly string[] | null;
  readonly classificationStatus: PhotoClassificationStatus;
  readonly faceExtractionStatus: PhotoFaceExtractionStatus;
  readonly faceCount: number;
  readonly syncedAt: string;
}

export interface PhotoDraft {
  readonly id: string;
  readonly deviceId: string;
  readonly albumId?: string | null;
  readonly externalId: string;
  readonly filename: string;
  readonly mediaType: string;
  readonly mediaKind?: PhotoMediaKind | null;
  readonly mimeType?: string | null;
  readonly width: number;
  readonly height: number;
  readonly duration?: number | null;
  readonly takenAt?: string | null;
  readonly modifiedAt?: string | null;
  readonly storageBucket?: string | null;
  readonly storageKey?: string | null;
  readonly thumbnailKey?: string | null;
  readonly previewKey?: string | null;
  readonly latitude?: number | null;
  readonly longitude?: number | null;
  readonly locationName?: string | null;
  readonly isFavorite?: boolean;
  readonly isHidden?: boolean;
  readonly isScreenshot?: boolean;
  readonly isSelfie?: boolean;
  readonly isBurst?: boolean;
  readonly burstIdentifier?: string | null;
  readonly exif?: Readonly<Record<string, unknown>> | null;
  readonly contentHash?: string | null;
  readonly processingStatus?: PhotoProcessingStatus;
  readonly classificationStatus?: PhotoClassificationStatus;
  readonly faceExtractionStatus?: PhotoFaceExtractionStatus;
  readonly faceCount?: number;
  readonly category?: string | null;
  readonly semanticTags?: readonly string[] | null;
  readonly importedAt?: string;
}

export interface PhotoFilter {
  readonly deviceId?: string;
  readonly albumId?: string;
  readonly identityId?: string;
  readonly isFavorite?: boolean;
  readonly hasLocation?: boolean;
  readonly since?: string;
  readonly limit?: number;
}
