{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vigotime-com/json-schema/vigotime-com-generation-result-schema-schema.json",
  "title": "GenerationResultSchema",
  "description": "Result of schedule generation.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vigotime-com-openapi.json#/components/schemas/GenerationResultSchema",
  "properties": {
    "alternative_solutions": {
      "items": {
        "$ref": "#/$defs/AlternativeSolutionSchema"
      },
      "title": "Alternative Solutions",
      "type": "array"
    },
    "assignments": {
      "items": {
        "$ref": "#/$defs/AssignmentSchema"
      },
      "title": "Assignments",
      "type": "array"
    },
    "continuity_issues": {
      "description": "Kontinuitaets-Befunde der Generierung (#269), z. B. PLAN_LOCK_DROPPED: eine aus einem Nachbarplan uebernommene Zuweisung konnte nicht fixiert werden — der Tag ist entgegen der Annahme des anderen Plans ungedeckt.",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Continuity Issues",
      "type": "array"
    },
    "error_message": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error Message"
    },
    "execution_time_seconds": {
      "title": "Execution Time Seconds",
      "type": "number"
    },
    "explanations": {
      "items": {
        "type": "string"
      },
      "title": "Explanations",
      "type": "array"
    },
    "input_summary": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "description": "Detailed summary of all input data for debugging and QA",
      "title": "Input Summary"
    },
    "rule_effectiveness": {
      "description": "Rule findings for this plan. effective=false: planning rules that never came into effect (Feature B2). effective=true: staffing rules that deliberately LOWER the shift's own minimum on the days they name.",
      "items": {
        "$ref": "#/$defs/RuleEffectivenessSchema"
      },
      "title": "Rule Effectiveness",
      "type": "array"
    },
    "statistics": {
      "additionalProperties": true,
      "title": "Statistics",
      "type": "object"
    },
    "status": {
      "$ref": "#/$defs/SolverStatusResponse"
    },
    "success": {
      "title": "Success",
      "type": "boolean"
    },
    "unassigned_shifts": {
      "items": {
        "$ref": "#/$defs/UnassignedShiftSchema"
      },
      "title": "Unassigned Shifts",
      "type": "array"
    },
    "warnings": {
      "description": "Nonblocking shift configuration advice from this solve snapshot",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "title": "Warnings",
      "type": "array"
    }
  },
  "required": [
    "success",
    "status",
    "execution_time_seconds"
  ],
  "type": "object",
  "$defs": {
    "AlternativeSolutionSchema": {
      "description": "An alternative schedule solution.",
      "properties": {
        "assignments": {
          "items": {
            "$ref": "#/$defs/AssignmentSchema"
          },
          "title": "Assignments",
          "type": "array"
        },
        "objective_value": {
          "title": "Objective Value",
          "type": "number"
        },
        "solution_number": {
          "title": "Solution Number",
          "type": "integer"
        }
      },
      "required": [
        "solution_number",
        "assignments",
        "objective_value"
      ],
      "title": "AlternativeSolutionSchema",
      "type": "object"
    },
    "AssignmentSchema": {
      "description": "A single shift assignment.",
      "properties": {
        "date": {
          "title": "Date",
          "type": "string"
        },
        "employee_id": {
          "title": "Employee Id",
          "type": "string"
        },
        "shift_id": {
          "title": "Shift Id",
          "type": "string"
        },
        "stored_duty": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Stored Duty"
        }
      },
      "required": [
        "employee_id",
        "shift_id",
        "date"
      ],
      "title": "AssignmentSchema",
      "type": "object"
    },
    "RuleEffectivenessSchema": {
      "description": "Per-rule finding for this plan.\n\neffective=false: the rule never came into effect (Feature B2).\neffective=true: a staffing rule deliberately lowers the shift's own minimum on the\ndays it names — allowed, but never silent.",
      "properties": {
        "effective": {
          "title": "Effective",
          "type": "boolean"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        },
        "rule_id": {
          "title": "Rule Id",
          "type": "string"
        },
        "rule_name": {
          "title": "Rule Name",
          "type": "string"
        }
      },
      "required": [
        "rule_id",
        "rule_name",
        "effective"
      ],
      "title": "RuleEffectivenessSchema",
      "type": "object"
    },
    "SolverStatusResponse": {
      "description": "Solver status for API responses.",
      "enum": [
        "optimal",
        "feasible",
        "infeasible",
        "unknown",
        "model_invalid",
        "timeout"
      ],
      "title": "SolverStatusResponse",
      "type": "string"
    },
    "UnassignedShiftSchema": {
      "description": "Information about an unassigned shift.",
      "properties": {
        "date": {
          "title": "Date",
          "type": "string"
        },
        "details": {
          "additionalProperties": true,
          "title": "Details",
          "type": "object"
        },
        "reason": {
          "title": "Reason",
          "type": "string"
        },
        "shift_id": {
          "title": "Shift Id",
          "type": "string"
        }
      },
      "required": [
        "shift_id",
        "date",
        "reason"
      ],
      "title": "UnassignedShiftSchema",
      "type": "object"
    }
  }
}