Skip to content
Venue booking & governance

deliveries

Delivery outbox (ADR-010, Step 16). Every notification that leaves the app (Linear issue, email, push). A cron picks up pending deliveries, sends them, and marks them delivered. Retries capped at 3.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
subject_typetext
inbound_requestbooking_requestbooking_inquiry
no—
subject_iduuid no—
channeltext
linearemail
no—
targettext no—
statustext
pendingdeliveredfailed
no"pending"
attemptsinteger no0
last_errortext yes—
external_reftext yes—
created_attimestamp nonow()
delivered_attimestamp yes—

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

None besides the primary key.

Indexes

  • (status, created_at)
    deliveries_status_idx
  • (subject_type, subject_id)
    deliveries_subject_idx

Foreign keys

None.

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

tRPC procedures

No public or signed-in procedure.

REST & webhooks

None.

Relations

Rendering diagram…

Diagram source
erDiagram
  deliveries {
    uuid id PK
  }

Defined at server/database/schema.ts:1248 as deliveries.