"""Brand endpoint — frontend дёргает чтобы получить логотип/цвет для white-label."""

from __future__ import annotations

from typing import Annotated

from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session

from app.core.db import get_db
from app.services.brand import Brand, get_brand

router = APIRouter()


@router.get("/{slug}", response_model=Brand)
def lookup(slug: str, db: Annotated[Session, Depends(get_db)]) -> Brand:
    """GET /api/v1/brand/prinzip → {slug, name, primary_color, ...}.

    Не найден → fallback generic.
    """
    return get_brand(slug, db)
