from dataclasses import (
    dataclass,
    field,
)
from typing import (
    List,
    Optional,
)

from boss.model import User


@dataclass
class Configs:

    @dataclass
    class ApiRetryPolicy:
        count: int = 1
        sleep: int = 1

    @dataclass
    class PumpCredentials:
        base_url: str = ""
        api_key: str = ""

    @dataclass
    class Endpoints:
        authenticate: str = ""

    otp_interval: int = 600
    database_path: str = ""
    required_services: str = ""
    api_retry_policy: Optional[ApiRetryPolicy] = None
    endpoints: Optional[Endpoints] = None
    pump_credentials: Optional[PumpCredentials] = None
    store_id: Optional[int] = None
    default_users: List[User] = field(default_factory=list)
    component_name: str = "boss"
    service_name: str = "UserControl"
