export interface SharedWithOrg {
  organizationId: string;
  userId: string | null;
  organization: {
    id: string;
    name: string;
  };
  user?: {
    id: string;
    email: string;
  } | null;
}

export interface DownloadRequest {
  id: string;
  assetId: string;
  userId: string;
  status: string;
  createdAt: string;
  user?: {
    id: string;
    email: string;
  };
  asset?: {
    title: string;
  };
}

export interface Vertical {
  id: string;
  name: string;
  slug: string;
  icon?: string | null;
  description?: string | null;
  color?: string | null;
  orderIndex?: number;
  isActive?: boolean;
  _count?: {
    assets: number;
  };
}

export interface TaxonomyMeta {
  verticals: Vertical[];
  categories: { name: string; count: number }[];
  subcategories: { name: string; count: number }[];
  contentTypes: { name: string; count: number }[];
  tags: { name: string; count: number }[];
  totalAssets: number;
}

export interface AssetQueryFilters {
  search?: string;
  verticalIds?: string[];
  contentTypes?: string[];
  subcategories?: string[];
  tags?: string[];
  sortBy?: 'newest' | 'oldest' | 'title_asc' | 'title_desc' | 'type';
}

export interface Asset {
  id: string;
  title: string;
  type: string;
  size: number;
  url: string;
  version: number;
  uploadedBy: string;
  description: string | null;
  categoryId: string | null;
  subcategory: string | null;
  contentType?: string | null;
  tags: string[];
  downloadsCount: number;
  githubUrl: string | null;
  status: string;
  isDownloadable: boolean;
  thumbnailUrl?: string | null;
  problemStatement?: string | null;
  solution?: string | null;
  createdAt: string;
  verticals?: Vertical[];
  sharedWith?: SharedWithOrg[];
  downloadRequests?: DownloadRequest[];
}

export interface OrgUser {
  id: string;
  email: string;
  role: string;
}

export interface Organization {
  id: string;
  name: string;
  status: string;
  users?: OrgUser[];
}

export interface ShareItem {
  organizationId: string;
  userId: string | null;
}
