Promote returning students, assign officers, and clear last season's data after an automatic SQLite backup, with Docker volume path docs fixed for /app/Data. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using Core.YearTransition;
|
|
|
|
namespace WebApp.Services;
|
|
|
|
/// <summary>
|
|
/// Options for applying a year rollover.
|
|
/// </summary>
|
|
public sealed class YearRolloverOptions
|
|
{
|
|
public required YearTransitionPlan Plan { get; init; }
|
|
public bool ClearEventOccurrences { get; init; } = true;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Result of a successful year rollover.
|
|
/// </summary>
|
|
public sealed class YearRolloverResult
|
|
{
|
|
public required string BackupPath { get; init; }
|
|
public required int StudentsRemoved { get; init; }
|
|
public required int StudentsPromoted { get; init; }
|
|
public required int TeamsDeleted { get; init; }
|
|
public required int RankingsDeleted { get; init; }
|
|
public required int MeetingHistoriesDeleted { get; init; }
|
|
public required int EventOccurrencesDeleted { get; init; }
|
|
public required string CompetitionYear { get; init; }
|
|
public required IReadOnlyList<string> OfficerSummary { get; init; }
|
|
}
|
|
|
|
/// <summary>
|
|
/// Applies a year-transition plan to the database.
|
|
/// </summary>
|
|
public interface IYearRolloverService
|
|
{
|
|
Task<YearRolloverResult> ApplyAsync(YearRolloverOptions options, CancellationToken cancellationToken = default);
|
|
}
|