Support Live Session Schema
Felder
Support Live Session Schema
A paid live support session attached to a support request
requestId
The support request this session escalated from — MANDATORY (ADR 0938 decision 10). There is no direct entry into live support: the agent gets context and the already-run AI triage for free, and the customer does not pay for the minutes spent typing the problem description.
status
Lifecycle: requested → queued → active → ended, and to `abandoned` from any state. ⚠ `requested` is a transient transition state that exists only between POST and dispatch — it must never be observable for more than fractions of a second and NO business logic may branch on it (ADR 0938 decision 11). The states that carry meaning are queued, active, ended and abandoned.
requestedqueuedactivepausedendedabandonedrequestedByUserId
The tenant user who asked for live support. Kept separately from the request’s `createdBy` because a colleague may escalate someone else’s request, and the consent below is that person’s, not the original reporter’s.
agentUserId
The Codemeta agent who pulled this session. Null while queued — assignment is pull-only, never automatic (ADR 0938 decision 13).
queuedAt
When the customer entered the queue. Sort key of the fallback FIFO rung.
activatedAt
When the agent joined. THE BILLING CLOCK STARTS HERE and nowhere else — waiting is always free, so a customer who queues for 20 minutes and gives up pays nothing (ADR 0938 decision 11).
endedAt
When the session stopped. NOT the billed span on its own — a session can be paused, so the billed time is the sum of its active segments (`billableMs`).
billableMs
Billable time from CLOSED segments, in milliseconds. An agent may pause a running session — to look something up or consult a colleague — and the meter must stop while they do (decision Lukas, 2026-08-10). Absent or 0 on a session that was never paused, where the single segment is `activatedAt → endedAt`: no backfill needed.
segmentStartedAt
Start of the OPEN billing segment; null while paused. This — not `status` — is what the money is computed from, so a paused session cannot accrue cost even if a status write were ever missed.
endedReason
Why it stopped. Load-bearing for billing disputes: `idle_timeout` means nobody closed the session and the clock was stopped for them, which is exactly the case a customer will ask about.
agent_endedcustomer_endedidle_timeoutqueue_timeoutabandonednullalarmedAt
When the queue alarm fired for this entry (ADR 0938 decision 11, alarm threshold). Stored so the alarm is raised once rather than on every sweep, and so the pull model’s known weakness — “someone else will take it” — is measurable afterwards.
consent
The customer’s explicit agreement, captured before the session can become active. Because live support has NO permission gate (ADR 0938 decision 3), this record is the only evidence that someone with authority accepted a cost — do not weaken it.
acceptedByUserId
billingModel
The model in force when consent was given — not re-read later.
freeper_blockincludedcontingentpriceCentsPerBlock
Price per block as SHOWN to the customer. Null when the model is free/included, or when no price could be resolved — the latter must lead to `held`, never to a zero charge.
blockMinutes
What one unit is — 15 by default. Carried alongside the price because “129 €/h billed per started 15 minutes” is only unambiguous with both numbers.
billingState
ADR 0938 decision 5. `included` (contractually covered, never billable) and `waived` (would have been billable, deliberately forgiven) are deliberately distinct: collapsing them makes “how much support is covered?” and “how much are we giving away?” indistinguishable in hindsight. `held` means the price was missing — hold the charge, never bill zero.
pendingmeteredincludedwaivedheldbilledBlocks
Number of started blocks the rollup charged. Written once by the rollup; null while pending. Stored rather than recomputed so an invoice line stays reproducible even after the block size changes.
chargeSourceRef
Idempotency key handed to `recordPlatformCharge()`. Present exactly when a charge was recorded, which makes a double-charge detectable rather than merely unlikely.
Keine Felder passen zum Filter.
Standard-Endpoints
Diese Resource folgt dem generischen CRUD-Vertrag der Plattform. Lesen Sie die Konventionen für Pagination, Idempotenz, Optimistic Locking und Audit. Die wichtigsten Endpoints:
GET /api/v1/support_live_sessions— Liste, paginiert + filterbarGET /api/v1/support_live_sessions/<id>— Einzelne EntityPOST /api/v1/support_live_sessions— AnlegenPATCH /api/v1/support_live_sessions/<id>— Teil-UpdateDELETE /api/v1/support_live_sessions/<id>— Soft-DeleteGET /api/v1/support_live_sessions/<id>/timeline— Audit + Aktivitäten