feat: implement user role status toggle and reset password functionality
- Added toggle functionality for user roles (activate/deactivate) in roles and users pages. - Introduced a reset password page that validates and updates user passwords via a reset link. - Enhanced user detail page with edit functionality for user information (display name, email, mobile number). - Implemented sending reset link feature for users, with appropriate error handling and success notifications. - Updated API endpoints for user management to support new functionalities. - Improved UI components for better user experience during status updates and password changes.
This commit is contained in:
@@ -44,6 +44,15 @@ public sealed class DeletedAuthHexUser
|
||||
public string? Email { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>Admin-only profile edit — any field left null is left unchanged upstream.</summary>
|
||||
public sealed class AdminUpdateUserRequest
|
||||
{
|
||||
public string? FullName { get; set; }
|
||||
public string? UserName { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public string? MobileNumber { get; set; }
|
||||
}
|
||||
|
||||
public sealed class RegisterRequest
|
||||
{
|
||||
/// <summary>Optional — AuthHex requires a client-supplied id; ERPCore generates one when omitted.</summary>
|
||||
|
||||
@@ -67,5 +67,20 @@ public sealed class UpdateUserStatusRequest
|
||||
[Required, EnumDataType(typeof(EntityStatus))] public EntityStatus Status { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Edits an existing user's identity fields in both backends: the local shadow row
|
||||
/// (DisplayName/Email) and, when the user has a linked AuthHex identity, the AuthHex
|
||||
/// account itself via the admin-only AdminUpdateUser function. A user created before
|
||||
/// AuthHex linking (AuthUserId null) only updates locally.
|
||||
/// </summary>
|
||||
public sealed class UpdateManagedUserRequest
|
||||
{
|
||||
[Required, StringLength(200)] public string DisplayName { get; set; } = string.Empty;
|
||||
[Required, EmailAddress] public string Email { get; set; } = string.Empty;
|
||||
public string? MobileNumber { get; set; }
|
||||
}
|
||||
|
||||
public sealed record SendResetLinkResponse(DateTime? ExpiresAt);
|
||||
|
||||
/// <summary>AuthHex UserType lookup, for populating the create-user form's select (no local shadow — read-only passthrough).</summary>
|
||||
public sealed record UserTypeOptionDto(Guid UserTypeId, string? Code, string? Description);
|
||||
|
||||
Reference in New Issue
Block a user