Fix test failures and workload/websocket behavior
This commit is contained in:
@@ -5,9 +5,18 @@ from pydantic import BaseModel, Field
|
||||
|
||||
class FieldChangeCondition(BaseModel):
|
||||
"""Condition for field_change triggers."""
|
||||
field: str = Field(..., description="Field to check: status_id, assignee_id, priority")
|
||||
operator: str = Field(..., description="Operator: equals, not_equals, changed_to, changed_from")
|
||||
value: str = Field(..., description="Value to compare against")
|
||||
field: str = Field(..., description="Field to check: status_id, assignee_id, priority, start_date, due_date, custom_fields")
|
||||
operator: str = Field(..., description="Operator: equals, not_equals, changed_to, changed_from, before, after, in")
|
||||
value: Any = Field(..., description="Value to compare against")
|
||||
field_id: Optional[str] = Field(None, description="Custom field ID when field is custom_fields")
|
||||
|
||||
|
||||
class TriggerRule(BaseModel):
|
||||
"""Rule for composite field_change triggers."""
|
||||
field: str = Field(..., description="Field to check: status_id, assignee_id, priority, start_date, due_date, custom_fields")
|
||||
operator: str = Field(..., description="Operator: equals, not_equals, changed_to, changed_from, before, after, in")
|
||||
value: Any = Field(..., description="Value to compare against")
|
||||
field_id: Optional[str] = Field(None, description="Custom field ID when field is custom_fields")
|
||||
|
||||
|
||||
class ScheduleCondition(BaseModel):
|
||||
@@ -19,9 +28,12 @@ class ScheduleCondition(BaseModel):
|
||||
class TriggerCondition(BaseModel):
|
||||
"""Union condition that supports both field_change and schedule triggers."""
|
||||
# Field change conditions
|
||||
field: Optional[str] = Field(None, description="Field to check: status_id, assignee_id, priority")
|
||||
operator: Optional[str] = Field(None, description="Operator: equals, not_equals, changed_to, changed_from")
|
||||
value: Optional[str] = Field(None, description="Value to compare against")
|
||||
field: Optional[str] = Field(None, description="Field to check: status_id, assignee_id, priority, start_date, due_date, custom_fields")
|
||||
operator: Optional[str] = Field(None, description="Operator: equals, not_equals, changed_to, changed_from, before, after, in")
|
||||
value: Optional[Any] = Field(None, description="Value to compare against")
|
||||
field_id: Optional[str] = Field(None, description="Custom field ID when field is custom_fields")
|
||||
logic: Optional[str] = Field(None, description="Composite logic: and")
|
||||
rules: Optional[List[TriggerRule]] = None
|
||||
# Schedule conditions
|
||||
cron_expression: Optional[str] = Field(None, description="Cron expression for schedule triggers")
|
||||
deadline_reminder_days: Optional[int] = Field(None, ge=1, le=365, description="Days before due date to send reminder")
|
||||
@@ -37,7 +49,7 @@ class TriggerAction(BaseModel):
|
||||
"""
|
||||
type: str = Field(..., description="Action type: notify, update_field, auto_assign")
|
||||
# Notify action fields
|
||||
target: Optional[str] = Field(None, description="Target: assignee, creator, project_owner, user:<id>")
|
||||
target: Optional[str] = Field(None, description="Target: assignee, creator, project_owner, project_members, department:<id>, role:<name>, user:<id>")
|
||||
template: Optional[str] = Field(None, description="Message template with variables")
|
||||
# update_field action fields (FEAT-014)
|
||||
field: Optional[str] = Field(None, description="Field to update: priority, status_id, due_date")
|
||||
|
||||
Reference in New Issue
Block a user