{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/2x/json-schema/2x-alignment-list-response-schema.json",
  "title": "AlignmentListResponse",
  "description": "Response model for the client alignment list.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/2x-alignment-api-openapi.yml#/components/schemas/AlignmentListResponse",
  "properties": {
    "clients": {
      "items": {
        "$ref": "#/$defs/ClientAlignment"
      },
      "type": "array",
      "title": "Clients"
    },
    "total": {
      "type": "integer",
      "title": "Total"
    },
    "week": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Week",
      "description": "As-of week the reads were resolved against; null when the latest reads were returned"
    },
    "customerId": {
      "type": "string",
      "title": "Customerid"
    }
  },
  "type": "object",
  "required": [
    "clients",
    "total",
    "customerId"
  ],
  "$defs": {
    "AlignmentRead": {
      "properties": {
        "value": {
          "type": "string",
          "title": "Value",
          "description": "The alignment read: red, amber, or green"
        },
        "week": {
          "type": "string",
          "title": "Week",
          "description": "Monday (YYYY-MM-DD) of the week the read was filed for"
        },
        "updatedAt": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updatedat",
          "description": "When the read was last edited"
        },
        "updatedBy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updatedby",
          "description": "Name of the user who filed the read"
        }
      },
      "type": "object",
      "required": [
        "value",
        "week"
      ],
      "title": "AlignmentRead",
      "description": "A Red/Amber/Green alignment read filed on a client."
    },
    "ClientAlignment": {
      "properties": {
        "clientId": {
          "type": "string",
          "title": "Clientid"
        },
        "clientName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Clientname"
        },
        "externalClientId": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Externalclientid",
          "description": "Customer-assigned client ID (extraColumns['Client ID']), when present"
        },
        "knownwellScore": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Knownwellscore"
        },
        "scoreSource": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Scoresource",
          "description": "Score data source: chr1 or chr2"
        },
        "alignment": {
          "anyOf": [
            {
              "$ref": "#/$defs/AlignmentRead"
            },
            {
              "type": "null"
            }
          ],
          "description": "Current alignment read; null when the client has no read on or before the requested week"
        }
      },
      "type": "object",
      "required": [
        "clientId"
      ],
      "title": "ClientAlignment",
      "description": "Per-client entry in the alignment list."
    }
  }
}