openapi: "3.0.3"
info:
  title: "Order adjustments API"
  version: "1.0.0"
  description: "The adjustment amount is deliberately allowed to be negative, so a negative value is valid here and invalid everywhere else in the matrix. The kind enum has three members and each one means a different sign convention. The order reference is unique, which gives the fixture a second constraint dimension. The reason column is required, so a missing reason is a negative instance."
paths: {}
x-domain-id: "prob_adjustments"
x-dialect: "postgres"
components:
  schemas:
    orders:
      type: "object"
      x-primary-key: "id"
      required: ["id", "reference", "total_cents"]
      properties:
        id:
          type: "string"
          format: "uuid"
        reference:
          type: "string"
          x-unique: true
        total_cents:
          type: "integer"
          minimum: 0
    adjustments:
      type: "object"
      x-primary-key: "id"
      required: ["id", "order_id", "kind", "amount_cents", "reason"]
      properties:
        id:
          type: "string"
          format: "uuid"
        order_id:
          $ref: "#/components/schemas/orders"
        kind:
          type: "string"
          enum: ["discount", "shipping", "tax"]
        amount_cents:
          type: "integer"
        reason:
          type: "string"
