/** Product image domain model. */
export type ProductImageRole = 'main' | 'gallery';

export const PRODUCT_IMAGE_ROLES: readonly ProductImageRole[] = ['main', 'gallery'];

export interface ProductImage {
  id: string;
  productId: string;
  variantId: string | null;
  url: string;
  altText: string;
  position: number;
  role: ProductImageRole;
  createdAt: Date;
  updatedAt: Date;
}

export interface NewProductImage {
  url: string;
  altText: string;
  role: ProductImageRole;
  variantId?: string | null;
  position?: number;
}

export interface ProductImageOrderItem {
  imageId: string;
  position: number;
}

export interface ProductImageStorage {
  normalizeUrl(url: string): string;
}
