fix: use model slot types for agent status updates
This commit is contained in:
@@ -18,7 +18,7 @@ from sqlalchemy.orm import Session
|
|||||||
|
|
||||||
from app.api.deps import get_current_user
|
from app.api.deps import get_current_user
|
||||||
from app.core.config import get_db
|
from app.core.config import get_db
|
||||||
from app.models.calendar import SchedulePlan, SlotStatus, TimeSlot
|
from app.models.calendar import SchedulePlan, SlotStatus, SlotType, TimeSlot
|
||||||
from app.models.models import User
|
from app.models.models import User
|
||||||
from app.models.agent import Agent, AgentStatus, ExhaustReason
|
from app.models.agent import Agent, AgentStatus, ExhaustReason
|
||||||
from app.schemas.calendar import (
|
from app.schemas.calendar import (
|
||||||
@@ -378,9 +378,9 @@ def update_agent_status(
|
|||||||
if target == AgentStatus.IDLE.value:
|
if target == AgentStatus.IDLE.value:
|
||||||
transition_to_idle(db, agent)
|
transition_to_idle(db, agent)
|
||||||
elif target == AgentStatus.BUSY.value:
|
elif target == AgentStatus.BUSY.value:
|
||||||
transition_to_busy(db, agent, slot_type=SlotTypeEnum.WORK)
|
transition_to_busy(db, agent, slot_type=SlotType.WORK)
|
||||||
elif target == AgentStatus.ON_CALL.value:
|
elif target == AgentStatus.ON_CALL.value:
|
||||||
transition_to_busy(db, agent, slot_type=SlotTypeEnum.ON_CALL)
|
transition_to_busy(db, agent, slot_type=SlotType.ON_CALL)
|
||||||
elif target == AgentStatus.OFFLINE.value:
|
elif target == AgentStatus.OFFLINE.value:
|
||||||
transition_to_offline(db, agent)
|
transition_to_offline(db, agent)
|
||||||
elif target == AgentStatus.EXHAUSTED.value:
|
elif target == AgentStatus.EXHAUSTED.value:
|
||||||
|
|||||||
Reference in New Issue
Block a user