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

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


class OrderRoundingAdjustment(UncheckedBaseModel):
    """
    A rounding adjustment of the money being returned. Commonly used to apply cash rounding
    when the minimum unit of the account is smaller than the lowest physical denomination of the currency.
    """

    uid: typing.Optional[str] = pydantic.Field(default=None)
    """
    A unique ID that identifies the rounding adjustment only within this order.
    """

    name: typing.Optional[str] = pydantic.Field(default=None)
    """
    The name of the rounding adjustment from the original sale order.
    """

    amount_money: typing.Optional[Money] = pydantic.Field(default=None)
    """
    The actual rounding adjustment amount.
    """

    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
