"""GraphQL filter input types for {{ model_name }}.

⚠️ AUTO-GENERATED BY PRISM - DO NOT EDIT
"""


import strawberry
{% if relationships or has_incoming_relations %}
from typing import Annotated, Optional
{% endif %}

from .common import StringFilter, IntFilter, FloatFilter, BoolFilter, DateTimeFilter, DateFilter


@strawberry.input(description="Filter conditions for {{ model_name }} fields")
class {{ model_name }}WhereInput:
    """Where input for filtering {{ model_name }} entities."""

    # ID filter
    id: IntFilter | None = None
{% for field in filter_fields %}
    {{ field.camel_name }}: {{ field.filter_type }} | None = None
{% endfor %}
{% for rel in relationships %}
    {{ rel.camel_name }}: Optional[Annotated["{{ rel.target_model }}ListRelationFilter", strawberry.lazy("{{ rel.lazy_module }}")]] = None
{% endfor %}

{% if has_incoming_relations %}

@strawberry.input(description="Filter {{ model_name }} list relation")
class {{ model_name }}ListRelationFilter:
    """Filter for {{ model_name }} list relations.

    - some: At least one related entity matches the filter
    - none: No related entities match the filter
    - every: All related entities match the filter
    """

    some: Optional[Annotated["{{ model_name }}WhereInput", strawberry.lazy("{{ self_lazy_module }}")]] = None
    none: Optional[Annotated["{{ model_name }}WhereInput", strawberry.lazy("{{ self_lazy_module }}")]] = None
    every: Optional[Annotated["{{ model_name }}WhereInput", strawberry.lazy("{{ self_lazy_module }}")]] = None
{% endif %}


__all__ = [
    "{{ model_name }}WhereInput",
{% if has_incoming_relations %}
    "{{ model_name }}ListRelationFilter",
{% endif %}
]
