45 lines
845 B
Python
45 lines
845 B
Python
from datetime import datetime
|
|
|
|
from ninja import Schema
|
|
|
|
|
|
class SolutionIn(Schema):
|
|
title: str
|
|
problem_signature: str
|
|
related_system: str = ""
|
|
environment_scope: str = ""
|
|
root_cause: str
|
|
solution: str
|
|
risk_note: str = ""
|
|
status: str = "draft"
|
|
|
|
|
|
class SolutionOut(Schema):
|
|
id: int
|
|
title: str
|
|
problem_signature: str
|
|
related_system: str
|
|
environment_scope: str
|
|
root_cause: str
|
|
solution: str
|
|
risk_note: str
|
|
status: str
|
|
usage_count: int
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
|
|
class TicketSolutionLinkIn(Schema):
|
|
ticket_id: int
|
|
link_type: str = "referenced"
|
|
agent_run_id: int | None = None
|
|
|
|
|
|
class TicketSolutionLinkOut(Schema):
|
|
id: int
|
|
ticket_id: int
|
|
solution_id: int
|
|
link_type: str
|
|
solution_usage_count: int
|
|
created_at: datetime
|