feat(l1): create l1_walk_sessions table with target-consistency check + RLS

Per-session state for L1 walking a ticket. Supports flow/proposal/adhoc
session kinds; check constraint enforces target-consistency (flow_id set
iff kind=flow; flow_proposal_id set iff kind=proposal; both null iff
kind=adhoc). walked_path + walk_notes JSONB columns track step-by-step
progress; resolved/escalated/abandoned terminal statuses captured.
Account-scoped RLS matches the internal_tickets precedent (FORCE RLS +
tenant_isolation policy with COALESCE/NULLIF guard).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-28 12:35:24 -04:00
parent 394f729595
commit 960ea71a20
3 changed files with 239 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ from .plan_billing import PlanBilling # noqa: F401
from .sales_lead import SalesLead # noqa: F401
from .stripe_event import StripeEvent # noqa: F401
from .internal_ticket import InternalTicket # noqa: F401
from .l1_walk_session import L1WalkSession # noqa: F401
__all__ = [
"User",
@@ -148,4 +149,5 @@ __all__ = [
"SalesLead",
"StripeEvent",
"InternalTicket",
"L1WalkSession",
]