refactor: rename shop to storefront throughout codebase
Rename "shop" to "storefront" as not all platforms sell items - storefront is a more accurate term for the customer-facing interface. Changes: - Rename app/api/v1/shop/ → app/api/v1/storefront/ - Rename app/routes/shop_pages.py → app/routes/storefront_pages.py - Rename app/modules/cms/routes/api/shop.py → storefront.py - Rename tests/integration/api/v1/shop/ → storefront/ - Update API prefix from /api/v1/shop to /api/v1/storefront - Update route tags from shop-* to storefront-* - Rename get_shop_context() → get_storefront_context() - Update architecture rules to reference storefront paths - Update all test API endpoint paths This is Phase 2 of the storefront module restructure plan. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
# app/api/v1/shop/__init__.py
|
||||
# app/api/v1/storefront/__init__.py
|
||||
"""
|
||||
Shop API router aggregation.
|
||||
Storefront API router aggregation.
|
||||
|
||||
This module aggregates all shop-related JSON API endpoints (public facing).
|
||||
This module aggregates all storefront-related JSON API endpoints (public facing).
|
||||
Uses vendor context from middleware - no vendor_id in URLs.
|
||||
|
||||
Endpoints:
|
||||
@@ -16,48 +16,50 @@ Authentication:
|
||||
- Products, Cart, Content Pages: No auth required
|
||||
- Orders: Requires customer authentication (get_current_customer_api)
|
||||
- Auth: Public (login, register)
|
||||
|
||||
Note: Previously named "shop", renamed to "storefront" as not all platforms
|
||||
sell items - storefront is a more accurate term for the customer-facing interface.
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
# Import shop routers
|
||||
# Import storefront routers
|
||||
from . import addresses, auth, carts, messages, orders, products, profile
|
||||
|
||||
# CMS module router
|
||||
from app.modules.cms.routes.api.shop import router as cms_shop_router
|
||||
from app.modules.cms.routes.api.storefront import router as cms_storefront_router
|
||||
|
||||
# Create shop router
|
||||
# Create storefront router
|
||||
router = APIRouter()
|
||||
|
||||
# ============================================================================
|
||||
# SHOP API ROUTES (All vendor-context aware via middleware)
|
||||
# STOREFRONT API ROUTES (All vendor-context aware via middleware)
|
||||
# ============================================================================
|
||||
|
||||
# Addresses (authenticated)
|
||||
router.include_router(addresses.router, tags=["shop-addresses"])
|
||||
router.include_router(addresses.router, tags=["storefront-addresses"])
|
||||
|
||||
# Authentication (public)
|
||||
router.include_router(auth.router, tags=["shop-auth"])
|
||||
router.include_router(auth.router, tags=["storefront-auth"])
|
||||
|
||||
# Products (public)
|
||||
router.include_router(products.router, tags=["shop-products"])
|
||||
router.include_router(products.router, tags=["storefront-products"])
|
||||
|
||||
# Shopping cart (public - session based)
|
||||
router.include_router(carts.router, tags=["shop-cart"])
|
||||
router.include_router(carts.router, tags=["storefront-cart"])
|
||||
|
||||
# Orders (authenticated)
|
||||
router.include_router(orders.router, tags=["shop-orders"])
|
||||
router.include_router(orders.router, tags=["storefront-orders"])
|
||||
|
||||
# Messages (authenticated)
|
||||
router.include_router(messages.router, tags=["shop-messages"])
|
||||
router.include_router(messages.router, tags=["storefront-messages"])
|
||||
|
||||
# Profile (authenticated)
|
||||
router.include_router(profile.router, tags=["shop-profile"])
|
||||
router.include_router(profile.router, tags=["storefront-profile"])
|
||||
|
||||
# CMS module router (self-contained module)
|
||||
router.include_router(
|
||||
cms_shop_router, prefix="/content-pages", tags=["shop-content-pages"]
|
||||
cms_storefront_router, prefix="/content-pages", tags=["storefront-content-pages"]
|
||||
)
|
||||
# Legacy: content_pages.router moved to app.modules.cms.routes.api.shop
|
||||
|
||||
__all__ = ["router"]
|
||||
Reference in New Issue
Block a user