{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-company-user-collection-schema.json",
  "title": "companyUserCollection",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-users-api-openapi.yml#/components/schemas/companyUserCollection",
  "allOf": [
    {
      "$ref": "#/$defs/baseCollection"
    },
    {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/companyUser"
          }
        }
      }
    }
  ],
  "$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."
        }
      }
    },
    "companyUser": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique ID of the Company User.",
          "format": "uuid"
        },
        "displayName": {
          "type": "string",
          "description": "The display name of the user."
        },
        "firstName": {
          "type": "string",
          "description": "The user's first name."
        },
        "lastName": {
          "type": "string",
          "description": "The user's last name."
        },
        "initials": {
          "type": "string",
          "description": "The user's initials."
        },
        "role": {
          "$ref": "#/$defs/companyUserRole"
        },
        "status": {
          "type": "string",
          "enum": [
            "Active",
            "Inactive",
            "Archived",
            "Deleted"
          ],
          "description": "the status of this user account."
        },
        "phone": {
          "type": "string",
          "description": "The user's phone number."
        },
        "mobilePhone": {
          "type": "string",
          "description": "The user's mobile phone number."
        },
        "email": {
          "type": "string",
          "description": "The user's email address."
        },
        "_link": {
          "type": "string",
          "description": "The unique URI of the AccuLynx User."
        }
      }
    },
    "companyUserRole": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "description": "The id/enum value of the user role."
        },
        "name": {
          "type": "string",
          "enum": [
            "Company Administrator",
            "Location Administrator",
            "Manager",
            "Office",
            "Sales",
            "Crew"
          ],
          "description": "The name of the role."
        }
      }
    }
  }
}