
- Implemented user authentication with JWT tokens - Created product management endpoints - Added shopping cart functionality - Implemented order management system - Setup database models with SQLAlchemy - Created alembic migrations - Added health check endpoint generated with BackendIM... (backend.im)
34 lines
547 B
Python
34 lines
547 B
Python
from typing import List, Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
from app.schemas.product import Product
|
|
|
|
|
|
class CartItemBase(BaseModel):
|
|
product_id: int
|
|
quantity: int = Field(..., gt=0)
|
|
|
|
|
|
class CartItemCreate(CartItemBase):
|
|
pass
|
|
|
|
|
|
class CartItemUpdate(BaseModel):
|
|
quantity: int = Field(..., gt=0)
|
|
|
|
|
|
class CartItemInDBBase(CartItemBase):
|
|
id: int
|
|
user_id: int
|
|
|
|
class Config:
|
|
orm_mode = True
|
|
|
|
|
|
class CartItem(CartItemInDBBase):
|
|
pass
|
|
|
|
|
|
class CartItemWithProduct(CartItemInDBBase):
|
|
product: Product |