from app.config import available_sources, logger
from app.models import AvailableSourcesResponse, ImportRequest, ImportResponse
from fastapi import APIRouter

import_router = APIRouter(prefix="/import", tags=["Import"])


@import_router.post("/", response_model=ImportResponse)
def import_data(request: ImportRequest):
    """
    Import data (e.g., text, files, or structured data).
    """
    logger.info(f"Receiver importation request: {request.type}")
    return ...


@import_router.get(
    "/available_sources", response_model=AvailableSourcesResponse
)
def get_available_sources():
    """
    Get available sources from database
    :return: Available sources in an AvailableSourcesResponse object
    """
    logger.info("Get available sources from database")
    return available_sources
