Phase 2 of the FlowPilot-First Pivot connecting AI sessions to ConnectWise PSA: Slice 1 — PSA Ticket Intake: - FlowPilotEngine accepts psa_ticket intake with graceful CW API fallback - Ticket picker on intake screen (refactored TicketPickerModal for dual-mode) - Ticket context card in session sidebar Slice 2 — Auto Documentation Push: - PSA documentation service with resolution/escalation note formatting - Time entry creation via new ConnectWise provider method - Automatic retry scheduler (APScheduler, 5min interval, 3 retries) - PSA push status indicators in frontend with manual retry button - Member mapping warning when CW member not mapped Slice 3 — Session Pause/Resume & Escalation Handoff: - Pause/resume endpoints for same-engineer session bookmarking - Escalation flow: requesting_escalation status, self-escalation blocked - Enhanced escalation package with LLM-generated hypotheses/suggestions - Pickup endpoint with continue/fresh resume modes and briefing step - Escalation queue (sidebar nav + dedicated page) - SessionBriefing component with continue/fresh choice UI - EscalateModal with PSA-aware button text Slice 4 — Mid-Session Ticket Linking: - Link ticket retroactively with context injection into system prompt - Link Ticket button in session sidebar Slice 5 — FlowPilot PSA Settings: - Settings tab on IntegrationsPage with 7 configurable options - Stored as flowpilot_settings JSONB on PsaConnection Database: 2 migrations (flowpilot_settings, psa_post_log changes, status constraint) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
81 lines
1.8 KiB
Python
81 lines
1.8 KiB
Python
"""Abstract base class for PSA provider implementations."""
|
|
from __future__ import annotations
|
|
|
|
from abc import ABC, abstractmethod
|
|
|
|
from .types import (
|
|
ConnectionTestResult,
|
|
PSATicket,
|
|
PSANote,
|
|
PSAStatus,
|
|
PSACompany,
|
|
PSAMember,
|
|
PSAConfiguration,
|
|
PSATimeEntry,
|
|
)
|
|
|
|
|
|
class PSAProvider(ABC):
|
|
"""Abstract base for PSA integrations (ConnectWise, Autotask, etc.)."""
|
|
|
|
@abstractmethod
|
|
async def test_connection(self) -> ConnectionTestResult:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def get_ticket(self, ticket_id: str) -> PSATicket:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def search_tickets(self, query: str, **filters) -> list[PSATicket]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def post_note(
|
|
self,
|
|
ticket_id: str,
|
|
text: str,
|
|
note_type: str,
|
|
member_id: str | None = None,
|
|
) -> PSANote:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def update_ticket_status(
|
|
self,
|
|
ticket_id: str,
|
|
status_id: int,
|
|
) -> PSATicket:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def get_ticket_statuses(self, board_id: int) -> list[PSAStatus]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def list_companies(self, **filters) -> list[PSACompany]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def get_company(self, company_id: str) -> PSACompany:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def list_members(self) -> list[PSAMember]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def get_ticket_configurations(self, ticket_id: str) -> list[PSAConfiguration]:
|
|
...
|
|
|
|
@abstractmethod
|
|
async def create_time_entry(
|
|
self,
|
|
ticket_id: str,
|
|
member_id: str,
|
|
hours: float,
|
|
notes: str | None = None,
|
|
work_type: str | None = None,
|
|
) -> PSATimeEntry:
|
|
...
|