=== Summary: 675 files | 7 generated | 484 fresh | 4605 untracked | 4268 adopted | 355 marked | 466 validated-ok | 2+0 stale (sig+body) | 0 skipped | 0 failed | elapsed 11:08:11.442 (40091.44s) ===

This commit is contained in:
julian
2026-06-28 02:50:05 -07:00
parent a19fb90902
commit 586f02a2ca
654 changed files with 5260 additions and 0 deletions
@@ -15,6 +15,7 @@ namespace adas_core.Application.Services;
/// <remarks>
/// This service implements <see cref="ICameraService"/> and serves as the application-layer entry point for camera functionality.
/// </remarks>
/// <!-- aidoc:v1 sig=6d5b4e8 -->
public class CameraService(ILogger<CameraService> logger, ICameraRepository cameraRepository, IPointOfCareService pointOfCareService) : ICameraService
{
private ICameraRepository _cameraRepository = cameraRepository;
@@ -24,6 +25,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// </summary>
/// <param name="relayId">The unique identifier of the relay used to look up the camera.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the matching <see cref="Camera"/>, or null if no camera is found.</returns>
/// <!-- aidoc:v1 sig=b585cc5 body=450c6f8 -->
public Task<Camera?> GetById(ObjectId relayId)
{
return _cameraRepository.GetById(relayId);
@@ -33,6 +35,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// </summary>
/// <param name="configurationRelayList">The list of configuration relay identifiers used to look up the corresponding cameras.</param>
/// <returns>A <see cref="List{Camera}"/> containing the cameras linked to the provided configuration relay identifiers.</returns>
/// <!-- aidoc:v1 sig=63176e6 body=610970a -->
public List<Camera> GetCameraInList(List<ObjectId> configurationRelayList)
{
return _cameraRepository.GetCameraInList(configurationRelayList);
@@ -43,6 +46,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// </summary>
/// <param name="filter">The pagination filter that controls page number, page size, and optional filtering criteria such as the in-use flag.</param>
/// <returns>A paginated response containing the requested cameras, the current page metadata, and the total document count; if no data is found, an empty paginated response is returned.</returns>
/// <!-- aidoc:v1 sig=6103643 body=d38962d -->
public async Task<PaginationResponse<Camera>> GetPaginatedCameras(PaginationFilter filter)
{
var usedCameraIds = await pointOfCareService.FindAllIdCamerasInUse();
@@ -91,6 +95,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// <returns>The inserted camera, or null if the insertion did not return a result.</returns>
/// <exception cref="System.Exception">Thrown when the camera name is null.</exception>
/// <exception cref="System.Exception">Thrown when a camera with the same name already exists.</exception>
/// <!-- aidoc:v1 sig=79f6b28 body=dcffae0 -->
public async Task<Camera?> InsertCamera(Camera camera)
{
if (camera.Name == null) throw new Exception("Camera name cannot be null");
@@ -105,6 +110,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// <param name="objectId">The unique identifier of the camera to update.</param>
/// <param name="camera">The camera data containing the updated values.</param>
/// <returns>A task that represents the asynchronous operation. The task result contains the updated <see cref="Camera"/>, or <c>null</c> if no camera with the specified identifier was found.</returns>
/// <!-- aidoc:v1 sig=b7e4a05 body=a5d1055 -->
public async Task<Camera?> UpdateCameraById(ObjectId objectId, Camera camera)
{
return await _cameraRepository.UpdateCameraAsync(objectId, camera);
@@ -115,6 +121,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// </summary>
/// <param name="objectId">The unique identifier of the camera to delete.</param>
/// <returns><c>true</c> if the camera was successfully deleted; otherwise, <c>false</c>.</returns>
/// <!-- aidoc:v1 sig=38e3ead body=afabb83 -->
public async Task<bool> DeleteCamera(ObjectId objectId)
{
try
@@ -138,6 +145,7 @@ public class CameraService(ILogger<CameraService> logger, ICameraRepository came
/// </summary>
/// <param name="textToSearch">The search text used to find cameras by name.</param>
/// <returns>A task that represents the asynchronous operation, containing a list of <see cref="Camera"/> objects that match the search criteria.</returns>
/// <!-- aidoc:v1 sig=a584e66 body=7c6677d -->
public async Task<List<Camera>> GetSearchByNameCameras(string textToSearch)
{
return await _cameraRepository.GetSearchByNameCameras(textToSearch);