From 0a82c846ce63844ba696a4cf78e7bd84cc9427cf Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 30 Jan 2026 23:29:38 +0100 Subject: [PATCH] refactor(customers): remove legacy route files, fully self-contained - Delete app/api/v1/admin/customers.py (no backward compatibility) - Delete app/api/v1/vendor/customers.py (no backward compatibility) - Remove legacy router aliases from module routes - Routes now fully self-contained in app/modules/customers/routes/ Co-Authored-By: Claude Opus 4.5 --- app/api/v1/admin/customers.py | 31 ----------------------- app/api/v1/vendor/customers.py | 35 -------------------------- app/modules/customers/routes/admin.py | 4 --- app/modules/customers/routes/vendor.py | 4 --- 4 files changed, 74 deletions(-) delete mode 100644 app/api/v1/admin/customers.py delete mode 100644 app/api/v1/vendor/customers.py diff --git a/app/api/v1/admin/customers.py b/app/api/v1/admin/customers.py deleted file mode 100644 index ab2533c5..00000000 --- a/app/api/v1/admin/customers.py +++ /dev/null @@ -1,31 +0,0 @@ -# app/api/v1/admin/customers.py -""" -LEGACY LOCATION - Re-exports from module for backwards compatibility. - -The canonical implementation is now in: - app/modules/customers/routes/admin.py - -This file exists to maintain backwards compatibility with code that -imports from the old location. All new code should import directly -from the module: - - from app.modules.customers.routes.admin import admin_router -""" - -from app.modules.customers.routes.admin import ( - admin_router, - router, - list_customers, - get_customer_stats, - get_customer, - toggle_customer_status, -) - -__all__ = [ - "admin_router", - "router", - "list_customers", - "get_customer_stats", - "get_customer", - "toggle_customer_status", -] diff --git a/app/api/v1/vendor/customers.py b/app/api/v1/vendor/customers.py deleted file mode 100644 index 3d7f26ff..00000000 --- a/app/api/v1/vendor/customers.py +++ /dev/null @@ -1,35 +0,0 @@ -# app/api/v1/vendor/customers.py -""" -LEGACY LOCATION - Re-exports from module for backwards compatibility. - -The canonical implementation is now in: - app/modules/customers/routes/vendor.py - -This file exists to maintain backwards compatibility with code that -imports from the old location. All new code should import directly -from the module: - - from app.modules.customers.routes.vendor import vendor_router -""" - -from app.modules.customers.routes.vendor import ( - vendor_router, - router, - get_vendor_customers, - get_customer_details, - get_customer_orders, - update_customer, - toggle_customer_status, - get_customer_statistics, -) - -__all__ = [ - "vendor_router", - "router", - "get_vendor_customers", - "get_customer_details", - "get_customer_orders", - "update_customer", - "toggle_customer_status", - "get_customer_statistics", -] diff --git a/app/modules/customers/routes/admin.py b/app/modules/customers/routes/admin.py index 545a3f90..685dc967 100644 --- a/app/modules/customers/routes/admin.py +++ b/app/modules/customers/routes/admin.py @@ -120,7 +120,3 @@ def toggle_customer_status( ) db.commit() return CustomerMessageResponse(message=result["message"]) - - -# Legacy alias for backwards compatibility -router = admin_router diff --git a/app/modules/customers/routes/vendor.py b/app/modules/customers/routes/vendor.py index 5b306db9..f6d0d30c 100644 --- a/app/modules/customers/routes/vendor.py +++ b/app/modules/customers/routes/vendor.py @@ -225,7 +225,3 @@ def get_customer_statistics( ) return CustomerStatisticsResponse(**stats) - - -# Legacy alias for backwards compatibility -router = vendor_router