{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schemas.ruter.no/adt/ota/api/v4.x/sensors/state-of-charge/state-of-charge.json",
  "type": "object",
  "title": "StateOfCharge",
  "description": "Schema for state of charge sensor data. The value represents the battery's charge level as a percentage (%), typically ranging from 0 to 100. The value should generally increase while charging and decrease during operation.",
  "required": [
    "eventTimestamp",
    "traceId",
    "messageNumber",
    "sensorId",
    "value"
  ],
  "properties": {
    "eventTimestamp": {
      "$id": "#/properties/eventTimestamp",
      "type": "string",
      "description": "ISO 8601 timestamp in UTC (must end with 'Z'), indicating when the measurement was taken",
      "example": "2025-05-13T12:00:00.000Z"
    },
    "traceId": {
      "$id": "#/properties/traceId",
      "type": "string",
      "description": "Unique identifier for tracing this message",
      "example": "baf3d8ac-1234-4e0c-9e9e-abc123def456"
    },
    "messageNumber": {
      "$id": "#/properties/messageNumber",
      "type": "integer",
      "description": "Sequence number, increased by one for each new message",
      "example": 42
    },
    "sensorId": {
      "$id": "#/properties/sensorId",
      "type": "string",
      "description": "Unique identifier for the sensor. Typically the serial number (S/N) from the sensor.",
      "example": "SN-456789"
    },
    "value": {
      "$id": "#/properties/value",
      "type": "number",
      "description": "State of charge in percentage (%)",
      "example": 78.5,
      "minimum": 0,
      "maximum": 100
    }
  },
  "additionalProperties": true
}