{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openssom.org/schema/profile-data-completeness-assertion.json",
  "title": "SSOM Data Completeness Profile: Completeness Assertion",
  "description": "A Derived Assertion stating how many of the expected values of one periodic signal were received in one window.",
  "allOf": [
    {
      "$ref": "derived-assertion.json"
    }
  ],
  "type": "object",
  "required": [
    "assertion_type",
    "asserted_value"
  ],
  "properties": {
    "assertion_type": {
      "const": "data_completeness"
    },
    "asserted_value": {
      "type": "object",
      "required": [
        "signal_ref",
        "window_start",
        "window_end",
        "expected_interval",
        "expected_count",
        "received_count"
      ],
      "properties": {
        "signal_ref": {
          "type": "string",
          "pattern": "^urn:ssom:signal:"
        },
        "window_start": {
          "type": "string",
          "format": "date-time"
        },
        "window_end": {
          "type": "string",
          "format": "date-time"
        },
        "expected_interval": {
          "type": "string",
          "pattern": "^P"
        },
        "expected_count": {
          "type": "integer",
          "minimum": 1
        },
        "received_count": {
          "type": "integer",
          "minimum": 0
        },
        "quarantined_count": {
          "type": "integer",
          "minimum": 0
        },
        "late_count": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false
    }
  }
}
