# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class Opportunity(UniversalBaseModel):
    """
    Sales deal/potential revenue
    """

    name: str
    stage: str = pydantic.Field()
    """
    e.g., Prospecting, Qualification, Closed Won
    """

    close_date: str = pydantic.Field()
    """
    Expected close date (YYYY-MM-DD)
    """

    amount: typing.Optional[float] = None
    probability: typing.Optional[int] = None
    account_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Related account ID
    """

    type: typing.Optional[str] = pydantic.Field(default=None)
    """
    e.g., New Business, Renewal
    """

    source: typing.Optional[str] = pydantic.Field(default=None)
    """
    Lead source
    """

    next_step: typing.Optional[str] = None
    description: typing.Optional[str] = None

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
