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

from ..core.unchecked_base_model import UncheckedBaseModel
import typing
import pydantic
from .cash_drawer_shift_state import CashDrawerShiftState
from .money import Money
from ..core.pydantic_utilities import IS_PYDANTIC_V2


class CashDrawerShiftSummary(UncheckedBaseModel):
    """
    The summary of a closed cash drawer shift.
    This model contains only the money counted to start a cash drawer shift, counted
    at the end of the shift, and the amount that should be in the drawer at shift
    end based on summing all cash drawer shift events.
    """

    id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift unique ID.
    """

    state: typing.Optional[CashDrawerShiftState] = pydantic.Field(default=None)
    """
    The shift current state.
    See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values
    """

    opened_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift start time in ISO 8601 format.
    """

    ended_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift end time in ISO 8601 format.
    """

    closed_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift close time in ISO 8601 format.
    """

    description: typing.Optional[str] = pydantic.Field(default=None)
    """
    An employee free-text description of a cash drawer shift.
    """

    opened_cash_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The amount of money in the cash drawer at the start of the shift. This
    must be a positive amount.
    """

    expected_cash_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The amount of money that should be in the cash drawer at the end of the
    shift, based on the cash drawer events on the shift.
    The amount is correct if all shift employees accurately recorded their
    cash drawer shift events. Unrecorded events and events with the wrong amount
    result in an incorrect expected_cash_money amount that can be negative.
    """

    closed_cash_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The amount of money found in the cash drawer at the end of the shift by
    an auditing employee. The amount must be greater than or equal to zero.
    """

    created_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift start time in RFC 3339 format.
    """

    updated_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    The shift updated at time in RFC 3339 format.
    """

    location_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    The ID of the location the cash drawer shift belongs to.
    """

    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
