Let advisors load preference ranks from a converted CSV with fuzzy matching, known aliases, and a parse-preview-save page instead of relying on the ranking editor. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1009 B
C#
35 lines
1009 B
C#
using Core.Models;
|
|
|
|
namespace WebApp.Services;
|
|
|
|
/// <summary>
|
|
/// Persists parsed student event rankings.
|
|
/// </summary>
|
|
public interface IStudentEventRankingSaveService
|
|
{
|
|
/// <summary>
|
|
/// Students in the parse result who already have rankings stored.
|
|
/// </summary>
|
|
Task<IReadOnlyList<string>> GetStudentsWithExistingRankingsAsync(
|
|
StudentEventRankingParseResult parseResult,
|
|
CancellationToken cancellationToken = default);
|
|
|
|
/// <summary>
|
|
/// Replaces rankings for students who have at least one accepted rank in the parse result.
|
|
/// Other students are left unchanged.
|
|
/// </summary>
|
|
Task<StudentEventRankingSaveResult> SaveAsync(
|
|
StudentEventRankingParseResult parseResult,
|
|
CancellationToken cancellationToken = default);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Outcome of saving imported event rankings.
|
|
/// </summary>
|
|
public class StudentEventRankingSaveResult
|
|
{
|
|
public int StudentsUpdated { get; set; }
|
|
|
|
public int RankingsSaved { get; set; }
|
|
}
|