{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cavuno-com/json-schema/cavuno-com-update-backfill-rule-body-schema.json",
  "title": "UpdateBackfillRuleBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cavuno-com-backfill-api-openapi.yml#/components/schemas/UpdateBackfillRuleBody",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2000
    },
    "matchMode": {
      "type": "string",
      "enum": [
        "any",
        "all"
      ]
    },
    "rules": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "match": {
            "type": "string",
            "enum": [
              "any",
              "all"
            ]
          },
          "conditions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "field": {
                  "type": "string",
                  "enum": [
                    "title",
                    "description"
                  ]
                },
                "operator": {
                  "type": "string",
                  "enum": [
                    "contains_any",
                    "contains_all",
                    "is_not"
                  ]
                },
                "terms": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "minItems": 1,
                  "maxItems": 20
                }
              },
              "required": [
                "field",
                "operator",
                "terms"
              ],
              "additionalProperties": false
            },
            "minItems": 1
          }
        },
        "required": [
          "match",
          "conditions"
        ],
        "additionalProperties": false
      }
    },
    "filters": {
      "type": "object",
      "properties": {
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "seniorities": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "entry_level",
              "associate",
              "mid_level",
              "senior",
              "director",
              "executive"
            ]
          }
        },
        "employmentTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "full_time",
              "part_time",
              "contract",
              "internship",
              "temporary",
              "volunteer",
              "other"
            ]
          }
        },
        "workplaceTypes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "remote",
              "hybrid",
              "onsite"
            ]
          }
        }
      },
      "additionalProperties": false
    },
    "jobLimit": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 100000,
      "description": "Most jobs from this rule live on the Board at once, counting published jobs and jobs awaiting approval (1–100,000). `null` means no rule limit; the Board's Backfill limit still applies. Takes effect on the next sync; jobs already live are not removed."
    }
  },
  "additionalProperties": false
}