{
  "$defs": {
    "AssessmentStatus": {
      "enum": [
        "pass",
        "warn",
        "fail",
        "not_assessed"
      ],
      "title": "AssessmentStatus",
      "type": "string"
    },
    "BatteryDegradationResult": {
      "additionalProperties": false,
      "properties": {
        "combined_retention": {
          "exclusiveMinimum": 0.0,
          "maximum": 1.0,
          "title": "Combined Retention",
          "type": "number"
        },
        "equivalent_full_cycles": {
          "minimum": 0.0,
          "title": "Equivalent Full Cycles",
          "type": "number"
        },
        "technology": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Technology",
          "type": "string"
        },
        "terms": {
          "items": {
            "$ref": "#/$defs/EpsDegradationFactorTerm"
          },
          "minItems": 1,
          "title": "Terms",
          "type": "array"
        },
        "uncertainty_case": {
          "$ref": "#/$defs/EpsUncertaintyCase"
        }
      },
      "required": [
        "technology",
        "uncertainty_case",
        "equivalent_full_cycles",
        "terms",
        "combined_retention"
      ],
      "title": "BatteryDegradationResult",
      "type": "object"
    },
    "EpsDegradationFactorTerm": {
      "additionalProperties": false,
      "properties": {
        "defaulted": {
          "default": false,
          "title": "Defaulted",
          "type": "boolean"
        },
        "driver": {
          "enum": [
            "time",
            "radiation",
            "calendar",
            "throughput",
            "depth_of_discharge",
            "temperature"
          ],
          "title": "Driver",
          "type": "string"
        },
        "factor": {
          "exclusiveMinimum": 0.0,
          "maximum": 1.0,
          "title": "Factor",
          "type": "number"
        },
        "factor_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Factor Id",
          "type": "string"
        },
        "source_identity": {
          "maxLength": 512,
          "minLength": 1,
          "title": "Source Identity",
          "type": "string"
        }
      },
      "required": [
        "factor_id",
        "driver",
        "factor",
        "source_identity"
      ],
      "title": "EpsDegradationFactorTerm",
      "type": "object"
    },
    "EpsUncertaintyCase": {
      "enum": [
        "low",
        "nominal",
        "high"
      ],
      "title": "EpsUncertaintyCase",
      "type": "string"
    },
    "IssueRecord": {
      "additionalProperties": false,
      "properties": {
        "action_hint": {
          "anyOf": [
            {
              "maxLength": 1000,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Action Hint"
        },
        "code": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Code",
          "type": "string"
        },
        "issue_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Issue Id",
          "type": "string"
        },
        "message": {
          "maxLength": 2000,
          "minLength": 1,
          "title": "Message",
          "type": "string"
        },
        "severity": {
          "$ref": "#/$defs/IssueSeverity"
        },
        "source_path": {
          "anyOf": [
            {
              "maxLength": 512,
              "minLength": 1,
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Source Path"
        },
        "statement_ids": {
          "default": [],
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
            "type": "string"
          },
          "title": "Statement Ids",
          "type": "array"
        }
      },
      "required": [
        "issue_id",
        "code",
        "severity",
        "message"
      ],
      "title": "IssueRecord",
      "type": "object"
    },
    "IssueSeverity": {
      "enum": [
        "info",
        "warning",
        "error"
      ],
      "title": "IssueSeverity",
      "type": "string"
    },
    "ModelApplicabilityAssessment": {
      "additionalProperties": false,
      "properties": {
        "active_limitation_ids": {
          "default": [],
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
            "type": "string"
          },
          "title": "Active Limitation Ids",
          "type": "array"
        },
        "applicability_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Applicability Id",
          "type": "string"
        },
        "applied_default_policy_ids": {
          "default": [],
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
            "type": "string"
          },
          "title": "Applied Default Policy Ids",
          "type": "array"
        },
        "authority_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Authority Id",
          "type": "string"
        },
        "status": {
          "$ref": "#/$defs/ModelApplicabilityStatus"
        }
      },
      "required": [
        "authority_id",
        "applicability_id",
        "status"
      ],
      "title": "ModelApplicabilityAssessment",
      "type": "object"
    },
    "ModelApplicabilityStatus": {
      "enum": [
        "applicable",
        "degraded",
        "unsupported"
      ],
      "title": "ModelApplicabilityStatus",
      "type": "string"
    },
    "PanelDegradationResult": {
      "additionalProperties": false,
      "properties": {
        "combined_retention": {
          "exclusiveMinimum": 0.0,
          "maximum": 1.0,
          "title": "Combined Retention",
          "type": "number"
        },
        "technology": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Technology",
          "type": "string"
        },
        "terms": {
          "items": {
            "$ref": "#/$defs/EpsDegradationFactorTerm"
          },
          "minItems": 1,
          "title": "Terms",
          "type": "array"
        },
        "uncertainty_case": {
          "$ref": "#/$defs/EpsUncertaintyCase"
        }
      },
      "required": [
        "technology",
        "uncertainty_case",
        "terms",
        "combined_retention"
      ],
      "title": "PanelDegradationResult",
      "type": "object"
    }
  },
  "$id": "urn:sindri:contracts:1.0.0:lifetime-result-v2",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "applicability": {
      "$ref": "#/$defs/ModelApplicabilityAssessment"
    },
    "assessment_status": {
      "$ref": "#/$defs/AssessmentStatus"
    },
    "battery": {
      "$ref": "#/$defs/BatteryDegradationResult"
    },
    "design_lifetime_years": {
      "exclusiveMinimum": 0.0,
      "title": "Design Lifetime Years",
      "type": "number"
    },
    "issues": {
      "default": [],
      "items": {
        "$ref": "#/$defs/IssueRecord"
      },
      "title": "Issues",
      "type": "array"
    },
    "mission_id": {
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
      "title": "Mission Id",
      "type": "string"
    },
    "panel": {
      "$ref": "#/$defs/PanelDegradationResult"
    },
    "payload_kind": {
      "const": "lifetime",
      "default": "lifetime",
      "title": "Payload Kind",
      "type": "string"
    },
    "payload_version": {
      "const": "2.0.0",
      "default": "2.0.0",
      "title": "Payload Version",
      "type": "string"
    }
  },
  "required": [
    "mission_id",
    "design_lifetime_years",
    "assessment_status",
    "applicability",
    "panel",
    "battery"
  ],
  "title": "LifetimeResultPayloadV2",
  "type": "object",
  "x-sindri-contract-suite": "sindri.contracts",
  "x-sindri-contract-version": "1.0.0"
}
