from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any, Dict, Optional


@dataclass
class LicensePayload:
    customer_id: int = 0
    username: str = ""
    plan_type: str = ""
    max_pc_devices: int = 1
    max_web_sessions: int = 0
    is_ai_enabled: int = 0
    expiry_date: str = ""
    desktop_expiry_date: str = ""
    sync_expiry_date: str = ""
    sync_status: str = "disabled"
    web_mobile_enabled: int = 0
    license_status: str = "active"
    hardware_binding: str = ""
    hardware_binding_algorithm: str = ""
    issued_at: str = ""
    nonce: str = ""
    key_id: str = ""
    algorithm: str = "Ed25519"


@dataclass
class DeviceSessionInfo:
    session_uuid: str = ""
    device_id: Optional[int] = None
    device_name: str = ""
    device_type: str = "web"
    ip_address: str = ""
    login_at: str = ""
    last_active_at: str = ""
    expires_at: str = ""
    logout_at: str = ""
    logout_reason: str = ""
    is_active: bool = True


@dataclass
class BackupManifest:
    schema_version: str = "golder-backup-v2"
    created_at_utc: str = ""
    backup_type: str = "manual"
    customer_id: int = 0
    profile_id: str = ""
    profile_name: str = ""
    checksum_sha256: str = ""
    tables: Dict[str, Any] = field(default_factory=dict)
    profiles: Any = field(default_factory=list)


@dataclass
class ProfileSyncJob:
    job_id: str = ""
    profile_id: str = ""
    direction: str = "push"
    status: str = "pending"
    created_at: str = ""
    updated_at: str = ""
    last_error: str = ""
    retry_count: int = 0




