{
  "openapi": "3.1.1",
  "info": {
    "title": "EPHY | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://ephy.puzzlehr.com/"
    }
  ],
  "paths": {
    "/api/ephy/test": {
      "get": {
        "tags": [
          "EPHY"
        ],
        "summary": "Test the API",
        "description": "Returns a simple success response to confirm the service is running.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/api/ephy/clients": {
      "get": {
        "tags": [
          "EPHY"
        ],
        "summary": "Get clients",
        "description": "Returns all clients stored in the database.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/EphyClientDto"
                  }
                }
              }
            }
          },
          "499": {
            "description": "Client Closed Request"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/ephy/employees": {
      "get": {
        "tags": [
          "EPHY"
        ],
        "summary": "Get employees",
        "description": "Returns employees with optional paging and cursor parameters.",
        "parameters": [
          {
            "name": "includeTerminated",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursorClientId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          },
          {
            "name": "cursorEmployeeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursorEmailAddress",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedEmployeeResponse"
                }
              }
            }
          },
          "499": {
            "description": "Client Closed Request"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/ephy/employees/client/{clientId}": {
      "get": {
        "tags": [
          "EPHY"
        ],
        "summary": "Get employees by client",
        "description": "Returns employees for a specific client ID.",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "name": "includeTerminated",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "cursorClientId",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int64"
            }
          },
          {
            "name": "cursorEmployeeId",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cursorEmailAddress",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PagedEmployeeResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorResponse"
                }
              }
            }
          },
          "499": {
            "description": "Client Closed Request"
          },
          "500": {
            "description": "Internal Server Error",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ApiErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "EmployeeCursor": {
        "type": "object",
        "properties": {
          "clientId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "employeeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "nextUrl": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EphyClientDto": {
        "type": "object",
        "properties": {
          "clientId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EphyEmployeeDto": {
        "type": "object",
        "properties": {
          "firstName": {
            "type": [
              "null",
              "string"
            ]
          },
          "lastName": {
            "type": [
              "null",
              "string"
            ]
          },
          "emailAddress": {
            "type": [
              "null",
              "string"
            ]
          },
          "jobTitle": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientName": {
            "type": [
              "null",
              "string"
            ]
          },
          "city": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "postalCode": {
            "type": [
              "null",
              "string"
            ]
          },
          "remoteOrWorksite": {
            "type": [
              "null",
              "string"
            ]
          },
          "employeeId": {
            "type": [
              "null",
              "string"
            ]
          },
          "clientId": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "PagedEmployeeResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EphyEmployeeDto"
            }
          },
          "nextCursor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmployeeCursor"
              }
            ]
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "EPHY"
    }
  ]
}