using ColaFlow.Modules.Mcp.Domain.Entities;
using ColaFlow.Modules.Mcp.Domain.ValueObjects;
namespace ColaFlow.Modules.Mcp.Domain.Repositories;
///
/// Repository interface for PendingChange aggregate root
///
public interface IPendingChangeRepository
{
///
/// Get a pending change by ID
///
Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default);
///
/// Get all pending changes for a tenant
///
Task> GetByTenantAsync(
Guid tenantId,
CancellationToken cancellationToken = default);
///
/// Get pending changes by status
///
Task> GetByStatusAsync(
Guid tenantId,
PendingChangeStatus status,
CancellationToken cancellationToken = default);
///
/// Get expired pending changes (still in PendingApproval status but past expiration time)
///
Task> GetExpiredAsync(
CancellationToken cancellationToken = default);
///
/// Get pending changes by API key
///
Task> GetByApiKeyAsync(
Guid apiKeyId,
CancellationToken cancellationToken = default);
///
/// Get pending changes for a specific entity
///
Task> GetByEntityAsync(
Guid tenantId,
string entityType,
Guid entityId,
CancellationToken cancellationToken = default);
///
/// Check if there are any pending changes for a specific entity
///
Task HasPendingChangesForEntityAsync(
Guid tenantId,
string entityType,
Guid entityId,
CancellationToken cancellationToken = default);
///
/// Add a new pending change
///
Task AddAsync(PendingChange pendingChange, CancellationToken cancellationToken = default);
///
/// Update an existing pending change
///
Task UpdateAsync(PendingChange pendingChange, CancellationToken cancellationToken = default);
///
/// Delete a pending change
///
Task DeleteAsync(PendingChange pendingChange, CancellationToken cancellationToken = default);
///
/// Save changes to the database
///
Task SaveChangesAsync(CancellationToken cancellationToken = default);
}