{
    "openapi": "3.0.0",
    "info": {
        "title": "HRM API Documentation",
        "description": "API Documentation for the HRM, BU web application",
        "contact": {
            "email": "software@babcock.edu.ng"
        },
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "http://my-default-host.com",
            "description": "HRM API Server"
        }
    ],
    "paths": {
        "/auth/external_login": {
            "post": {
                "tags": [
                    "Authentication"
                ],
                "summary": "Authenticate to access other admin functions",
                "description": "Returns token",
                "operationId": "external_login",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ExternalLoginRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Token"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            }
        },
        "/office": {
            "get": {
                "tags": [
                    "Office Details"
                ],
                "summary": "Get list of Active Offices",
                "description": "Returns list of active offices",
                "operationId": "index",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/OfficeResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            }
        },
        "/current_employees": {
            "get": {
                "tags": [
                    "Employee Details"
                ],
                "summary": "Get list of current Employees",
                "description": "Returns list of employees",
                "operationId": "current_employees",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EmployeeResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            }
        },
        "/get_current_employees_anonymous": {
            "get": {
                "tags": [
                    "Employee Details"
                ],
                "summary": "Get list of current Employees without names",
                "description": "Returns list of employees without names",
                "operationId": "get_current_employees_anonymous",
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/EmployeeResource"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    }
                }
            }
        },
        "/get_staff_by_email/{email}": {
            "get": {
                "tags": [
                    "Employee Details"
                ],
                "summary": "Get Employee detail",
                "description": "Returns Employee Details",
                "operationId": "getStaffByEmail",
                "parameters": [
                    {
                        "name": "email",
                        "in": "path",
                        "description": "Employee Email",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Staff"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad Request"
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "404": {
                        "description": "Staff Details not Found"
                    }
                },
                "security": [
                    {
                        "sanctum": []
                    }
                ]
            }
        }
    },
    "components": {
        "schemas": {
            "ExternalLoginRequest": {
                "title": "External Login request",
                "description": "External Login request body data",
                "required": [
                    "email",
                    "password"
                ],
                "properties": {
                    "email": {
                        "title": "email",
                        "description": "Email of Developer",
                        "type": "string",
                        "example": "developer@email.com"
                    },
                    "password": {
                        "title": "password",
                        "description": "Password of the Developer",
                        "type": "string",
                        "example": "ejkwnfjeijwi#"
                    }
                },
                "type": "object"
            },
            "Office": {
                "title": "Office",
                "description": "Office model",
                "properties": {
                    "office_name": {
                        "title": "office_name",
                        "description": "Name of Office",
                        "type": "string",
                        "example": "Information Technology"
                    },
                    "office_level": {
                        "title": "office_level",
                        "description": "Organogram level of Office",
                        "type": "integer",
                        "example": "1"
                    },
                    "parent_id": {
                        "title": "parent_id",
                        "description": "ID of the Parent office",
                        "type": "integer",
                        "example": "1"
                    },
                    "parent_name": {
                        "title": "parent_office",
                        "description": "Parent office Name",
                        "type": "integer",
                        "example": "Communication Department"
                    }
                },
                "type": "object",
                "xml": {
                    "name": "Office"
                }
            },
            "EmployeeResource": {
                "title": "EmployeeResource",
                "description": "Employee resource",
                "properties": {
                    "data": {
                        "title": "Data",
                        "description": "Data wrapper",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Staff"
                        }
                    }
                },
                "type": "object",
                "xml": {
                    "name": "EmployeeResource"
                }
            },
            "OfficeResource": {
                "title": "OfficeResource",
                "description": "Office resource",
                "properties": {
                    "data": {
                        "title": "Data",
                        "description": "Data wrapper",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Office"
                        }
                    }
                },
                "type": "object",
                "xml": {
                    "name": "OfficeResource"
                }
            },
            "Staff": {
                "title": "Staff",
                "description": "Staff model",
                "properties": {
                    "full_name": {
                        "title": "full_name",
                        "description": "Staff Full Name",
                        "type": "string",
                        "format": "SURNAME, Firstname Othernames"
                    },
                    "surname": {
                        "title": "Surname",
                        "description": "Surname of Staff",
                        "type": "string",
                        "example": "MELVIN"
                    },
                    "firstname": {
                        "title": "Firstname",
                        "description": "Firstname of Staff",
                        "type": "string",
                        "example": "John"
                    },
                    "othernames": {
                        "title": "Othernames",
                        "description": "Othernames of Staff",
                        "type": "string",
                        "example": "Doe"
                    },
                    "staff_no": {
                        "title": "BU ID Number",
                        "description": "ID that uniquely identify each staff",
                        "type": "string",
                        "example": "BU/01/M/1451"
                    },
                    "nationality": {
                        "title": "Nationality",
                        "description": "Country of Origin",
                        "type": "string",
                        "example": "Nigerian"
                    },
                    "state_of_origin": {
                        "title": "State Of Origin",
                        "description": "Staff Of Origin",
                        "type": "string",
                        "example": "Ogun State"
                    },
                    "marital_status": {
                        "title": "Marital Status",
                        "type": "string",
                        "example": "Single"
                    },
                    "blood_group": {
                        "title": "Blood Group",
                        "description": "Staff Blood Group",
                        "type": "string",
                        "example": "O+"
                    },
                    "office": {
                        "title": "Staff Office",
                        "description": "Current Office of the Staff",
                        "type": "string",
                        "example": "Information Technology"
                    },
                    "designation": {
                        "title": "Staff Designation",
                        "description": "Staff Designation/Position",
                        "type": "string",
                        "example": "Software Developer"
                    },
                    "level": {
                        "title": "Level",
                        "description": "Employee Level",
                        "type": "integer",
                        "example": "8"
                    },
                    "employment_status": {
                        "title": "Employment Status",
                        "description": "Employee Status",
                        "type": "string",
                        "example": "Regular"
                    },
                    "date_employed": {
                        "title": "Employment Date",
                        "description": "Date Employee was Employed",
                        "type": "string",
                        "format": "YYYY-MM-DD",
                        "example": "2022-01-01"
                    }
                },
                "type": "object",
                "xml": {
                    "name": "Staff"
                }
            },
            "Token": {
                "title": "Token",
                "description": "Token returned after login in",
                "properties": {
                    "token": {
                        "title": "token",
                        "description": "token Returned",
                        "type": "string"
                    }
                },
                "type": "string"
            }
        },
        "securitySchemes": {
            "sanctum": {
                "type": "apiKey",
                "description": "Enter token in format (Bearer <token>)",
                "name": "Authorization",
                "in": "header"
            }
        }
    },
    "tags": [
        {
            "name": "HRM APIs",
            "description": "API Endpoints of HRM Web Portal"
        }
    ],
    "security": [
        {
            "sanctum": []
        }
    ]
}