=== 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:
@@ -13,6 +13,7 @@ namespace adas_core.Infrastructure.Repositories;
|
||||
/// <remarks>
|
||||
/// Inherits the generic MongoDB persistence capabilities of <see cref="MongoRepository{TDocument}"/>, specializing them for the <see cref="PumpAlarmEvent"/> entity type.
|
||||
/// </remarks>
|
||||
/// <!-- aidoc:v1 sig=bf52831 -->
|
||||
public class PumpAlarmEventRepository : MongoRepository<PumpAlarmEvent>, IPumpAlarmEventRepository
|
||||
{
|
||||
private readonly ApiSettings _apiSettings;
|
||||
@@ -88,6 +89,15 @@ public class PumpAlarmEventRepository : MongoRepository<PumpAlarmEvent>, IPumpAl
|
||||
await Collection.InsertOneAsync(alarmEvent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronously retrieves <see cref="PumpAlarmEvent"/> records for the specified device, optionally constrained by an inclusive time range and a maximum result count.
|
||||
/// </summary>
|
||||
/// <param name="deviceId">The identifier of the device whose alarm events are queried.</param>
|
||||
/// <param name="from">Optional inclusive lower bound on the event time; when <see langword="null"/>, no lower bound is applied.</param>
|
||||
/// <param name="to">Optional inclusive upper bound on the event time; when <see langword="null"/>, no upper bound is applied.</param>
|
||||
/// <param name="limit">Optional maximum number of events to return; when <see langword="null"/>, all matching events are returned.</param>
|
||||
/// <returns>A task producing the matching <see cref="PumpAlarmEvent"/> records ordered by time in descending order.</returns>
|
||||
/// <!-- aidoc:v1 sig=ea193a8 body=0e52ba3 -->
|
||||
public async Task<IEnumerable<PumpAlarmEvent>> FindByDeviceIdAsync(string deviceId, DateTime? from = null,
|
||||
DateTime? to = null, int? limit = null)
|
||||
{
|
||||
@@ -111,6 +121,8 @@ public class PumpAlarmEventRepository : MongoRepository<PumpAlarmEvent>, IPumpAl
|
||||
/// <param name="deviceId">The identifier of the device whose latest alarm event is being retrieved.</param>
|
||||
/// <returns>A <see cref="Task{PumpAlarmEvent}"/> that yields the latest <see cref="PumpAlarmEvent"/> associated with <paramref name="deviceId"/>, or <c>null</c> if no matching event is found.</returns>
|
||||
/// <!-- aidoc:v1 sig=f0fbfb3 body=088b34a -->
|
||||
/// <!-- aidoc-review:v1 severity=low kind=wrong_returns
|
||||
/// "The <returns> tag references Task{PumpAlarmEvent} without the nullable annotation, while the actual return type is Task<PumpAlarmEvent?> (though the description text does mention nullability)." -->
|
||||
public async Task<PumpAlarmEvent?> FindLastByDeviceIdAsync(string deviceId)
|
||||
{
|
||||
return await Collection
|
||||
|
||||
Reference in New Issue
Block a user