openapi: "3.0.3"
info:
  title: "Event stream fixture for a determinism walkthrough"
  version: "1.0.0"
  description: "The seq column is strictly positive and unique per session in practice, which makes it the clearest ordering signal in the fixture. The session key is unique, and a deterministic generator derives it from the seed rather than from a counter. The source enum has three members and the batch member is the one a replay test focuses on. The events table needs the session id reused across many rows, which is where per-schema generators fall apart."
paths: {}
x-domain-id: "tut_events"
x-dialect: "postgres"
components:
  schemas:
    sessions:
      type: "object"
      x-primary-key: "id"
      required: ["id", "session_key", "started_at", "source"]
      properties:
        id:
          type: "string"
          format: "uuid"
        session_key:
          type: "string"
          x-unique: true
        started_at:
          type: "string"
          format: "date-time"
        source:
          type: "string"
          enum: ["web", "api", "batch"]
    events:
      type: "object"
      x-primary-key: "id"
      required: ["id", "session_id", "seq", "name", "value", "at"]
      properties:
        id:
          type: "string"
          format: "uuid"
        session_id:
          $ref: "#/components/schemas/sessions"
        seq:
          type: "integer"
          minimum: 1
        name:
          type: "string"
        value:
          type: "integer"
        at:
          type: "string"
          format: "date-time"
