refactor(P6): standardize route variable naming to router
Some checks failed
CI / ruff (push) Successful in 9s
CI / pytest (push) Has been cancelled
CI / validate (push) Has been cancelled
CI / dependency-scanning (push) Has been cancelled
CI / docs (push) Has been cancelled
CI / deploy (push) Has been cancelled

All route files (admin.py, store.py) now export `router` instead of
`admin_router`/`store_router`. Consumer code (definition.py, __init__.py)
imports as `router as admin_router` where distinction is needed.
ModuleDefinition fields remain admin_router/store_router.

64 files changed across all modules. Architecture rules, docs, and
migration plan updated. Added noqa:API001 support to validator for
pre-existing raw dict endpoints now visible with standardized router name.
All 1114 tests pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 11:05:34 +01:00
parent 8c0967e215
commit 30c4593e0f
65 changed files with 376 additions and 355 deletions

View File

@@ -28,7 +28,7 @@ from app.modules.tenancy.schemas.auth import UserContext
logger = logging.getLogger(__name__)
# Store router with module access control
store_router = APIRouter(
router = APIRouter(
prefix="/billing",
dependencies=[Depends(require_module_access("billing", FrontendType.STORE))],
)
@@ -39,7 +39,7 @@ store_router = APIRouter(
# ============================================================================
@store_router.get("/subscription", response_model=SubscriptionStatusResponse)
@router.get("/subscription", response_model=SubscriptionStatusResponse)
def get_subscription_status(
current_user: UserContext = Depends(get_current_store_api),
db: Session = Depends(get_db),
@@ -76,7 +76,7 @@ def get_subscription_status(
)
@store_router.get("/tiers", response_model=TierListResponse)
@router.get("/tiers", response_model=TierListResponse)
def get_available_tiers(
current_user: UserContext = Depends(get_current_store_api),
db: Session = Depends(get_db),
@@ -96,7 +96,7 @@ def get_available_tiers(
return TierListResponse(tiers=tier_responses, current_tier=current_tier_code)
@store_router.get("/invoices", response_model=InvoiceListResponse)
@router.get("/invoices", response_model=InvoiceListResponse)
def get_invoices(
skip: int = Query(0, ge=0),
limit: int = Query(20, ge=1, le=100),
@@ -138,7 +138,7 @@ from app.modules.billing.routes.api.store_checkout import store_checkout_router
from app.modules.billing.routes.api.store_features import store_features_router
from app.modules.billing.routes.api.store_usage import store_usage_router
store_router.include_router(store_features_router, tags=["store-features"])
store_router.include_router(store_checkout_router, tags=["store-billing"])
store_router.include_router(store_addons_router, tags=["store-billing-addons"])
store_router.include_router(store_usage_router, tags=["store-usage"])
router.include_router(store_features_router, tags=["store-features"])
router.include_router(store_checkout_router, tags=["store-billing"])
router.include_router(store_addons_router, tags=["store-billing-addons"])
router.include_router(store_usage_router, tags=["store-usage"])