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

import typing_extensions
import typing_extensions
from ..types.cash_drawer_shift_state import CashDrawerShiftState
import typing
from .money import MoneyParams
from .cash_drawer_device import CashDrawerDeviceParams


class CashDrawerShiftParams(typing_extensions.TypedDict):
    """
    This model gives the details of a cash drawer shift.
    The cash_payment_money, cash_refund_money, cash_paid_in_money,
    and cash_paid_out_money fields are all computed by summing their respective
    event types.
    """

    id: typing_extensions.NotRequired[str]
    """
    The shift unique ID.
    """

    state: typing_extensions.NotRequired[CashDrawerShiftState]
    """
    The shift current state.
    See [CashDrawerShiftState](#type-cashdrawershiftstate) for possible values
    """

    opened_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The time when the shift began, in ISO 8601 format.
    """

    ended_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The time when the shift ended, in ISO 8601 format.
    """

    closed_at: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The time when the shift was closed, in ISO 8601 format.
    """

    description: typing_extensions.NotRequired[typing.Optional[str]]
    """
    The free-form text description of a cash drawer by an employee.
    """

    opened_cash_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money in the cash drawer at the start of the shift.
    The amount must be greater than or equal to zero.
    """

    cash_payment_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money added to the cash drawer from cash payments.
    This is computed by summing all events with the types CASH_TENDER_PAYMENT and
    CASH_TENDER_CANCELED_PAYMENT. The amount is always greater than or equal to
    zero.
    """

    cash_refunds_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money removed from the cash drawer from cash refunds.
    It is computed by summing the events of type CASH_TENDER_REFUND. The amount
    is always greater than or equal to zero.
    """

    cash_paid_in_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money added to the cash drawer for reasons other than cash
    payments. It is computed by summing the events of type PAID_IN. The amount is
    always greater than or equal to zero.
    """

    cash_paid_out_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money removed from the cash drawer for reasons other than
    cash refunds. It is computed by summing the events of type PAID_OUT. The amount
    is always greater than or equal to zero.
    """

    expected_cash_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money that should be in the cash drawer at the end of the
    shift, based on the shift's other money amounts.
    This can be negative if employees have not correctly recorded all the events
    on the cash drawer.
    cash_paid_out_money is a summation of amounts from cash_payment_money (zero
    or positive), cash_refunds_money (zero or negative), cash_paid_in_money (zero
    or positive), and cash_paid_out_money (zero or negative) event types.
    """

    closed_cash_money: typing_extensions.NotRequired[MoneyParams]
    """
    The amount of money found in the cash drawer at the end of the shift
    by an auditing employee. The amount should be positive.
    """

    device: typing_extensions.NotRequired[CashDrawerDeviceParams]
    """
    The device running Square Point of Sale that was connected to the cash drawer.
    """

    created_at: typing_extensions.NotRequired[str]
    """
    The shift start time in RFC 3339 format.
    """

    updated_at: typing_extensions.NotRequired[str]
    """
    The shift updated at time in RFC 3339 format.
    """

    location_id: typing_extensions.NotRequired[str]
    """
    The ID of the location the cash drawer shift belongs to.
    """

    team_member_ids: typing_extensions.NotRequired[typing.Sequence[str]]
    """
    The IDs of all team members that were logged into Square Point of Sale at any
    point while the cash drawer shift was open.
    """

    opening_team_member_id: typing_extensions.NotRequired[str]
    """
    The ID of the team member that started the cash drawer shift.
    """

    ending_team_member_id: typing_extensions.NotRequired[str]
    """
    The ID of the team member that ended the cash drawer shift.
    """

    closing_team_member_id: typing_extensions.NotRequired[str]
    """
    The ID of the team member that closed the cash drawer shift by auditing
    the cash drawer contents.
    """
