{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anomalyarmor-ai/json-schema/anomalyarmor-ai-app-domains-feature-data-quality-freshness-models-freshness-models-create-schedule-request-schema.json",
  "title": "CreateScheduleRequest",
  "description": "Request to create freshness monitoring schedule.\n\nNote: Validation is handled by FreshnessValidationService",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anomalyarmor-ai-freshness-api-openapi.yml#/components/schemas/app__domains__feature__data_quality__freshness__models__freshness_models__CreateScheduleRequest",
  "properties": {
    "table_path": {
      "type": "string",
      "title": "Table Path",
      "description": "Table path (schema.table_name)"
    },
    "check_interval": {
      "type": "string",
      "title": "Check Interval",
      "description": "Check interval (5m, 1h, 1d)"
    },
    "freshness_column": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Freshness Column",
      "description": "Column to track freshness"
    },
    "monitoring_mode": {
      "type": "string",
      "title": "Monitoring Mode",
      "description": "Monitoring mode: auto_learn or explicit",
      "default": "auto_learn"
    },
    "explicit_sla": {
      "anyOf": [
        {
          "$ref": "#/$defs/ExplicitSLA"
        },
        {
          "type": "null"
        }
      ],
      "description": "Explicit SLA config (required if monitoring_mode=explicit)"
    },
    "buffer_multiplier": {
      "anyOf": [
        {
          "type": "number",
          "maximum": 2.0,
          "exclusiveMinimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Buffer Multiplier",
      "description": "Buffer multiplier for auto-learn mode"
    },
    "business_priority": {
      "anyOf": [
        {
          "$ref": "#/$defs/BusinessPriority"
        },
        {
          "type": "null"
        }
      ],
      "description": "Business priority: critical, high, medium, low"
    },
    "business_impact": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Business Impact",
      "description": "Description of business impact"
    },
    "notification_recipients": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array",
          "minItems": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Notification Recipients",
      "description": "Email addresses to notify on SLA violations"
    }
  },
  "type": "object",
  "required": [
    "table_path",
    "check_interval"
  ],
  "$defs": {
    "BusinessPriority": {
      "type": "string",
      "enum": [
        "critical",
        "high",
        "medium",
        "low"
      ],
      "title": "BusinessPriority",
      "description": "Business priority values."
    },
    "ExplicitSLA": {
      "properties": {
        "update_frequency": {
          "type": "string",
          "title": "Update Frequency",
          "description": "hourly, daily, weekly, weekdays"
        },
        "expected_time": {
          "type": "string",
          "title": "Expected Time",
          "description": "Expected update time (HH:MM:SS)"
        },
        "expected_days": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Expected Days",
          "description": "Expected days for weekly schedules"
        },
        "sla_hours": {
          "type": "number",
          "exclusiveMinimum": 0.0,
          "title": "Sla Hours",
          "description": "Alert threshold in hours"
        },
        "warning_hours": {
          "anyOf": [
            {
              "type": "number",
              "exclusiveMinimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Warning Hours",
          "description": "Warning threshold (optional)"
        }
      },
      "type": "object",
      "required": [
        "update_frequency",
        "expected_time",
        "sla_hours"
      ],
      "title": "ExplicitSLA",
      "description": "User-provided explicit SLA configuration."
    }
  }
}