from typing import Optional

from api_graphql.abc.filter.bool_filter import BoolFilter
from api_graphql.abc.filter.int_filter import IntFilter
from api_graphql.abc.filter.string_filter import StringFilter
from api_graphql.abc.filter_abc import FilterABC


class DbModelFilterABC[T](FilterABC[T]):
    def __init__(
        self,
        obj: Optional[dict],
    ):
        FilterABC.__init__(self, obj)

        self.add_field("id", IntFilter)
        self.add_field("deleted", BoolFilter)
        self.add_field("editor", IntFilter)
        self.add_field("createdUtc", StringFilter, "created")
        self.add_field("updatedUtc", StringFilter, "updated")
