Skip to content

Commit

Permalink
Merge pull request #594 from osu-tournament-rating/feature/verifier
Browse files Browse the repository at this point in the history
API assign verifier navigation
  • Loading branch information
hburn7 authored Feb 7, 2025
2 parents 9cb12a7 + 506273f commit e6411ca
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion API/Controllers/TournamentsController.Admin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public async Task<IActionResult> AcceptPreVerificationStatusesAsync(int id)
}

// Result will never be null here
return Ok(await tournamentsService.AcceptPreVerificationStatusesAsync(id));
return Ok(await tournamentsService.AcceptPreVerificationStatusesAsync(id, User.GetSubjectId()));
}

/// <summary>
Expand Down
4 changes: 2 additions & 2 deletions API/Services/Implementations/TournamentsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public async Task<int> CountPlayedAsync(

public async Task DeleteAsync(int id) => await tournamentsRepository.DeleteAsync(id);

public async Task<TournamentDTO?> AcceptPreVerificationStatusesAsync(int id) =>
mapper.Map<TournamentDTO?>(await tournamentsRepository.AcceptPreVerificationStatusesAsync(id));
public async Task<TournamentDTO?> AcceptPreVerificationStatusesAsync(int id, int verifierUserId) =>
mapper.Map<TournamentDTO?>(await tournamentsRepository.AcceptPreVerificationStatusesAsync(id, verifierUserId));

public async Task RerunAutomationChecksAsync(int id, bool force = false) =>
await tournamentsRepository.ResetAutomationStatusesAsync(id, force);
Expand Down
3 changes: 2 additions & 1 deletion API/Services/Interfaces/ITournamentsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ bool preApprove
/// <see cref="GameScore"/>s
/// </summary>
/// <param name="id">Tournament id</param>
/// <param name="verifierUserId">User id of the verifier</param>
/// <returns>The updated <see cref="TournamentDTO"/></returns>
Task<TournamentDTO?> AcceptPreVerificationStatusesAsync(int id);
Task<TournamentDTO?> AcceptPreVerificationStatusesAsync(int id, int verifierUserId);

/// <summary>
/// Adds a collection of osu! beatmap ids to the tournament's PooledBeatmaps collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public async Task<ICollection<Tournament>> GetAsync(
.ToListAsync();
}

public async Task<Tournament?> AcceptPreVerificationStatusesAsync(int id)
public async Task<Tournament?> AcceptPreVerificationStatusesAsync(int id, int verifierUserId)
{
Tournament? tournament = await TournamentsBaseQuery()
.Where(t => t.ProcessingStatus == TournamentProcessingStatus.NeedsVerification)
Expand All @@ -141,9 +141,12 @@ public async Task<ICollection<Tournament>> GetAsync(
#region Confirm "pre" verification statuses

tournament.ConfirmPreVerificationStatus();
tournament.VerifiedByUserId = verifierUserId;

foreach (Match match in tournament.Matches)
{
match.ConfirmPreVerificationStatus();
match.VerifiedByUserId = verifierUserId;

foreach (Game game in match.Games)
{
Expand Down
3 changes: 2 additions & 1 deletion Database/Repositories/Interfaces/ITournamentsRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,9 @@ Task<ICollection<Tournament>> GetAsync(
/// <see cref="GameScore"/>s
/// </summary>
/// <param name="id">Tournament id</param>
/// <param name="verifierUserId">User id of the verifier</param>
/// <returns>The updated <see cref="Tournament"/></returns>
Task<Tournament?> AcceptPreVerificationStatusesAsync(int id);
Task<Tournament?> AcceptPreVerificationStatusesAsync(int id, int verifierUserId);

/// <summary>
/// Resets the VerificationStatus, ProcessingStatus, WarningFlags (if applicable), and RejectionReasons for
Expand Down

0 comments on commit e6411ca

Please sign in to comment.