Improve the frontend and repository layer

This commit is contained in:
Urtzi Alfaro
2025-10-23 07:44:54 +02:00
parent 8d30172483
commit 07c33fa578
112 changed files with 14726 additions and 2733 deletions

View File

@@ -251,10 +251,33 @@ class RecipesServiceClient(BaseServiceClient):
error=str(e), tenant_id=tenant_id)
return []
# ================================================================
# COUNT AND STATISTICS
# ================================================================
async def count_recipes(self, tenant_id: str) -> int:
"""
Get the count of recipes for a tenant
Used for subscription limit tracking
Returns:
int: Number of recipes for the tenant
"""
try:
result = await self.get("recipes/count", tenant_id=tenant_id)
count = result.get('count', 0) if result else 0
logger.info("Retrieved recipe count from recipes service",
count=count, tenant_id=tenant_id)
return count
except Exception as e:
logger.error("Error getting recipe count",
error=str(e), tenant_id=tenant_id)
return 0
# ================================================================
# UTILITY METHODS
# ================================================================
async def health_check(self) -> bool:
"""Check if recipes service is healthy"""
try: