openapi: "3.0.3"
info:
  title: "Double-entry ledger API"
  version: "1.0.0"
  description: "The account kind enum is the classic five-way accounting classification. The amount column allows negative values by design, so a property-based run has to treat the sign as free. The currency check constraint is a three-letter code and is enforced per entry, not per account. The memo column is nullable, which is the only optional text field in the fixture."
paths: {}
x-domain-id: "prob_ledger"
x-dialect: "postgres"
components:
  schemas:
    accounts:
      type: "object"
      x-primary-key: "id"
      required: ["id", "code", "kind"]
      properties:
        id:
          type: "string"
          format: "uuid"
        code:
          type: "string"
          x-unique: true
        kind:
          type: "string"
          enum: ["asset", "liability", "equity", "revenue", "expense"]
    entries:
      type: "object"
      x-primary-key: "id"
      required: ["id", "account_id", "amount_cents", "currency", "posted_at"]
      properties:
        id:
          type: "string"
          format: "uuid"
        account_id:
          $ref: "#/components/schemas/accounts"
        amount_cents:
          type: "integer"
        currency:
          type: "string"
          minLength: 3
          maxLength: 3
        posted_at:
          type: "string"
          format: "date-time"
        memo:
          type: "string"
          nullable: true
