"""Composition helper: build the CombinedBookSource the settings select (the reversible cutover seam)."""
from __future__ import annotations

from fxhnt.application.combined_book_source import CombinedBookSource, RawFileSource, WarehouseSource
from fxhnt.config import Settings


def make_combined_book_source(settings: Settings, data_dir: str) -> CombinedBookSource:
    if settings.combined_book_data_source == "warehouse":
        from fxhnt.adapters.warehouse.duckdb_feature_store import DuckDbFeatureStore
        return WarehouseSource(DuckDbFeatureStore(settings.warehouse_path))
    return RawFileSource(data_dir)
