{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/2x/json-schema/2x-client-alignment-response-schema.json",
  "title": "ClientAlignmentResponse",
  "description": "Alignment read for a single client.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/2x-alignment-api-openapi.yml#/components/schemas/ClientAlignmentResponse",
  "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"
    },
    "alignment": {
      "anyOf": [
        {
          "$ref": "#/$defs/AlignmentRead"
        },
        {
          "type": "null"
        }
      ],
      "description": "Current alignment read; null when the client has no read on or before the requested week"
    },
    "week": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Week",
      "description": "As-of week the read was resolved against; null when the latest read was returned"
    },
    "customerId": {
      "type": "string",
      "title": "Customerid"
    }
  },
  "type": "object",
  "required": [
    "clientId",
    "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."
    }
  }
}