Skip to content

Commit 76c232d

Browse files
committed
docs: add add XML documentation
1 parent 80aaa94 commit 76c232d

39 files changed

Lines changed: 572 additions & 19 deletions

AirCompany/AirCompany.Api.Host/Controllers/AircraftFamilyController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
namespace AirCompany.Api.Host.Controllers;
77

8-
8+
/// <summary>
9+
/// API Controller for managing Aircraft family entities
10+
/// Inherits standard CRUD
11+
/// </summary>
912
[Route("api/[controller]")]
1013
[ApiController]
1114
public class AircraftFamilyController(IApplicationService<AircraftFamilyDto, AircraftFamilyCreateUpdateDto, Guid> service, ILogger<AircraftFamilyController> logger)

AirCompany/AirCompany.Api.Host/Controllers/AircraftModelController.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
namespace AirCompany.Api.Host.Controllers;
66

7+
/// <summary>
8+
/// The controller for controlling Aircraft models
9+
/// Inherits from the basic CRUD controller and adds methods for obtaining related aircraft and flight families
10+
/// </summary>
711
[Route("api/[controller]")]
812
[ApiController]
913
public class AircraftModelController(IAircraftModelService service, ILogger<AircraftModelController> logger)
1014
: CrudControllerBase<AircraftModelDto, AircraftModelCreateUpdateDto, Guid>(service, logger)
1115
{
16+
/// <summary>
17+
/// Getting the aircraft family associated with this model
18+
/// </summary>
19+
/// <param name="id">Model ID</param>
20+
/// <returns>DTO family</returns>
1221
[HttpGet("{id}/AircraftFamily")]
1322
[ProducesResponseType(200)]
1423
[ProducesResponseType(404)]

AirCompany/AirCompany.Api.Host/Controllers/AnalyticsController.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55

66
namespace AirCompany.Api.Host.Controllers;
77

8+
/// <summary>
9+
/// The controller for airline analytics
10+
/// Provides aggregated data on flights and passengers
11+
/// </summary>
812
[Route("api/[controller]")]
913
[ApiController]
1014
public class AnalyticsController(IAnalyticsService service, ILogger<AnalyticsController> logger) : Controller
1115
{
16+
/// <summary>
17+
/// Getting the top 5 flights by number of passengers
18+
/// </summary>
19+
/// <returns>List of DTO flights</returns>
1220
[HttpGet("top-flights-by-passenger")]
1321
[ProducesResponseType(200)]
1422
[ProducesResponseType(500)]
@@ -28,6 +36,10 @@ public async Task<ActionResult<List<FlightDto>>> GetTop5FlightsByPassengerCount(
2836
}
2937
}
3038

39+
/// <summary>
40+
/// Getting flights with a minimum duration
41+
/// </summary>
42+
/// <returns>List of DTO flights</returns>
3143
[HttpGet("flights-with-minimum-duration")]
3244
[ProducesResponseType(200)]
3345
[ProducesResponseType(500)]
@@ -47,6 +59,11 @@ public async Task<ActionResult<List<FlightDto>>> GetFlightsWithMinimumDuration()
4759
}
4860
}
4961

62+
/// <summary>
63+
/// Receiving passengers on the selected flight without luggage
64+
/// </summary>
65+
/// <param name="flightId">Flight ID</param>
66+
/// <returns>List of DTO passengers</returns>
5067
[HttpGet("passengers-with-zero-baggage-by-flight")]
5168
[ProducesResponseType(200)]
5269
[ProducesResponseType(500)]
@@ -66,6 +83,13 @@ public async Task<ActionResult<List<PassengerDto>>> GetPassengersWithZeroBaggage
6683
}
6784
}
6885

86+
/// <summary>
87+
/// Getting flights of a certain aircraft model in a given period
88+
/// </summary>
89+
/// <param name="modelId">Model ID</param>
90+
/// <param name="startPeriod">Beginning of the period</param>
91+
/// <param name="endPeriod">End of the period</param>
92+
/// <returns>List of DTO flights</returns>
6993
[HttpGet("flights-by-model-and-period")]
7094
[ProducesResponseType(200)]
7195
[ProducesResponseType(500)]
@@ -85,6 +109,12 @@ public async Task<ActionResult<List<PassengerDto>>> GetFlightsByModelAndPeriod(G
85109
}
86110
}
87111

112+
/// <summary>
113+
/// Receiving flights between two airports
114+
/// </summary>
115+
/// <param name="departureAirport">Departure airport</param>
116+
/// <param name="arrivalAirport">Airport of arrival</param>
117+
/// <returns>List of DTO flights</returns>
88118
[HttpGet("flights-by-route")]
89119
[ProducesResponseType(200)]
90120
[ProducesResponseType(500)]

AirCompany/AirCompany.Api.Host/Controllers/CrudControllerBase.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,15 @@
33

44
namespace AirCompany.Api.Host.Controllers;
55

6+
/// <summary>
7+
/// The basic controller for working with entities through CRUD operations
8+
/// Provides standard methods for creating, receiving, updating, and deleting data
9+
/// </summary>
10+
/// <typeparam name="TDto">DTO type for read operations</typeparam>
11+
/// <typeparam name="TCreateUpdateDto">DTO type for creation and update operations</typeparam>
12+
/// <typeparam name="TKey">The type of the DTO identifier </typeparam>
13+
/// <param name="appService">An application service that implements CRUD operations on DTO</param>
14+
/// <param name="logger">Logger for recording information about method execution and exceptions</param>
615
[Route("api/[controller]")]
716
[ApiController]
817
public abstract class CrudControllerBase<TDto, TCreateUpdateDto, TKey>(IApplicationService<TDto, TCreateUpdateDto, TKey> appService,
@@ -11,6 +20,11 @@ public abstract class CrudControllerBase<TDto, TCreateUpdateDto, TKey>(IApplicat
1120
where TCreateUpdateDto : class
1221
where TKey : struct
1322
{
23+
/// <summary>
24+
/// Creating a new entity record
25+
/// </summary>
26+
/// <param name="newDto">DTO with data for creating a new entity</param>
27+
/// <returns>The created DTO object with the assigned ID</returns>
1428
[HttpPost]
1529
[ProducesResponseType(201)]
1630
[ProducesResponseType(500)]
@@ -30,6 +44,12 @@ public async Task<ActionResult<TDto>> Create(TCreateUpdateDto newDto)
3044
}
3145
}
3246

47+
/// <summary>
48+
/// Updating an existing entity record by ID
49+
/// </summary>
50+
/// <param name="id">ID of the entity to update</param>
51+
/// <param name="newDto">DTO with updated data</param>
52+
/// <returns>Updated DTO object</returns>
3353
[HttpPut("{id}")]
3454
[ProducesResponseType(200)]
3555
[ProducesResponseType(404)]
@@ -54,6 +74,11 @@ public async Task<ActionResult<TDto>> Edit(Guid id, TCreateUpdateDto newDto)
5474
}
5575
}
5676

77+
/// <summary>
78+
/// Deleting an existing entity record by ID
79+
/// </summary>
80+
/// <param name="id">ID of the entity to delete</param>
81+
/// <returns>true if deletion is successful, otherwise false</returns>
5782
[HttpDelete("{id}")]
5883
[ProducesResponseType(200)]
5984
[ProducesResponseType(204)]
@@ -74,6 +99,10 @@ public async Task<IActionResult> Delete(Guid id)
7499
}
75100
}
76101

102+
/// <summary>
103+
/// Getting a list of all entities
104+
/// </summary>
105+
/// <returns>List of DTOs of all entities</returns>
77106
[HttpGet]
78107
[ProducesResponseType(200)]
79108
[ProducesResponseType(500)]
@@ -93,6 +122,11 @@ public async Task<ActionResult<IList<TDto>>> GetAll()
93122
}
94123
}
95124

125+
/// <summary>
126+
/// Getting one entity by ID
127+
/// </summary>
128+
/// <param name="id">ID of the desired entity</param>
129+
/// <returns>The DTO of the entity, if found, otherwise NotFound</returns>
96130
[HttpGet("{id}")]
97131
[ProducesResponseType(200)]
98132
[ProducesResponseType(404)]

AirCompany/AirCompany.Api.Host/Controllers/FlightController.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,20 @@
44

55
namespace AirCompany.Api.Host.Controllers;
66

7+
/// <summary>
8+
/// The flight management controller
9+
/// Inherits from the basic CRUD controller and adds methods to retrieve related passengers and aircraft models
10+
/// </summary>
711
[Route("api/[controller]")]
812
[ApiController]
913
public class FlightController(IFlightService service, ILogger<FlightController> logger)
1014
: CrudControllerBase<FlightDto, FlightCreateUpdateDto, Guid>(service, logger)
1115
{
16+
/// <summary>
17+
/// Getting the aircraft model associated with this flight
18+
/// </summary>
19+
/// <param name="id">Flight ID</param>
20+
/// <returns>DTO of the model</returns>
1221
[HttpGet("{id}/AircraftModel")]
1322
[ProducesResponseType(200)]
1423
[ProducesResponseType(404)]

AirCompany/AirCompany.Api.Host/Controllers/PassengerController.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
namespace AirCompany.Api.Host.Controllers;
77

8+
/// <summary>
9+
/// API Controller for managing Passenger entities
10+
/// Inherits standard CRUD
11+
/// </summary>
812
[Route("api/[controller]")]
913
[ApiController]
1014
public class PassengerController(IApplicationService<PassengerDto, PassengerCreateUpdateDto, Guid> service, ILogger<PassengerController> logger)

AirCompany/AirCompany.Api.Host/Controllers/TicketController.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,20 @@
55

66
namespace AirCompany.Api.Host.Controllers;
77

8+
/// <summary>
9+
/// The ticket management controller
10+
/// Inherits from the basic CRUD controller and adds methods to retrieve the associated passenger and flight
11+
/// </summary>
812
[Route("api/[controller]")]
913
[ApiController]
1014
public class TicketController(ITicketService service, ILogger<TicketController> logger)
1115
: CrudControllerBase<TicketDto, TicketCreateUpdateDto, Guid>(service, logger)
1216
{
17+
/// <summary>
18+
/// Receipt of the flight to which this ticket is attached
19+
/// </summary>
20+
/// <param name="id">Ticket ID</param>
21+
/// <returns>Flight DTO</returns>
1322
[HttpGet("{id}/Flight")]
1423
[ProducesResponseType(200)]
1524
[ProducesResponseType(404)]
@@ -35,6 +44,11 @@ public async Task<ActionResult<FlightDto>> GetFlight(Guid id)
3544
}
3645
}
3746

47+
/// <summary>
48+
/// Receipt of the passenger who owns this ticket
49+
/// </summary>
50+
/// <param name="id">Ticket ID</param>
51+
/// <returns>Passenger's DTO</returns>
3852
[HttpGet("{id}/Passenger")]
3953
[ProducesResponseType(200)]
4054
[ProducesResponseType(404)]
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
namespace AirCompany.Application.Contracts.AircraftFamily;
22

3+
/// <summary>
4+
/// DTO for creating and updating aircraft family information
5+
/// </summary>
6+
/// <param name="FamilyName">The name of the aircraft family</param>
7+
/// <param name="Manufacturer">The manufacturer of the aircraft family</param>
38
public record AircraftFamilyCreateUpdateDto(string FamilyName, string Manufacturer);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
namespace AirCompany.Application.Contracts.AircraftFamily;
22

3+
4+
/// <summary>
5+
/// DTO for reading aircraft family information
6+
/// </summary>
7+
/// <param name="Id">The unique identifier of the aircraft family</param>
8+
/// <param name="FamilyName">The name of the aircraft family</param>
9+
/// <param name="Manufacturer">The manufacturer of the aircraft family</param>
310
public record AircraftFamilyDto(Guid Id, string FamilyName, string Manufacturer);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,11 @@
11
namespace AirCompany.Application.Contracts.AircraftModel;
2+
3+
/// <summary>
4+
/// Data transfer object for creating and updating aircraft model information
5+
/// </summary>
6+
/// <param name="ModelName">The name of the aircraft model</param>
7+
/// <param name="FlightRangeKm">The maximum flight range in kilometers that this aircraft model can achieve</param>
8+
/// <param name="PassengerCapacity">The maximum number of passengers this aircraft model can accommodate</param>
9+
/// <param name="CargoCapacityKg">The maximum cargo capacity in kilograms this aircraft model can carry</param>
10+
/// <param name="AircraftFamily">The unique identifier of the aircraft family to which this model belongs</param>
211
public record AircraftModelCreateUpdateDto(string ModelName, double FlightRangeKm, int PassengerCapacity, double CargoCapacityKg, Guid AircraftFamily);

0 commit comments

Comments
 (0)