Application fully migrated to modular approach

This commit is contained in:
2025-09-13 21:30:40 +02:00
parent c7d6b33cd5
commit b9fe91ab88
38 changed files with 509 additions and 265 deletions

View File

@@ -18,7 +18,7 @@ logger = logging.getLogger(__name__)
# Shop Management Routes
@router.post("/shops", response_model=ShopResponse)
@router.post("/shop", response_model=ShopResponse)
def create_shop(
shop_data: ShopCreate,
db: Session = Depends(get_db),
@@ -35,7 +35,7 @@ def create_shop(
raise HTTPException(status_code=500, detail="Internal server error")
@router.get("/shops", response_model=ShopListResponse)
@router.get("/shop", response_model=ShopListResponse)
def get_shops(
skip: int = Query(0, ge=0),
limit: int = Query(100, ge=1, le=1000),
@@ -68,7 +68,7 @@ def get_shops(
raise HTTPException(status_code=500, detail="Internal server error")
@router.get("/shops/{shop_code}", response_model=ShopResponse)
@router.get("/shop/{shop_code}", response_model=ShopResponse)
def get_shop(shop_code: str, db: Session = Depends(get_db), current_user: User = Depends(get_current_user)):
"""Get shop details (Protected)"""
try:
@@ -82,7 +82,7 @@ def get_shop(shop_code: str, db: Session = Depends(get_db), current_user: User =
# Shop Product Management
@router.post("/shops/{shop_code}/products", response_model=ShopProductResponse)
@router.post("/shop/{shop_code}/products", response_model=ShopProductResponse)
def add_product_to_shop(
shop_code: str,
shop_product: ShopProductCreate,
@@ -112,7 +112,7 @@ def add_product_to_shop(
raise HTTPException(status_code=500, detail="Internal server error")
@router.get("/shops/{shop_code}/products")
@router.get("/shop/{shop_code}/products")
def get_shop_products(
shop_code: str,
skip: int = Query(0, ge=0),