{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/oyster-hr/json-schema/oyster-hr-payroll-changes-schema.json",
  "title": "payrollChanges",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oyster-hr-payroll-changes-api-openapi.yml#/components/schemas/payrollChanges",
  "type": "array",
  "items": {
    "$ref": "#/$defs/payrollChange"
  },
  "$defs": {
    "amount": {
      "type": "object",
      "properties": {
        "decimal": {
          "type": "string",
          "pattern": "^\\d+([.]\\d+)?$"
        },
        "currencyCode": {
          "type": "string",
          "minLength": 3,
          "maxLength": 3
        }
      },
      "required": [
        "decimal",
        "currencyCode"
      ]
    },
    "payrollChange": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        },
        "engagement": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "name": {
              "type": [
                "string",
                "null"
              ]
            },
            "type": {
              "type": "string",
              "pattern": "^[A-Z_]+$"
            }
          },
          "required": [
            "id",
            "name",
            "type"
          ]
        },
        "month": {
          "type": "string",
          "pattern": "^0?[1-9]$|^1[0-2]$"
        },
        "year": {
          "type": "string",
          "pattern": "^\\d{4}$"
        },
        "notes": {
          "type": "string"
        },
        "state": {
          "type": "string",
          "enum": [
            "PLANNED",
            "CANCELED",
            "APPLIED"
          ]
        },
        "amount": {
          "$ref": "#/$defs/amount"
        }
      },
      "required": [
        "id",
        "type",
        "engagement",
        "month",
        "year",
        "notes",
        "state",
        "amount"
      ]
    }
  }
}