[CLAUDE] Users: Plan D — F2 toggle AllowDrafterSkipToFinal per-user (Mig 29 wire UI)

BE: UserDto +AllowDrafterSkipToFinal + SetUserAllowDrafterSkipToFinalCommand
+ Handler + UsersController PATCH /api/users/{id}/allow-skip-final body
{allowDrafterSkipToFinal:bool} Policy=Users.Update.

FE Admin: User type +allowDrafterSkipToFinal. UsersPage column "Skip cuối"
violet FastForward badge + action button toggle mirror bypass-review pattern.

fe-user KHÔNG mirror (UsersPage admin-only).

Verify:
- dotnet build SolutionErp.slnx — 0 err, 2 warning DocxRenderer pre-existing
- npm run build fe-admin — pass 638ms

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-13 21:03:27 +07:00
parent 3d725c42f7
commit 60efeeda63
4 changed files with 76 additions and 4 deletions

View File

@ -84,9 +84,22 @@ public class UsersController(IMediator mediator) : ControllerBase
await mediator.Send(new SetUserPositionLevelCommand(id, body.PositionLevel), ct);
return NoContent();
}
// Mig 29 F2 per-Drafter: admin toggle AllowDrafterSkipToFinal cho user. Khi
// true, Drafter có thể tick "Gửi thẳng Cấp cuối" trong PE Workspace để bay
// thẳng tới Cấp cuối workflow. Mặc định false.
[HttpPatch("{id:guid}/allow-skip-final")]
[Authorize(Policy = "Users.Update")]
public async Task<IActionResult> SetAllowDrafterSkipToFinal(
Guid id, [FromBody] SetAllowDrafterSkipToFinalBody body, CancellationToken ct)
{
await mediator.Send(new SetUserAllowDrafterSkipToFinalCommand(id, body.AllowDrafterSkipToFinal), ct);
return NoContent();
}
}
public record AssignRolesBody(List<string> Roles);
public record ResetPasswordBody(string NewPassword);
public record SetBypassReviewBody(bool CanBypassReview);
public record SetPositionLevelBody(int? PositionLevel);
public record SetAllowDrafterSkipToFinalBody(bool AllowDrafterSkipToFinal);