@@ -703,6 +703,48 @@ public async Task<IActionResult> DeactivateAssignment(Guid assignmentId, Guid ma
703703 } , nameof ( DeactivateAssignment ) ) . ConfigureAwait ( false ) ;
704704 }
705705
706+ [ HttpPost ]
707+ [ ValidateAntiForgeryToken ]
708+ public async Task < IActionResult > VerifyAssignment ( Guid assignmentId , Guid mapRotationId , CancellationToken cancellationToken = default )
709+ {
710+ return await ExecuteWithErrorHandlingAsync ( async ( ) =>
711+ {
712+ var rotationResponse = await repositoryApiClient . MapRotations . V1 . GetMapRotation ( mapRotationId , cancellationToken ) . ConfigureAwait ( false ) ;
713+
714+ if ( rotationResponse . IsNotFound || rotationResponse . Result ? . Data is null )
715+ return NotFound ( ) ;
716+
717+ var rotation = rotationResponse . Result . Data ;
718+
719+ var authResult = await CheckAuthorizationAsync (
720+ authorizationService ,
721+ rotation . GameType ,
722+ AuthPolicies . ManageMapRotations ,
723+ nameof ( VerifyAssignment ) ,
724+ "MapRotation" ) . ConfigureAwait ( false ) ;
725+
726+ if ( authResult != null )
727+ return authResult ;
728+
729+ if ( rotation . ServerAssignments == null || ! rotation . ServerAssignments . Any ( a => a . MapRotationServerAssignmentId == assignmentId ) )
730+ return BadRequest ( "The specified assignment does not belong to this rotation." ) ;
731+
732+ var result = await syncApiClient . TriggerVerify ( assignmentId , cancellationToken ) . ConfigureAwait ( false ) ;
733+
734+ if ( result . Success )
735+ {
736+ this . AddAlertSuccess ( "Verification triggered successfully." ) ;
737+ TempData [ "PendingInstanceId" ] = $ "maprot-verify-{ assignmentId } ";
738+ }
739+ else
740+ {
741+ this . AddAlertDanger ( $ "Failed to trigger verification: { result . Error } ") ;
742+ }
743+
744+ return RedirectToAction ( nameof ( AssignmentStatus ) , new { id = assignmentId } ) ;
745+ } , nameof ( VerifyAssignment ) ) . ConfigureAwait ( false ) ;
746+ }
747+
706748 [ HttpGet ]
707749 public async Task < IActionResult > GetSyncProgress ( string instanceId , CancellationToken cancellationToken = default )
708750 {
@@ -768,7 +810,8 @@ public async Task<IActionResult> CancelOperation(Guid operationId, Guid assignme
768810 $ "maprot-sync-{ assignmentId } ",
769811 $ "maprot-activate-{ assignmentId } ",
770812 $ "maprot-deactivate-{ assignmentId } ",
771- $ "maprot-remove-{ assignmentId } "
813+ $ "maprot-remove-{ assignmentId } ",
814+ $ "maprot-verify-{ assignmentId } "
772815 } ;
773816
774817 if ( allowedPrefixes . Any ( p => string . Equals ( instanceId , p , StringComparison . OrdinalIgnoreCase ) ) )
@@ -822,7 +865,8 @@ public async Task<IActionResult> TerminateOrchestration(string instanceId, Guid
822865 $ "maprot-sync-{ assignmentId } ",
823866 $ "maprot-activate-{ assignmentId } ",
824867 $ "maprot-deactivate-{ assignmentId } ",
825- $ "maprot-remove-{ assignmentId } "
868+ $ "maprot-remove-{ assignmentId } ",
869+ $ "maprot-verify-{ assignmentId } "
826870 } ;
827871
828872 if ( ! allowedPrefixes . Any ( p => string . Equals ( instanceId , p , StringComparison . OrdinalIgnoreCase ) ) )
0 commit comments