feat(psa): add PSAResource, TicketCreatePayload types and abstract provider methods
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,9 @@ from app.services.psa.types import (
|
|||||||
PSATimeEntry,
|
PSATimeEntry,
|
||||||
PSABoard,
|
PSABoard,
|
||||||
PaginatedTicketResult,
|
PaginatedTicketResult,
|
||||||
|
PSAResource,
|
||||||
|
PSACreatedTicket,
|
||||||
|
TicketCreatePayload,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -75,3 +78,18 @@ class AutotaskProvider(PSAProvider):
|
|||||||
work_type: str | None = None,
|
work_type: str | None = None,
|
||||||
) -> PSATimeEntry:
|
) -> PSATimeEntry:
|
||||||
raise NotImplementedError("Autotask integration coming soon")
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|
||||||
|
async def list_resources(self, ticket_id: int) -> list[PSAResource]:
|
||||||
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|
||||||
|
async def add_resource(self, ticket_id: int, member_id: int) -> PSAResource:
|
||||||
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|
||||||
|
async def remove_resource(self, ticket_id: int, member_id: int) -> None:
|
||||||
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|
||||||
|
async def create_ticket(self, payload: TicketCreatePayload) -> PSACreatedTicket:
|
||||||
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|
||||||
|
async def list_priorities(self) -> list[dict]:
|
||||||
|
raise NotImplementedError("Autotask integration coming soon")
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ from .types import (
|
|||||||
PSATimeEntry,
|
PSATimeEntry,
|
||||||
PSABoard,
|
PSABoard,
|
||||||
PaginatedTicketResult,
|
PaginatedTicketResult,
|
||||||
|
PSAResource,
|
||||||
|
PSACreatedTicket,
|
||||||
|
TicketCreatePayload,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -84,3 +87,23 @@ class PSAProvider(ABC):
|
|||||||
work_type: str | None = None,
|
work_type: str | None = None,
|
||||||
) -> PSATimeEntry:
|
) -> PSATimeEntry:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def list_resources(self, ticket_id: int) -> list[PSAResource]:
|
||||||
|
...
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def add_resource(self, ticket_id: int, member_id: int) -> PSAResource:
|
||||||
|
...
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def remove_resource(self, ticket_id: int, member_id: int) -> None:
|
||||||
|
...
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def create_ticket(self, payload: TicketCreatePayload) -> PSACreatedTicket:
|
||||||
|
...
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
async def list_priorities(self) -> list[dict]:
|
||||||
|
...
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ from app.services.psa.types import (
|
|||||||
PSATimeEntry,
|
PSATimeEntry,
|
||||||
PSABoard,
|
PSABoard,
|
||||||
PaginatedTicketResult,
|
PaginatedTicketResult,
|
||||||
|
PSAResource,
|
||||||
|
PSACreatedTicket,
|
||||||
|
TicketCreatePayload,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -75,3 +78,18 @@ class HaloPSAProvider(PSAProvider):
|
|||||||
work_type: str | None = None,
|
work_type: str | None = None,
|
||||||
) -> PSATimeEntry:
|
) -> PSATimeEntry:
|
||||||
raise NotImplementedError("Halo PSA integration coming soon")
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|
||||||
|
async def list_resources(self, ticket_id: int) -> list[PSAResource]:
|
||||||
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|
||||||
|
async def add_resource(self, ticket_id: int, member_id: int) -> PSAResource:
|
||||||
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|
||||||
|
async def remove_resource(self, ticket_id: int, member_id: int) -> None:
|
||||||
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|
||||||
|
async def create_ticket(self, payload: TicketCreatePayload) -> PSACreatedTicket:
|
||||||
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|
||||||
|
async def list_priorities(self) -> list[dict]:
|
||||||
|
raise NotImplementedError("Halo PSA integration coming soon")
|
||||||
|
|||||||
@@ -80,6 +80,33 @@ class PaginatedTicketResult(BaseModel):
|
|||||||
page_size: int
|
page_size: int
|
||||||
|
|
||||||
|
|
||||||
|
class PSAResource(BaseModel):
|
||||||
|
member_id: int
|
||||||
|
member_name: str
|
||||||
|
member_identifier: str
|
||||||
|
is_rf_user: bool = False
|
||||||
|
|
||||||
|
|
||||||
|
class PSACreatedTicket(BaseModel):
|
||||||
|
id: int
|
||||||
|
summary: str
|
||||||
|
board_name: str
|
||||||
|
status_name: str
|
||||||
|
priority_name: str
|
||||||
|
company_name: str
|
||||||
|
resources: list[PSAResource] = []
|
||||||
|
|
||||||
|
|
||||||
|
class TicketCreatePayload(BaseModel):
|
||||||
|
summary: str
|
||||||
|
company_id: int
|
||||||
|
board_id: int
|
||||||
|
status_id: int
|
||||||
|
priority_id: int
|
||||||
|
description: str | None = None
|
||||||
|
assigned_member_id: int | None = None
|
||||||
|
|
||||||
|
|
||||||
class NoteType:
|
class NoteType:
|
||||||
INTERNAL_ANALYSIS = "internal_analysis"
|
INTERNAL_ANALYSIS = "internal_analysis"
|
||||||
RESOLUTION = "resolution"
|
RESOLUTION = "resolution"
|
||||||
|
|||||||
Reference in New Issue
Block a user