27 lines
955 B
C#
27 lines
955 B
C#
|
|
using ControlCenter.Api.Models;
|
||
|
|
|
||
|
|
namespace ControlCenter.Api.Repositories;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Repository interface for accessing and mutating Agent State.
|
||
|
|
/// Provides a clean abstraction over the EF Core data access layer.
|
||
|
|
/// </summary>
|
||
|
|
public interface IAgentStateRepository
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Retrieve all agent states.
|
||
|
|
/// </summary>
|
||
|
|
Task<IReadOnlyList<AgentState>> GetAllAsync(CancellationToken ct = default);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Retrieve a single agent state by its session key.
|
||
|
|
/// Returns null if no agent is found with the given session key.
|
||
|
|
/// </summary>
|
||
|
|
Task<AgentState?> GetBySessionKeyAsync(string sessionKey, CancellationToken ct = default);
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Update the status of an agent by its primary key.
|
||
|
|
/// Returns true if the agent was found and updated, false otherwise.
|
||
|
|
/// </summary>
|
||
|
|
Task<bool> UpdateStatusAsync(Guid id, string status, CancellationToken ct = default);
|
||
|
|
}
|