{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/paychex-developer/main/json-schema/paychex-workers-worker-schema.json",
  "title": "Paychex Worker",
  "description": "A worker (employee or contractor) inside a Paychex Flex company.",
  "type": "object",
  "properties": {
    "workerId": { "type": "string", "description": "Paychex Flex worker identifier." },
    "companyId": { "type": "string", "description": "Identifier of the company the worker belongs to." },
    "workerType": { "type": "string", "description": "EMPLOYEE or CONTRACTOR." },
    "workerStatus": { "type": "string", "description": "ACTIVE, TERMINATED, or LEAVE." },
    "name": {
      "type": "object",
      "properties": {
        "givenName": { "type": "string" },
        "middleName": { "type": "string" },
        "familyName": { "type": "string" },
        "preferredName": { "type": "string" }
      }
    },
    "contact": {
      "type": "object",
      "properties": {
        "emailAddress": { "type": "string", "format": "email" },
        "phoneNumber": { "type": "string" },
        "address": {
          "type": "object",
          "properties": {
            "streetLineOne": { "type": "string" },
            "streetLineTwo": { "type": "string" },
            "city": { "type": "string" },
            "stateCode": { "type": "string" },
            "postalCode": { "type": "string" },
            "countryCode": { "type": "string" }
          }
        }
      }
    },
    "employment": {
      "type": "object",
      "properties": {
        "hireDate": { "type": "string", "format": "date" },
        "terminationDate": { "type": "string", "format": "date" },
        "jobTitle": { "type": "string" },
        "departmentCode": { "type": "string" },
        "payFrequency": { "type": "string", "description": "WEEKLY, BIWEEKLY, SEMIMONTHLY, MONTHLY." },
        "payType": { "type": "string", "description": "HOURLY or SALARY." },
        "baseRate": { "type": "number" }
      }
    }
  },
  "required": ["workerId", "companyId"]
}
