new init
This commit is contained in:
19
apps/backend/app/schemas/booking.py
Normal file
19
apps/backend/app/schemas/booking.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from pydantic import BaseModel
|
||||
from datetime import datetime
|
||||
|
||||
class BookingBase(BaseModel):
|
||||
user_id: int
|
||||
product_id: int
|
||||
amount: int
|
||||
total_cents: int
|
||||
comment: str | None = None
|
||||
|
||||
class BookingCreate(BookingBase):
|
||||
pass
|
||||
|
||||
class BookingOut(BookingBase):
|
||||
id: int
|
||||
timestamp: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True # Pydantic V2
|
Reference in New Issue
Block a user