{
  "$defs": {
    "MassCoverage": {
      "additionalProperties": false,
      "properties": {
        "issues": {
          "default": [],
          "items": {
            "$ref": "#/$defs/MassCoverageIssue"
          },
          "title": "Issues",
          "type": "array"
        },
        "source_ids": {
          "default": [],
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
            "type": "string"
          },
          "title": "Source Ids",
          "type": "array"
        },
        "status": {
          "default": "unrecorded",
          "enum": [
            "complete",
            "incomplete",
            "unrecorded"
          ],
          "title": "Status",
          "type": "string"
        }
      },
      "title": "MassCoverage",
      "type": "object"
    },
    "MassCoverageIssue": {
      "additionalProperties": false,
      "properties": {
        "bucket_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Bucket Id",
          "type": "string"
        },
        "reason_code": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Reason Code",
          "type": "string"
        },
        "role_id": {
          "maxLength": 128,
          "minLength": 1,
          "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
          "title": "Role Id",
          "type": "string"
        },
        "source_ids": {
          "items": {
            "maxLength": 128,
            "minLength": 1,
            "pattern": "^[a-z][a-z0-9]*(?:[._:-][a-z0-9]+)*$",
            "type": "string"
          },
          "minItems": 1,
          "title": "Source Ids",
          "type": "array"
        }
      },
      "required": [
        "bucket_id",
        "role_id",
        "reason_code",
        "source_ids"
      ],
      "title": "MassCoverageIssue",
      "type": "object"
    },
    "SpacecraftMassConsumerMappingRecord": {
      "additionalProperties": false,
      "properties": {
        "consumer_id": {
          "minLength": 1,
          "title": "Consumer Id",
          "type": "string"
        },
        "consumer_kind": {
          "enum": [
            "launch",
            "mode",
            "adcs_scenario"
          ],
          "title": "Consumer Kind",
          "type": "string"
        },
        "mass_basis": {
          "const": "wet",
          "default": "wet",
          "title": "Mass Basis",
          "type": "string"
        },
        "requested_state_label": {
          "minLength": 1,
          "title": "Requested State Label",
          "type": "string"
        },
        "source": {
          "minLength": 1,
          "title": "Source",
          "type": "string"
        },
        "state_id": {
          "minLength": 1,
          "title": "State Id",
          "type": "string"
        },
        "state_label": {
          "minLength": 1,
          "title": "State Label",
          "type": "string"
        },
        "warnings": {
          "items": {
            "type": "string"
          },
          "title": "Warnings",
          "type": "array"
        }
      },
      "required": [
        "consumer_kind",
        "consumer_id",
        "requested_state_label",
        "state_id",
        "state_label",
        "source"
      ],
      "title": "SpacecraftMassConsumerMappingRecord",
      "type": "object"
    },
    "SpacecraftMassContributionRecord": {
      "additionalProperties": false,
      "properties": {
        "cg_body_m": {
          "items": {
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "title": "Cg Body M",
          "type": "array"
        },
        "inertia_about_cg_body_kg_m2": {
          "items": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "maxItems": 3,
          "minItems": 3,
          "title": "Inertia About Cg Body Kg M2",
          "type": "array"
        },
        "mass_kg": {
          "exclusiveMinimum": 0.0,
          "title": "Mass Kg",
          "type": "number"
        },
        "provenance": {
          "minLength": 1,
          "title": "Provenance",
          "type": "string"
        },
        "source_id": {
          "minLength": 1,
          "title": "Source Id",
          "type": "string"
        },
        "source_kind": {
          "enum": [
            "non_deployable_base",
            "articulated_deployable",
            "propellant",
            "structure_policy",
            "harness_policy"
          ],
          "title": "Source Kind",
          "type": "string"
        }
      },
      "required": [
        "source_id",
        "source_kind",
        "mass_kg",
        "cg_body_m",
        "inertia_about_cg_body_kg_m2",
        "provenance"
      ],
      "title": "SpacecraftMassContributionRecord",
      "type": "object"
    },
    "SpacecraftMassPropertiesSnapshot": {
      "additionalProperties": false,
      "properties": {
        "cg_body_m": {
          "items": {
            "type": "number"
          },
          "maxItems": 3,
          "minItems": 3,
          "title": "Cg Body M",
          "type": "array"
        },
        "contributions": {
          "items": {
            "$ref": "#/$defs/SpacecraftMassContributionRecord"
          },
          "minItems": 1,
          "title": "Contributions",
          "type": "array"
        },
        "inertia_about_cg_body_kg_m2": {
          "items": {
            "items": {
              "type": "number"
            },
            "type": "array"
          },
          "maxItems": 3,
          "minItems": 3,
          "title": "Inertia About Cg Body Kg M2",
          "type": "array"
        },
        "mass_kg": {
          "exclusiveMinimum": 0.0,
          "title": "Mass Kg",
          "type": "number"
        }
      },
      "required": [
        "mass_kg",
        "cg_body_m",
        "inertia_about_cg_body_kg_m2",
        "contributions"
      ],
      "title": "SpacecraftMassPropertiesSnapshot",
      "type": "object"
    },
    "SpacecraftMassSourceDigest": {
      "additionalProperties": false,
      "properties": {
        "sha256": {
          "pattern": "^[0-9a-f]{64}$",
          "title": "Sha256",
          "type": "string"
        },
        "source_id": {
          "minLength": 1,
          "title": "Source Id",
          "type": "string"
        }
      },
      "required": [
        "source_id",
        "sha256"
      ],
      "title": "SpacecraftMassSourceDigest",
      "type": "object"
    },
    "SpacecraftStateMassRecord": {
      "additionalProperties": false,
      "properties": {
        "dry": {
          "$ref": "#/$defs/SpacecraftMassPropertiesSnapshot"
        },
        "state_id": {
          "minLength": 1,
          "title": "State Id",
          "type": "string"
        },
        "state_label": {
          "minLength": 1,
          "title": "State Label",
          "type": "string"
        },
        "wet": {
          "$ref": "#/$defs/SpacecraftMassPropertiesSnapshot"
        }
      },
      "required": [
        "state_id",
        "state_label",
        "dry",
        "wet"
      ],
      "title": "SpacecraftStateMassRecord",
      "type": "object"
    }
  },
  "$id": "urn:sindri:contracts:1.0.0:spacecraft-mass-properties",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "artifact_id": {
      "minLength": 1,
      "title": "Artifact Id",
      "type": "string"
    },
    "artifact_schema_version": {
      "minLength": 1,
      "title": "Artifact Schema Version",
      "type": "string"
    },
    "base_remainder_mass_kg": {
      "minimum": 0.0,
      "title": "Base Remainder Mass Kg",
      "type": "number"
    },
    "consumer_mappings": {
      "items": {
        "$ref": "#/$defs/SpacecraftMassConsumerMappingRecord"
      },
      "minItems": 1,
      "title": "Consumer Mappings",
      "type": "array"
    },
    "deployable_mass_kg": {
      "minimum": 0.0,
      "title": "Deployable Mass Kg",
      "type": "number"
    },
    "dry_mass_kg": {
      "exclusiveMinimum": 0.0,
      "title": "Dry Mass Kg",
      "type": "number"
    },
    "excluded_placement_source_ids": {
      "items": {
        "type": "string"
      },
      "title": "Excluded Placement Source Ids",
      "type": "array"
    },
    "mass_coverage": {
      "$ref": "#/$defs/MassCoverage"
    },
    "non_deployable_base_mass_kg": {
      "exclusiveMinimum": 0.0,
      "title": "Non Deployable Base Mass Kg",
      "type": "number"
    },
    "payload_kind": {
      "const": "spacecraft_mass_properties",
      "default": "spacecraft_mass_properties",
      "title": "Payload Kind",
      "type": "string"
    },
    "payload_version": {
      "const": "1.0.0",
      "default": "1.0.0",
      "title": "Payload Version",
      "type": "string"
    },
    "propellant_mass_kg": {
      "minimum": 0.0,
      "title": "Propellant Mass Kg",
      "type": "number"
    },
    "schema_version": {
      "const": "sindri.spacecraft.mass_properties.v1",
      "default": "sindri.spacecraft.mass_properties.v1",
      "title": "Schema Version",
      "type": "string"
    },
    "source": {
      "default": "d5_articulated_states+placement_mass_closure",
      "enum": [
        "d5_articulated_states+placement_mass_closure",
        "static_placement_mass_closure"
      ],
      "title": "Source",
      "type": "string"
    },
    "source_hashes": {
      "items": {
        "$ref": "#/$defs/SpacecraftMassSourceDigest"
      },
      "minItems": 1,
      "title": "Source Hashes",
      "type": "array"
    },
    "states": {
      "items": {
        "$ref": "#/$defs/SpacecraftStateMassRecord"
      },
      "minItems": 1,
      "title": "States",
      "type": "array"
    },
    "warnings": {
      "items": {
        "type": "string"
      },
      "title": "Warnings",
      "type": "array"
    }
  },
  "required": [
    "artifact_schema_version",
    "artifact_id",
    "source_hashes",
    "dry_mass_kg",
    "propellant_mass_kg",
    "non_deployable_base_mass_kg",
    "deployable_mass_kg",
    "base_remainder_mass_kg",
    "states",
    "consumer_mappings"
  ],
  "title": "SpacecraftMassPropertiesSet",
  "type": "object",
  "x-sindri-contract-suite": "sindri.contracts",
  "x-sindri-contract-version": "1.0.0"
}
