// --- Tipos del Portal ---
export interface Listing {
  id: number;
  title: string;
  description: string;
  price: number;
  currency: string;
  categoryId: number;
  operationId: number;
  createdAt: string;
  mainImageUrl?: string;
  categoryName?: string;
  status: string;
  images?: ListingImage[];
  viewCount: number;
  overlayStatus?: 'Vendido' | 'Alquilado' | 'Reservado' | null;
  publicationStartDate?: string;
  approvedAt?: string;
  isFeatured?: boolean;
  featuredExpiry?: string;
  allowContact?: boolean;
  printDaysCount?: number;
}

export interface ListingAttribute {
  id: number;
  listingId: number;
  attributeDefinitionId: number;
  value: string;
  attributeName: string;
}

export interface ListingImage {
  id: number;
  listingId: number;
  url: string;
  isMainInfo: boolean;
  displayOrder: number;
}

export interface ListingDetail {
  listing: Listing;
  attributes: ListingAttribute[];
  images: ListingImage[];
}

// --- Tipos Agregados del Wizard ---
export interface Category {
  id: number;
  parentId?: number | null;
  name: string;
  slug: string;
  subcategories?: Category[];
}

export interface Operation {
  id: number;
  name: string;
}

export interface AttributeDefinition {
  id: number;
  name: string;
  dataType: 'text' | 'number' | 'boolean' | 'date';
  required: boolean;
}

// DTO para creación
export interface CreateListingDto {
  categoryId: number;
  operationId: number;
  title: string;
  description: string;
  price: number;
  adFee: number;
  currency: string;
  status: string;
  attributes: Record<number, string>;
  printText: string;
  printDaysCount: number;
  isBold?: boolean;
  isFrame?: boolean;
  printFontSize?: string;
  printAlignment?: string;
  imagesToClone?: string[];
  publicationStartDate?: string;
  isFeatured?: boolean;
  allowContact?: boolean;
  couponCode?: string;
}