# Lead Management Data Models
from dataclasses import dataclass
from datetime import datetime
from typing import List, Optional, Dict, Any
from uuid import UUID

@dataclass
class Institution:
    id: UUID
    name: str
    metadata: Dict[str, Any]
    created_at: datetime
    updated_at: datetime
    created_by: str
    contact_count: Optional[int] = 0

@dataclass
class Contact:
    id: UUID
    institution_id: UUID
    first_name: str
    last_name: str
    position: Optional[str]
    extra_fields: Dict[str, Any]
    created_at: datetime
    updated_at: datetime
    institution_name: Optional[str] = None

@dataclass
class ContactDetail:
    id: UUID
    contact_id: UUID
    detail_type: str  # 'phone', 'email'
    detail_value: str
    detail_label: Optional[str]  # 'Mobil', 'Geschäftlich', etc.
    is_primary: bool
    created_at: datetime

@dataclass
class Note:
    id: UUID
    contact_id: UUID
    note_text: str
    version: int
    is_current: bool
    created_at: datetime
    created_by: str
    parent_note_id: Optional[UUID] = None