Improve AI logic
This commit is contained in:
@@ -952,6 +952,28 @@ class ProductionService:
|
||||
raise
|
||||
|
||||
# Capacity Methods
|
||||
async def get_capacity_by_date(
|
||||
self,
|
||||
tenant_id: UUID,
|
||||
target_date: date
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""Get capacity entries for a specific date"""
|
||||
try:
|
||||
async with self.database_manager.get_session() as session:
|
||||
capacity_repo = ProductionCapacityRepository(session)
|
||||
|
||||
capacity_list = await capacity_repo.get_capacity_by_date(
|
||||
str(tenant_id), target_date
|
||||
)
|
||||
|
||||
# Convert to dictionaries for API response
|
||||
return [capacity.to_dict() for capacity in capacity_list]
|
||||
|
||||
except Exception as e:
|
||||
logger.error("Error getting capacity by date",
|
||||
error=str(e), tenant_id=str(tenant_id), date=target_date.isoformat())
|
||||
raise
|
||||
|
||||
async def get_capacity_list(
|
||||
self,
|
||||
tenant_id: UUID,
|
||||
|
||||
Reference in New Issue
Block a user