openapi: "3.0.3"
info:
  title: "Policy documents API"
  version: "1.0.0"
  description: "The version constraint is strictly positive, so version zero is an invalid instance. The effective_from timestamp is what orders the versions, and a generator that omits it breaks the ordering. The code is unique across versions, so a fixture with two versions needs two codes or a deliberate violation. The body column is required and holds the rendered document text."
paths: {}
x-domain-id: "prob_policies"
x-dialect: "postgres"
components:
  schemas:
    policies:
      type: "object"
      x-primary-key: "id"
      required: ["id", "code", "title", "version", "effective_from", "body"]
      properties:
        id:
          type: "string"
          format: "uuid"
        code:
          type: "string"
          x-unique: true
        title:
          type: "string"
        version:
          type: "integer"
          minimum: 1
        effective_from:
          type: "string"
          format: "date-time"
        body:
          type: "string"
