openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: HR Salary Management API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: employees description: Employee management - name: insights description: Salary insights and analytics paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /employees: get: operationId: listEmployees tags: [employees] summary: List employees with pagination and filtering parameters: - name: page in: query schema: type: integer default: 1 - name: limit in: query schema: type: integer default: 50 - name: search in: query schema: type: string - name: country in: query schema: type: string - name: jobTitle in: query schema: type: string - name: department in: query schema: type: string - name: status in: query schema: type: string - name: sortBy in: query schema: type: string enum: [fullName, salary, startDate, country, jobTitle, department, createdAt] default: createdAt - name: sortOrder in: query schema: type: string enum: [asc, desc] default: desc responses: "200": description: Paginated employee list content: application/json: schema: $ref: "#/components/schemas/EmployeeListResponse" post: operationId: createEmployee tags: [employees] summary: Create a new employee requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EmployeeInput" responses: "201": description: Created content: application/json: schema: $ref: "#/components/schemas/Employee" "400": description: Validation error content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /employees/{id}: get: operationId: getEmployee tags: [employees] summary: Get a single employee parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Employee record content: application/json: schema: $ref: "#/components/schemas/Employee" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" patch: operationId: updateEmployee tags: [employees] summary: Update an employee parameters: - name: id in: path required: true schema: type: integer requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/EmployeeUpdate" responses: "200": description: Updated employee content: application/json: schema: $ref: "#/components/schemas/Employee" "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" delete: operationId: deleteEmployee tags: [employees] summary: Delete an employee parameters: - name: id in: path required: true schema: type: integer responses: "204": description: Deleted "404": description: Not found content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /insights/summary: get: operationId: getInsightsSummary tags: [insights] summary: Overall org-wide salary summary responses: "200": description: Summary metrics content: application/json: schema: $ref: "#/components/schemas/InsightsSummary" /insights/by-country: get: operationId: getInsightsByCountry tags: [insights] summary: Salary statistics grouped by country responses: "200": description: Per-country statistics content: application/json: schema: type: array items: $ref: "#/components/schemas/CountryInsight" /insights/by-job-title: get: operationId: getInsightsByJobTitle tags: [insights] summary: Salary statistics grouped by job title, optionally filtered by country parameters: - name: country in: query schema: type: string responses: "200": description: Per-job-title statistics content: application/json: schema: type: array items: $ref: "#/components/schemas/JobTitleInsight" /insights/by-department: get: operationId: getInsightsByDepartment tags: [insights] summary: Salary statistics grouped by department responses: "200": description: Per-department statistics content: application/json: schema: type: array items: $ref: "#/components/schemas/DepartmentInsight" /insights/top-earners: get: operationId: getTopEarners tags: [insights] summary: Top earning employees parameters: - name: limit in: query schema: type: integer default: 10 - name: country in: query schema: type: string responses: "200": description: Top earners list content: application/json: schema: type: array items: $ref: "#/components/schemas/Employee" /insights/filters: get: operationId: getFilterOptions tags: [insights] summary: Distinct filter values for dropdowns responses: "200": description: Available filter options content: application/json: schema: $ref: "#/components/schemas/FilterOptions" components: schemas: HealthStatus: type: object properties: status: type: string required: - status Employee: type: object required: - id - fullName - jobTitle - department - country - salary - email - employmentType - status - startDate - createdAt - updatedAt properties: id: type: integer fullName: type: string jobTitle: type: string department: type: string country: type: string salary: type: number email: type: string employmentType: type: string enum: [full-time, part-time, contract, intern] status: type: string enum: [active, inactive, on-leave] startDate: type: string format: date createdAt: type: string format: date-time updatedAt: type: string format: date-time EmployeeInput: type: object required: - fullName - jobTitle - department - country - salary - email - employmentType - status - startDate properties: fullName: type: string minLength: 1 jobTitle: type: string minLength: 1 department: type: string minLength: 1 country: type: string minLength: 1 salary: type: number minimum: 0 email: type: string format: email employmentType: type: string enum: [full-time, part-time, contract, intern] status: type: string enum: [active, inactive, on-leave] startDate: type: string format: date EmployeeUpdate: type: object properties: fullName: type: string minLength: 1 jobTitle: type: string minLength: 1 department: type: string minLength: 1 country: type: string minLength: 1 salary: type: number minimum: 0 email: type: string format: email employmentType: type: string enum: [full-time, part-time, contract, intern] status: type: string enum: [active, inactive, on-leave] startDate: type: string format: date EmployeeListResponse: type: object required: - data - total - page - limit - totalPages properties: data: type: array items: $ref: "#/components/schemas/Employee" total: type: integer page: type: integer limit: type: integer totalPages: type: integer InsightsSummary: type: object required: - totalEmployees - totalPayroll - avgSalary - minSalary - maxSalary - activeEmployees - countriesCount - departmentsCount properties: totalEmployees: type: integer totalPayroll: type: number avgSalary: type: number minSalary: type: number maxSalary: type: number activeEmployees: type: integer countriesCount: type: integer departmentsCount: type: integer CountryInsight: type: object required: - country - employeeCount - avgSalary - minSalary - maxSalary - totalPayroll properties: country: type: string employeeCount: type: integer avgSalary: type: number minSalary: type: number maxSalary: type: number totalPayroll: type: number JobTitleInsight: type: object required: - jobTitle - employeeCount - avgSalary - minSalary - maxSalary properties: jobTitle: type: string employeeCount: type: integer avgSalary: type: number minSalary: type: number maxSalary: type: number DepartmentInsight: type: object required: - department - employeeCount - avgSalary - minSalary - maxSalary - totalPayroll properties: department: type: string employeeCount: type: integer avgSalary: type: number minSalary: type: number maxSalary: type: number totalPayroll: type: number FilterOptions: type: object required: - countries - departments - jobTitles - employmentTypes - statuses properties: countries: type: array items: type: string departments: type: array items: type: string jobTitles: type: array items: type: string employmentTypes: type: array items: type: string statuses: type: array items: type: string ErrorResponse: type: object required: - error properties: error: type: string