namespace ScadaLink.Commons.Interfaces;
///
/// Abstraction over the central AuditLog partition-function roll-forward
/// operation. M6-T5 introduces a daily-cadence hosted service
/// (AuditLogPartitionMaintenanceService) that calls
/// to make sure
/// pf_AuditLog_Month always has at least LookaheadMonths of
/// future boundaries available — otherwise inserts past the highest
/// boundary land in a single ever-growing tail partition that
/// SwitchOutPartitionAsync cannot purge cleanly.
///
///
///
/// The interface lives in ScadaLink.Commons so the central hosted
/// service in ScadaLink.AuditLog can depend on it without taking a
/// reference on ScadaLink.ConfigurationDatabase; the EF-based
/// implementation ships in
/// ScadaLink.ConfigurationDatabase.Maintenance.AuditLogPartitionMaintenance
/// and is registered by AddConfigurationDatabase.
///
///
/// Both methods read sys.partition_range_values / mutate
/// pf_AuditLog_Month via raw SQL — there is no EF model for a
/// partition function. The interface deliberately exposes only the two
/// operations the hosted service needs; it is not a general partition-DDL
/// surface.
///
///
public interface IPartitionMaintenance
{
///
/// Splits new monthly boundaries on pf_AuditLog_Month so the
/// function covers at least future
/// months relative to . Idempotent — a
/// boundary that already exists is skipped rather than re-issued.
/// Returns the boundaries actually added, in chronological order.
///
Task> EnsureLookaheadAsync(int lookaheadMonths, CancellationToken ct = default);
///
/// Reads the current maximum boundary value from
/// sys.partition_range_values for pf_AuditLog_Month.
/// Returns null when the partition function does not exist or
/// has no boundaries.
///
Task GetMaxBoundaryAsync(CancellationToken ct = default);
}