barker/barker/barker/schemas/receive_payment.py

30 lines
679 B
Python

import uuid
from typing import Optional, List
from decimal import Decimal
from pydantic import BaseModel, Field
from barker.schemas import to_camel
from barker.schemas.customer import CustomerLink
from barker.schemas.modifier import ModifierLink
from barker.schemas.product import ProductLink
from barker.schemas.table import TableLink
from barker.schemas.tax import TaxLink
class ReceivePaymentItem(BaseModel):
id_: int
amount: Decimal
class Config:
fields = {"id_": "id"}
class ReceivePayment(BaseModel):
name: str
amounts: List[ReceivePaymentItem]
class Config:
alias_generator = to_camel
anystr_strip_whitespace = True