45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
from datetime import datetime
|
|
from typing import Any
|
|
|
|
from orm.tables.events import EventState, EventStatus
|
|
from pydantic import Field, TypeAdapter
|
|
|
|
from api.schemas.base import Base
|
|
|
|
|
|
class ListEventUpdate(Base):
|
|
name: str | None = Field(None, max_length=40)
|
|
title: str | None = Field(None, max_length=64)
|
|
schema_: dict[str, Any] | None = Field(None, alias="schema")
|
|
state: EventState | None = None
|
|
status: EventStatus | None = None
|
|
|
|
|
|
class AllListEvent(Base):
|
|
id: int
|
|
name: str
|
|
title: str
|
|
creator_id: int
|
|
created_at: datetime
|
|
schema_: dict[str, Any] = Field(default={}, alias="schema")
|
|
state: EventState
|
|
status: EventStatus
|
|
|
|
|
|
class AllListEventResponse(Base):
|
|
list_event: list[AllListEvent]
|
|
amount_count: int
|
|
amount_pages: int
|
|
current_page: int
|
|
limit: int
|
|
|
|
|
|
all_list_event_adapter = TypeAdapter(list[AllListEvent])
|
|
|
|
|
|
class ListEventFilterDTO(Base):
|
|
pagination: dict[str, int]
|
|
search: str | None = None
|
|
order: dict[str, str] | None = None
|
|
filters: dict[str, list[str]] | None = None
|