Repository: OpenBB-finance/OpenBBTerminal
File: openbb_platform/platform/provider/openbb_provider/standard_models/calendar_ipo.py (Python)

Code before:
"""IPO Calendar  data model."""

from datetime import (
    date as dateType,
    datetime,
)
from typing import Optional

from pydantic import Field, field_validator

from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams


class CalendarIpoQueryParams(QueryParams):
    """IPO Calendar Query Params."""

    symbol: Optional[str] = Field(
        description="Return IPOs with the given ticker (typically the IPO for the company).",
        default=None,
    )
    start_date: Optional[dateType] = Field(
        description="Return IPOs on or after the given date.",
        default=None,
    )
    end_date: Optional[dateType] = Field(
        description="Return IPOs on or before the given date.", default=None
    )
    limit: Optional[int] = Field(
        description="Limit the number of results returned by most recent.",
        default=300,
    )

    @field_validator("symbol", mode="before", check_fields=False)
    def upper_symbol(cls, v: str):
        """Convert symbol to uppercase."""
        return v.upper() if v else None

    @field_validator("start_date", mode="before", check_fields=False)
    def start_date_validate(cls, v):  # pylint: disable=E0213
        """Return the date as a datetime object."""
        return datetime.strftime(v, "%Y-%m-%d") if v else None

    @field_validator("end_date", mode="before", check_fields=False)
    def end_date_validate(cls, v):  # pylint: disable=E0213
        """Return the date as a datetime object."""
        return datetime.strftime(v, "%Y-%m-%d") if v else None


class CalendarIpoData(Data):
    """IPO Calendar Data."""

Review comment (suggestion):
So after a discussion with @IgorWounds the start/end _date (and limit?) should use the standardized descriptions here

Code after:
"""IPO Calendar  data model."""

from datetime import (
    date as dateType,
    datetime,
)
from typing import Optional

from pydantic import Field, field_validator

from openbb_provider.abstract.data import Data
from openbb_provider.abstract.query_params import QueryParams
from openbb_provider.utils.descriptions import DATA_DESCRIPTIONS, QUERY_DESCRIPTIONS


class CalendarIpoQueryParams(QueryParams):
    """IPO Calendar Query Params."""

    symbol: Optional[str] = Field(
        description=QUERY_DESCRIPTIONS.get("symbol", ""), default=None
    )
    start_date: Optional[dateType] = Field(
        description=QUERY_DESCRIPTIONS.get("start_date", ""), default=None
    )
    end_date: Optional[dateType] = Field(
        description=QUERY_DESCRIPTIONS.get("end_date", ""), default=None
    )
    limit: Optional[int] = Field(
        description=QUERY_DESCRIPTIONS.get("limit", ""), default=300
    )

    @field_validator("symbol", mode="before", check_fields=False)
    def upper_symbol(cls, v: str):
        """Convert symbol to uppercase."""
        return v.upper() if v else None

    @field_validator("start_date", mode="before", check_fields=False)
    def start_date_validate(cls, v):  # pylint: disable=E0213
        """Return the date as a datetime object."""
        return datetime.strftime(v, "%Y-%m-%d") if v else None

    @field_validator("end_date", mode="before", check_fields=False)
    def end_date_validate(cls, v):  # pylint: disable=E0213
        """Return the date as a datetime object."""
        return datetime.strftime(v, "%Y-%m-%d") if v else None


class CalendarIpoData(Data):
    """IPO Calendar Data."""

    ipo_date: Optional[dateType] = Field(