using adas_core.Domain.Enums;
using adas_core.Domain.Models.Filter;
using adas_core.Domain.Models.MongoModels;
using adas_core.Domain.Models.Responses;
using MongoDB.Bson;
namespace adas_core.Application.Services.Interfaces;
public interface IRelayService
{
///
/// Asynchronously checks the current status of the specified relay.
///
/// The relay whose status is being checked.
/// A task that represents the asynchronous operation, containing the current of the relay.
Task CheckRelayStatus(Relay relay);
///
/// Asynchronously checks the current status of the relay identified by the specified identifier.
///
/// The unique identifier of the relay whose status is being queried.
/// A task that represents the asynchronous operation, containing the of the requested relay.
Task CheckRelayStatus(ObjectId relayId);
///
/// Powers on the specified relay.
///
/// The relay to power on.
Task PowerOn(Relay relay);
///
/// Powers off the specified relay by sending a command to deactivate it.
///
/// The relay to power off.
Task PowerOff(Relay relay);
///
/// Sets a manual relay with the specified status for the given point of contact and relay type.
///
/// The status to apply to the manual relay.
/// The identifier of the point of contact associated with the relay.
/// The type of relay to set manually.
Task SetManualRelay(RelayEnum.Status status, ObjectId pocId, RelayEnum.Type type);
///
/// Retrieves a relay by its unique identifier, returning null if no matching relay is found.
///
/// The unique identifier of the relay to look up.
/// A that resolves to the if found, or null if no relay matches the provided identifier.
Task GetById(ObjectId relay);
///
/// Retrieves the list of objects corresponding to the specified collection of relay identifiers.
///
/// The list of values identifying the relays to retrieve. May be null.
/// A containing the relays found for the provided identifiers.
List GetRelayInList(List? relayList);
///
/// Retrieves the relays of a specified type from the provided configuration relay list.
///
/// The list of relay ObjectIds to filter, or null if no configuration relays are available.
/// The relay type to match against the configuration relays.
/// A list of objects that match the specified .
List GetRelayByTypeInList(List? configurationRelayList, RelayEnum.Type type);
///
/// Retrieves a paginated list of relays based on the specified pagination filter.
///
/// The pagination filter containing the criteria used to retrieve the relays.
/// A task that represents the asynchronous operation, containing the paginated response with the requested relays.
Task> GetPaginatedRelays(PaginationFilter request);
///
/// Inserts a new relay record based on the provided request data.
///
/// The relay entity to be inserted.
/// A task that resolves to the inserted , or null if the insert did not return a value.
Task InsertRelay(Relay request);
///
/// Updates an existing relay identified by the specified with the provided data.
/// Returns null when no relay is found with the given identifier.
///
/// The unique identifier of the relay to update.
/// The relay data containing the updated values.
/// A task that resolves to the updated , or null if the relay was not found.
Task UpdateRelayById(ObjectId objectId, Relay relay);
}