{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cavuno-com/json-schema/cavuno-com-backfill-rule-schema.json",
  "title": "BackfillRule",
  "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/BackfillRule",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable Cavuno-owned resource ID."
    },
    "object": {
      "type": "string",
      "enum": [
        "backfill_rule"
      ]
    },
    "name": {
      "type": "string"
    },
    "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"
                  }
                }
              },
              "required": [
                "field",
                "operator",
                "terms"
              ]
            }
          }
        },
        "required": [
          "match",
          "conditions"
        ]
      }
    },
    "filters": {
      "type": "object",
      "properties": {
        "countries": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "subdivisions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "seniorities": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "employmentTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "workplaceTypes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "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."
    },
    "createdAt": {
      "type": [
        "string",
        "null"
      ]
    },
    "updatedAt": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "id",
    "object",
    "name",
    "matchMode",
    "rules",
    "filters",
    "jobLimit",
    "createdAt",
    "updatedAt"
  ]
}