# 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 UpdateProductForCreditNote(UniversalBaseModel):
    old_price: typing.Optional[int] = pydantic.Field(default=None)
    """
    The old price of the line item. Used to choose for which line item new price should be applied
    """

    price_diff: typing.Optional[int] = pydantic.Field(default=None)
    """
    The price diff of the line item, i.e. applied discount
    """

    quantity: float = pydantic.Field()
    """
    The quantity of each of the goods, materials, or services listed in the receivable.
    """

    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
