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

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2
from ..core.unchecked_base_model import UncheckedBaseModel
from .create_transfer_order_line_data import CreateTransferOrderLineData


class CreateTransferOrderData(UncheckedBaseModel):
    """
    Data for creating a new transfer order to move [CatalogItemVariation](entity:CatalogItemVariation)s
    between [Location](entity:Location)s. Used with the [CreateTransferOrder](api-endpoint:TransferOrders-CreateTransferOrder)
    endpoint.
    """

    source_location_id: str = pydantic.Field()
    """
    The source [Location](entity:Location) that will send the items. Must be an active location
    in your Square account with sufficient inventory of the requested items.
    """

    destination_location_id: str = pydantic.Field()
    """
    The destination [Location](entity:Location) that will receive the items. Must be an active location
    in your Square account
    """

    expected_at: typing.Optional[str] = pydantic.Field(default=None)
    """
    Expected transfer date in RFC 3339 format (e.g. "2023-10-01T12:00:00Z").
    """

    notes: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional notes about the transfer
    """

    tracking_number: typing.Optional[str] = pydantic.Field(default=None)
    """
    Optional shipment tracking number
    """

    created_by_team_member_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    ID of the [TeamMember](entity:TeamMember) creating this transfer order. Used for tracking
    and auditing purposes.
    """

    line_items: typing.Optional[typing.List[CreateTransferOrderLineData]] = pydantic.Field(default=None)
    """
    List of [CatalogItemVariation](entity:CatalogItemVariation)s to transfer, including quantities
    """

    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
