object WorkerOfBasicContract
{
  "type": "object",
  "nullable": true,
  "required": [
    "id",
    "full_name",
    "email"
  ],
  "properties": {
    "id": {
      "$ref": "#/components/schemas/UniqueObjectIdentifier"
    },
    "email": {
      "$ref": "#/components/schemas/EmailType"
    },
    "image": {
      "$ref": "#/components/schemas/UrlType"
    },
    "full_name": {
      "type": "string",
      "nullable": false,
      "minLength": 1
    },
    "alternate_email": {
      "$ref": "#/components/schemas/AlternateEmailList"
    }
  },
  "x-internal": true
}
object WorkerOfContract
{
  "type": "object",
  "nullable": true,
  "properties": {
    "id": {
      "$ref": "#/components/schemas/UniqueObjectIdentifier",
      "nullable": false
    },
    "email": {
      "$ref": "#/components/schemas/EmailType"
    },
    "image": {
      "type": "string",
      "format": "url"
    },
    "country": {
      "type": "string",
      "example": "US",
      "nullable": true,
      "description": "Worker's country (location not nationality)"
    },
    "full_name": {
      "type": "string",
      "nullable": false,
      "minLength": 1,
      "description": "Worker's full name."
    },
    "last_name": {
      "type": "string",
      "example": "Doe",
      "nullable": true,
      "maxLength": 255,
      "description": "Worker's last name"
    },
    "first_name": {
      "type": "string",
      "example": "John",
      "nullable": true,
      "maxLength": 255,
      "description": "Worker's first name"
    },
    "nationality": {
      "type": "string",
      "example": "US",
      "nullable": true,
      "description": "Worker's nationality."
    },
    "legal_entity": {
      "$ref": "#/components/schemas/WorkerLegalEntity"
    },
    "date_of_birth": {
      "$ref": "#/components/schemas/DateTimeString"
    },
    "expected_email": {
      "$ref": "#/components/schemas/WorkerEmailType"
    },
    "alternate_email": {
      "$ref": "#/components/schemas/AlternateEmailList"
    }
  },
  "x-internal": true
}
object WorkerTermination
{
  "type": "object",
  "required": [
    "id",
    "last_date_of_work"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "last_date_of_work": {
      "$ref": "#/components/schemas/DateTimeStringRequired"
    }
  }
}
object WorkerTerminationBody
{
  "type": "object",
  "required": [
    "severance",
    "desired_end_date",
    "last_date_of_work",
    "message",
    "is_voluntary"
  ],
  "properties": {
    "message": {
      "type": "string",
      "example": "Termination reason",
      "description": "The reason for terminating the worker's engagement."
    },
    "severance": {
      "type": "object",
      "oneOf": [
        {
          "required": [
            "currency",
            "time_unit",
            "amount",
            "type"
          ],
          "properties": {
            "type": {
              "enum": [
                "TIME"
              ],
              "type": "string",
              "example": "TIME",
              "description": "The type of severance, either in cash or time off."
            },
            "amount": {
              "type": "number",
              "example": 100,
              "description": "The amount of severance, specified in the designated currency."
            },
            "currency": {
              "$ref": "#/components/schemas/CurrencyCode"
            },
            "time_unit": {
              "enum": [
                "DAYS",
                "WEEKS",
                "MONTHS"
              ],
              "type": "string",
              "example": "MONTHS",
              "description": "The unit of time for severance."
            }
          }
        },
        {
          "not": {
            "required": [
              "time_unit"
            ]
          },
          "required": [
            "currency",
            "amount",
            "type"
          ],
          "properties": {
            "type": {
              "enum": [
                "CASH"
              ],
              "type": "string",
              "example": "CASH",
              "description": "The type of severance, either in cash or time off."
            },
            "amount": {
              "type": "number",
              "example": 100,
              "description": "The amount of severance, specified in the designated currency."
            },
            "currency": {
              "$ref": "#/components/schemas/CurrencyCode"
            }
          }
        }
      ]
    },
    "is_voluntary": {
      "type": "boolean",
      "example": true,
      "description": "Indicates whether the worker termination is voluntary (true) or involuntary (false)."
    },
    "desired_end_date": {
      "type": "string",
      "format": "date",
      "example": "2023-12-31T00:00:00.000Z",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The preferred end date for terminating the worker's engagement."
    },
    "last_date_of_work": {
      "type": "string",
      "format": "date",
      "example": "2023-12-31T00:00:00.000Z",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
      "description": "The effective termination date of the worker's employment."
    }
  }
}
object WorkerTerminationBodyContainer
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/components/schemas/WorkerTerminationBody"
    }
  },
  "x-internal": true
}
object WorkerTerminationContainer
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/components/schemas/WorkerTermination"
    }
  }
}
array WorkingLocations
{
  "type": "array",
  "items": {
    "type": "object",
    "required": [
      "id",
      "name"
    ],
    "properties": {
      "id": {
        "$ref": "#/components/schemas/UniqueObjectIdentifier"
      },
      "name": {
        "type": "string",
        "example": "Some locations"
      }
    }
  }
}
object WorkingLocationsContainer
{
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "$ref": "#/components/schemas/WorkingLocations"
    }
  }
}