feat: add locked new-year rollover wizard for season transitions
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>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user