export interface PlanFeature {
  id?: number;
  feature: string;
  highlight: boolean;
  icon?: string | null;
  sortOrder?: number;
}

export interface PlanLimits {
  apps: number;
  users: number;
  support: string;
}

/** Metadados extras do plano (planejamento, configurador, landing). */
export interface PlanLimitationsMeta {
  idealFor?: string[];
  appFormatId?: string;
  defaultModules?: string[];
  featureChecklist?: { label: string; included: boolean }[];
  emoji?: string;
  /** Preço único do planejamento (se diferente de monthlyPrice). */
  planningPrice?: number;
  planningPriceFrom?: boolean;
  screenEstimate?: string;
  structuralDescription?: string;
  planningNotice?: string;
  planningTimeline?: string;
  includes?: string[];
  /** Assinatura mensal de suporte técnico. */
  recurringMonthly?: boolean;
  technicalHoursPerMonth?: number;
}

export interface Plan {
  id: number;
  name: string;
  slug: string;
  catalog?: string;
  shortDescription?: string;
  fullDescription?: string;
  description: string;
  monthlyPrice: number;
  yearlyPrice: number;
  compareAtMonthly?: number | null;
  compareAtYearly?: number | null;
  setupFee: number;
  featured: boolean;
  badge?: string | null;
  buttonText?: string | null;
  buttonLink?: string | null;
  icon?: string | null;
  colors?: Record<string, string>;
  active: boolean;
  sortOrder: number;
  features: string[];
  planFeatures?: PlanFeature[];
  limits: PlanLimits;
  limitations?: PlanLimitationsMeta;
  seoTitle?: string | null;
  seoDescription?: string | null;
  createdAt?: string;
  updatedAt?: string;
}

export interface PlanFormValues {
  name: string;
  slug: string;
  shortDescription: string;
  fullDescription: string;
  monthlyPrice: number;
  yearlyPrice: number;
  compareAtMonthly: number | "";
  compareAtYearly: number | "";
  setupFee: number;
  featured: boolean;
  badge: string;
  buttonText: string;
  buttonLink: string;
  icon: string;
  active: boolean;
  limitsApps: number;
  limitsUsers: number;
  limitsSupport: string;
  seoTitle: string;
  seoDescription: string;
  planFeatures: { feature: string; highlight: boolean; icon: string }[];
  planningEmoji: string;
  planningPriceFrom: boolean;
  screenEstimate: string;
  structuralDescription: string;
  planningNotice: string;
  planningTimeline: string;
  idealForText: string;
}

export interface Addon {
  id: number;
  name: string;
  slug: string;
  catalog?: string;
  description?: string;
  price: number;
  compareAtPrice?: number | null;
  recurring: boolean;
  active: boolean;
  featured: boolean;
  badge?: string | null;
  buttonText?: string | null;
  colors?: Record<string, string>;
  icon?: string | null;
  sortOrder: number;
}

export interface PaginatedMeta {
  currentPage: number;
  lastPage: number;
  perPage: number;
  total: number;
}

export interface PaginatedApiResponse<T> {
  success: boolean;
  data: T[];
  meta: PaginatedMeta;
}
