{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-supplement-collection-schema.json",
  "title": "supplementCollection",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-supplements-api-openapi.yml#/components/schemas/supplementCollection",
  "allOf": [
    {
      "$ref": "#/$defs/baseCollection"
    },
    {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/supplement"
          }
        }
      }
    }
  ],
  "$defs": {
    "baseCollection": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "description": "The total number of items matching the current query."
        },
        "pageSize": {
          "type": "integer",
          "description": "The requested or default page size."
        },
        "pageStartIndex": {
          "type": "integer",
          "description": "The requested or default index of the first element to return."
        }
      }
    },
    "companyUserLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique GUID of the AccuLynx User.",
          "format": "uuid"
        },
        "_link": {
          "type": "string",
          "description": "The unique URI of the AccuLynx User."
        }
      },
      "description": ""
    },
    "jobLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The job's unique ID."
        },
        "_link": {
          "type": "string",
          "description": "The URI of this Job."
        }
      }
    },
    "supplement": {
      "allOf": [
        {
          "$ref": "#/$defs/supplementLink"
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "$ref": "#/$defs/supplementStatusLink"
            },
            "name": {
              "type": "string",
              "description": "Supplement description."
            },
            "state": {
              "$ref": "#/$defs/supplementState"
            },
            "job": {
              "$ref": "#/$defs/jobLink"
            },
            "assignedSupplementer": {
              "$ref": "#/$defs/supplementerAssigned"
            },
            "itemsToSupplement": {
              "$ref": "#/$defs/supplementItems"
            },
            "notations": {
              "$ref": "#/$defs/supplementNotations"
            },
            "createdDate": {
              "type": "string",
              "format": "date-time",
              "description": "The date/time when this supplement was created."
            },
            "createdBy": {
              "$ref": "#/$defs/companyUserLink"
            },
            "editedDate": {
              "type": "string",
              "format": "date-time",
              "description": "The date/time when this supplement was last updated."
            },
            "editedBy": {
              "$ref": "#/$defs/companyUserLink"
            },
            "closedDate": {
              "type": "string",
              "format": "date-time",
              "description": "The date/time when this supplement was closed."
            },
            "closedBy": {
              "$ref": "#/$defs/companyUserLink"
            },
            "appliedDate": {
              "type": "string",
              "format": "date-time",
              "description": "The date/time when this supplement was applied."
            },
            "appliedBy": {
              "$ref": "#/$defs/companyUserLink"
            }
          }
        }
      ]
    },
    "supplementItem": {
      "allOf": [
        {
          "$ref": "#/$defs/supplementItemLink"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The name of the supplement item."
            },
            "description": {
              "type": "string",
              "description": "The supplement item description."
            },
            "originalClaimAmount": {
              "type": "number",
              "format": "float",
              "description": "Supplement item original claim amount."
            },
            "requestedAmount": {
              "type": "number",
              "format": "float",
              "description": "Supplement item requested amount."
            },
            "approvedAmount": {
              "type": "number",
              "format": "float",
              "description": "Supplement item approved amount."
            },
            "appliedAmount": {
              "type": "number",
              "format": "float",
              "description": "Supplement item amount applied to Worksheet."
            }
          }
        }
      ]
    },
    "supplementItemLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The supplement item unique identifier."
        },
        "_link": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the supplement item."
        }
      }
    },
    "supplementItems": {
      "type": "object",
      "properties": {
        "totalOriginalClaimAmount": {
          "type": "number",
          "format": "float",
          "description": "Total of supplement items original claim amounts"
        },
        "totalRequestedAmount": {
          "type": "number",
          "format": "float",
          "description": "Total of supplement items requested amounts"
        },
        "totalApprovedAmount": {
          "type": "number",
          "format": "float",
          "description": "Total of supplement items approved amounts"
        },
        "totalAppliedAmount": {
          "type": "number",
          "format": "float",
          "description": "Total of supplement items applied amounts"
        },
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/supplementItem"
          }
        }
      }
    },
    "supplementLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The supplement unique identifier."
        },
        "_link": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the supplement."
        }
      }
    },
    "supplementNotation": {
      "allOf": [
        {
          "$ref": "#/$defs/supplementNotationLink"
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "$ref": "#/$defs/supplementStatusLink"
            },
            "spokeWith": {
              "type": "string",
              "description": "The Notation SpokeWith Text."
            },
            "notes": {
              "type": "string",
              "description": "The Notation Notes."
            },
            "phone": {
              "type": "string",
              "description": "The Notation 10 digit phone number text.",
              "pattern": "^(?:\\(\\d{3}\\)|\\d{3})[-.\\s]?\\d{3}[-.\\s]?\\d{4}$"
            },
            "extension": {
              "type": "string",
              "description": "The Notation Extension Text."
            },
            "fax": {
              "type": "string",
              "description": "The Notation 10 digit fax number text.",
              "pattern": "^(?:\\(\\d{3}\\)|\\d{3})[-.\\s]?\\d{3}[-.\\s]?\\d{4}$"
            },
            "email": {
              "type": "string",
              "description": "The Notation Email Text.",
              "format": "email"
            },
            "createdBy": {
              "$ref": "#/$defs/companyUserLink"
            },
            "createdDate": {
              "type": "string",
              "format": "date-time",
              "description": "The date/time when this notation was created."
            },
            "emailRecipients": {
              "$ref": "#/$defs/supplementNotationEmailRecipients"
            }
          }
        }
      ]
    },
    "supplementNotationEmailRecipient": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The identifier for the notation recipient."
        },
        "companyUser": {
          "$ref": "#/$defs/companyUserLink"
        }
      }
    },
    "supplementNotationEmailRecipients": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/supplementNotationEmailRecipient"
      }
    },
    "supplementNotationLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The Notation unique identifier."
        },
        "_link": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the supplement notation."
        }
      }
    },
    "supplementNotations": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/supplementNotation"
      }
    },
    "supplementState": {
      "type": "object",
      "properties": {
        "supplementState": {
          "type": "string",
          "enum": [
            "Unknown",
            "Created",
            "InProgress",
            "Closed",
            "Applied",
            "Deleted"
          ],
          "description": "The state of the Supplement."
        }
      }
    },
    "supplementStatusLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "The supplement status unique identifier."
        },
        "_link": {
          "type": "string",
          "format": "uri",
          "description": "The URI of the Supplement Status."
        }
      }
    },
    "supplementerAssigned": {
      "type": "object",
      "properties": {
        "supplementerAssigned": {
          "$ref": "#/$defs/companyUserLink"
        },
        "assignedDate": {
          "type": "string",
          "format": "date-time",
          "description": "The date/time when the supplementer was assigned."
        },
        "assignedBy": {
          "$ref": "#/$defs/companyUserLink"
        }
      }
    }
  }
}