Add subcription level filtering
This commit is contained in:
@@ -53,6 +53,22 @@ async def delete_user_tenants(request: Request, user_id: str = Path(...)):
|
||||
"""Get all tenant memberships for a user (admin only)"""
|
||||
return await _proxy_to_tenant_service(request, f"/api/v1/tenants/user/{user_id}/memberships")
|
||||
|
||||
# ================================================================
|
||||
# TENANT SUBSCRIPTION ENDPOINTS
|
||||
# ================================================================
|
||||
|
||||
@router.api_route("/{tenant_id}/subscriptions/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"])
|
||||
async def proxy_tenant_subscriptions(request: Request, tenant_id: str = Path(...), path: str = ""):
|
||||
"""Proxy tenant subscription requests to tenant service"""
|
||||
target_path = f"/api/v1/subscriptions/{tenant_id}/{path}".rstrip("/")
|
||||
return await _proxy_to_tenant_service(request, target_path)
|
||||
|
||||
@router.api_route("/subscriptions/plans", methods=["GET", "OPTIONS"])
|
||||
async def proxy_available_plans(request: Request):
|
||||
"""Proxy available plans request to tenant service"""
|
||||
target_path = "/api/v1/plans/available"
|
||||
return await _proxy_to_tenant_service(request, target_path)
|
||||
|
||||
# ================================================================
|
||||
# TENANT-SCOPED DATA SERVICE ENDPOINTS
|
||||
# ================================================================
|
||||
|
||||
Reference in New Issue
Block a user