=== 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.Application.Services;
|
||||
/// Provides the concrete implementation of the <see cref="IDeviceService"/> contract,
|
||||
/// handling device-related service operations defined by the interface.
|
||||
/// </summary>
|
||||
/// <!-- aidoc:v1 sig=16670f2 -->
|
||||
public class DeviceService : IDeviceService
|
||||
{
|
||||
private readonly IDeviceRepository _deviceRepository;
|
||||
@@ -53,6 +54,7 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="dto">The data transfer object containing the device information to convert.</param>
|
||||
/// <returns>A new <see cref="Device"/> entity populated with the values from the supplied DTO.</returns>
|
||||
/// <!-- aidoc:v1 sig=178c6f2 body=778e6dd -->
|
||||
public Device ToEntity(DeviceDto dto)
|
||||
{
|
||||
return new Device()
|
||||
@@ -78,6 +80,8 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="deviceDto">The data transfer object containing the device information to be mapped and stored.</param>
|
||||
/// <returns>The created <see cref="Device"/> entity after successful insertion, or <see langword="null"/> if the device could not be created.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=high kind=wrong_returns
|
||||
/// "Documentation states the method returns null 'if the device could not be created', but the code has no such null return path—it always returns the non-null device entity after insertion." -->
|
||||
public async Task<Device?> Create(DeviceDto deviceDto)
|
||||
{
|
||||
var device = ToEntity(deviceDto);
|
||||
@@ -93,6 +97,7 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="objectId">The unique identifier of the object to delete.</param>
|
||||
/// <returns>A task that resolves to <c>true</c> if the object was deleted; otherwise, <c>false</c>.</returns>
|
||||
/// <!-- aidoc:v1 sig=346f3e0 body=6d416f7 -->
|
||||
public async Task<bool> Delete(ObjectId objectId)
|
||||
{
|
||||
return await _deviceRepository.DeleteAsync(objectId) != null;
|
||||
@@ -103,6 +108,8 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="deviceDto">The data transfer object containing the updated device information.</param>
|
||||
/// <returns>The updated <see cref="Device"/> entity, or <c>null</c> if no device is returned.</returns>
|
||||
/// <!-- aidoc-review:v1 severity=medium kind=wrong_returns
|
||||
/// "The documentation states 'or null if no device is returned', but the implementation always returns the device produced by ToEntity with no null return path." -->
|
||||
public async Task<Device?> Update(DeviceDto deviceDto)
|
||||
{
|
||||
var device = ToEntity(deviceDto);
|
||||
@@ -116,6 +123,7 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="deviceDto">The data transfer object containing the device information from the event, used for lookup and creation.</param>
|
||||
/// <returns>The existing or newly created <see cref="Device"/> associated with the event.</returns>
|
||||
/// <!-- aidoc:v1 sig=12e98a9 body=1a956d8 -->
|
||||
public async Task<Device?> ReceiveEvent(DeviceDto deviceDto)
|
||||
{
|
||||
Device? deviceExist = null;
|
||||
@@ -168,6 +176,7 @@ public class DeviceService : IDeviceService
|
||||
/// </summary>
|
||||
/// <param name="deviceExist">The existing device whose configured action settings determine which action to execute.</param>
|
||||
/// <param name="deviceDto">The incoming device event payload providing the click type that triggers the action.</param>
|
||||
/// <!-- aidoc:v1 sig=818bb69 body=1d9bf5b -->
|
||||
private async Task ManageDeviceButton(Device deviceExist, DeviceDto deviceDto)
|
||||
{
|
||||
if (deviceExist.Settings?.Action?.Type != null && deviceDto.Event?.ClickType != null)
|
||||
@@ -193,6 +202,7 @@ public class DeviceService : IDeviceService
|
||||
/// <param name="settingsAction">The device action containing the configuration observation and the per-click-type alarm values to use.</param>
|
||||
/// <param name="eventClickType">The click event that triggered the action, which determines which value from the device action is sent.</param>
|
||||
/// <param name="deviceExistPointOfCareIds">The list of point of care identifiers whose patients should receive the alarm.</param>
|
||||
/// <!-- aidoc:v1 sig=f9291cd body=9b90588 -->
|
||||
private async Task SendAlarmOnAction(
|
||||
DeviceAction settingsAction,
|
||||
ClickType eventClickType,
|
||||
@@ -256,6 +266,7 @@ public class DeviceService : IDeviceService
|
||||
/// <param name="eventClickType">The type of click event that triggered the action; selects which value (single, double, or hold) is assigned to the observation.</param>
|
||||
/// <param name="deviceExistPointOfCareIds">The list of point of care identifiers whose resolved patients will receive the generated observation.</param>
|
||||
/// <returns>A task that represents the asynchronous send operation; no meaningful business result is returned.</returns>
|
||||
/// <!-- aidoc:v1 sig=4c6f5ee body=ef5e8c7 -->
|
||||
private async Task SendObservationOnAction(
|
||||
DeviceAction settingsAction,
|
||||
ClickType eventClickType,
|
||||
|
||||
Reference in New Issue
Block a user