{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/panembrivdienu-lv/json-schema/panembrivdienu-lv-optimize-request-schema.json",
  "title": "OptimizeRequest",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/panembrivdienu-lv-openapi.yml#/components/schemas/OptimizeRequest",
  "type": "object",
  "required": [
    "year",
    "pto_days"
  ],
  "properties": {
    "year": {
      "type": "integer",
      "enum": [
        2026,
        2027
      ]
    },
    "pto_days": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100,
      "description": "Scheduled working days to take off."
    },
    "apply_transfers": {
      "type": "boolean",
      "default": false,
      "description": "Apply the 2026 workday transfers. Only valid for 2026."
    },
    "constraints": {
      "type": "object",
      "properties": {
        "employment_start_date": {
          "$ref": "#/$defs/Date"
        }
      }
    },
    "extra_days_off": {
      "type": "array",
      "maxItems": 100,
      "description": "Days that count as days off on top of public holidays, such as days an employer gives. Dates in 2026 or 2027.",
      "items": {
        "$ref": "#/$defs/Date"
      }
    }
  },
  "$defs": {
    "Date": {
      "type": "string",
      "format": "date"
    }
  }
}