"""Query filters for SearchItemsRequest."""

from pydantic import BaseModel

from olmoearth_shared.api.common.search_filters import (
    KeywordFilter,
    NumericFilter,
    SortDirection,
)
from olmoearth_shared.api.datasets.items import ItemSortField
from olmoearth_shared.models.datasets.instrument_mode import InstrumentMode
from olmoearth_shared.models.datasets.landsat_collection_category import (
    LandsatCollectionCategory,
)
from olmoearth_shared.models.datasets.orbit_direction import OrbitDirection
from olmoearth_shared.models.datasets.polarization import Polarization
from olmoearth_shared.models.datasets.satellite import Satellite


class SearchItemsQueryFilters(BaseModel):
    """Query filters for SearchItemsRequest.

    This model contains filter fields and sorting options from SearchItemsRequest,
    excluding fields that are set by the data source itself (id, collection,
    intersects_geometry, collected_at) and pagination fields.
    """

    satellite: KeywordFilter[Satellite] | None = None
    cloud_cover: NumericFilter | None = None
    mgrs_tile: KeywordFilter[str] | None = None
    wrs_path: NumericFilter | None = None
    wrs_row: NumericFilter | None = None
    collection_category: KeywordFilter[LandsatCollectionCategory] | None = None
    orbit_direction: KeywordFilter[OrbitDirection] | None = None
    relative_orbit: NumericFilter | None = None
    instrument_mode: KeywordFilter[InstrumentMode] | None = None
    polarizations: KeywordFilter[Polarization] | None = None
    sort_by: ItemSortField = ItemSortField.COLLECTED_AT
    sort_direction: SortDirection = SortDirection.ASC
