feat: consolidate media service, add merchant users page, fix metrics overlap
- Merge ImageService into MediaService with WebP variant generation, DB-backed storage stats, and module-driven media usage discovery via new MediaUsageProviderProtocol - Add merchant users admin page with scoped user listing, stats endpoint, template, JS, and i18n strings (de/en/fr/lb) - Fix merchant user metrics so Owners and Team Members are mutually exclusive (filter team_members on user_type="member" and exclude owner IDs) ensuring stat cards add up correctly - Update billing and monitoring services to use media_service - Update subscription-billing and feature-gating docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -243,6 +243,30 @@ async def admin_store_theme_page(
|
||||
)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# MERCHANT USER MANAGEMENT ROUTES (All Admins)
|
||||
# ============================================================================
|
||||
|
||||
|
||||
@router.get("/merchant-users", response_class=HTMLResponse, include_in_schema=False)
|
||||
async def admin_merchant_users_list_page(
|
||||
request: Request,
|
||||
current_user: User = Depends(
|
||||
require_menu_access("merchant-users", FrontendType.ADMIN)
|
||||
),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""
|
||||
Render merchant users management page.
|
||||
Shows list of all merchant users (owners and store team members).
|
||||
Visible to all admins.
|
||||
"""
|
||||
return templates.TemplateResponse(
|
||||
"tenancy/admin/merchant-users.html",
|
||||
get_admin_context(request, db, current_user),
|
||||
)
|
||||
|
||||
|
||||
# ============================================================================
|
||||
# ADMIN USER MANAGEMENT ROUTES (Super Admin Only)
|
||||
# ============================================================================
|
||||
|
||||
Reference in New Issue
Block a user