rama creada apartir de master en j

This commit is contained in:
jrojas
2026-06-26 10:29:23 +02:00
parent 319fd3dfb0
commit c1517fda87
2810 changed files with 1927392 additions and 25392 deletions
@@ -7,11 +7,22 @@ using MongoDB.Bson;
namespace adas_core.Application.Services;
/// <summary>
/// Provides an implementation of the IAlertValuesService interface for managing alert values
/// using a configuration observation repository.
/// </summary>
public class AlertValuesService(IConfigObservationRepository alertValueRepository) : IAlertValuesService
{
/// <summary>
/// Retrieves a <see cref="ConfigObservation"/> by its unique identifier from the alert value repository.
/// Throws a <see cref="NotFoundException"/> when no matching resource is found.
/// </summary>
/// <param name="key">The unique identifier of the configuration observation to retrieve.</param>
/// <returns>The matching <see cref="ConfigObservation"/> if found.</returns>
/// <exception cref="NotFoundException">Thrown when no configuration observation exists for the specified <paramref name="key"/>.</exception>
public async Task<ConfigObservation?> FindByKey(ObjectId key)
{
return await alertValueRepository.FindById(key) ??
throw new NotFoundException(HttpEnum.ErrorMessage.NotFoundResourceMissing);
}
{
return await alertValueRepository.FindById(key) ??
throw new NotFoundException(HttpEnum.ErrorMessage.NotFoundResourceMissing);
}
}