Swagger Documentation Enhancement (273)

This commit is contained in:
Santhosh S
2023-08-24 21:25:38 -04:00
parent 9345ee2ca5
commit e56ffae1a4
22 changed files with 288 additions and 49 deletions

View File

@ -15,7 +15,11 @@ namespace DamageAssesment.Api.Employees.Controllers
{
this.EmployeeProvider = EmployeesProvider;
}
//get all Employees
/// <summary>
/// GET request for retrieving employees.
/// </summary>
[HttpGet("Employees")]
public async Task<ActionResult> GetEmployeesAsync()
{
@ -28,7 +32,11 @@ namespace DamageAssesment.Api.Employees.Controllers
return NoContent();
}
//get Employee based on Employeeid
/// <summary>
/// GET request for retrieving an employee by ID.
/// </summary>
[HttpGet("Employees/{Id}")]
public async Task<ActionResult> GetEmployeeByIdAsync(string Id)
{
@ -41,8 +49,11 @@ namespace DamageAssesment.Api.Employees.Controllers
return NotFound();
}
//update existing Employee
/// <summary>
/// PUT request for updating an existing employee.
/// </summary>
/// <param name="Employee">The updated employee object.</param>
[HttpPut("Employees")]
public async Task<IActionResult> UpdateEmployee(Db.Employee Employee)
{
@ -60,7 +71,11 @@ namespace DamageAssesment.Api.Employees.Controllers
}
return NotFound();
}
//save new Employee
/// <summary>
/// POST request for creating a new employee.
/// </summary>
/// <param name="Employee">The employee information for creating a new employee.</param>
[HttpPost("Employees")]
public async Task<IActionResult> CreateEmployee(Db.Employee Employee)
{
@ -75,7 +90,10 @@ namespace DamageAssesment.Api.Employees.Controllers
}
return CreatedAtRoute("DefaultApi", new { id = Employee.Id }, Employee);
}
//delete existing Employee
/// <summary>
/// DELETE request for deleting an existing employee.
/// </summary>
/// <param name="id">The ID of the employee to be deleted.</param>
[HttpDelete("Employees/{id}")]
public async Task<IActionResult> DeleteEmployee(string id)
{