export type ModuleKey = "prenotazioni" | "menu" | "ordini" | "homemade";

export type ModuleStatus = "active" | "inactive" | "in-development";

export type ModuleKind = "legacy" | "platform";

export type ModulePreviewMode = "link" | "iframe" | "none";

export interface Tenant {
  id: string;
  name: string;
  slug: string;
  created_at: string;
}

export interface Venue {
  id: string;
  tenant_id: string;
  name: string;
  address: string;
  phone_number?: string | null;
  whatsapp_number?: string | null;
  created_at: string;
}

export interface User {
  id: string;
  tenant_id: string;
  name?: string | null;
  username?: string | null;
  email: string;
  phone_number?: string | null;
  role: string;
  created_at: string;
}

export interface Module {
  key: ModuleKey;
  name: string;
  description: string;
}

export interface TenantModule {
  id: string;
  tenant_id: string;
  module_key: ModuleKey;
  enabled: boolean;
  plan_name: string;
  activated_at: string | null;
  expires_at: string | null;
}

export interface ModuleDefinition extends Module {
  status: ModuleStatus;
  kind: ModuleKind;
  route_path: string;
  short_description: string;
  technical_notes: string[];
  future_integration_state: string;
  stack_summary: string;
  source_path: string | null;
  preview_mode: ModulePreviewMode;
}

export interface TenantContext {
  tenant: Tenant;
  venues: Venue[];
  users: User[];
  tenant_modules: TenantModule[];
}
