52 lines
1.5 KiB
C#
52 lines
1.5 KiB
C#
using mws.backend.dotnet.application.Audit;
|
|
using mws.backend.dotnet.application.Permissions;
|
|
|
|
namespace mws.backend.dotnet.application.Users;
|
|
|
|
public class CreateUserRequest
|
|
{
|
|
public string Username { get; set; } = string.Empty;
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public string Password { get; set; } = string.Empty;
|
|
public Guid? RoleId { get; set; }
|
|
}
|
|
|
|
public class UpdateUserRequest
|
|
{
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public Guid? RoleId { get; set; }
|
|
public bool IsActive { get; set; } = true;
|
|
}
|
|
|
|
public class ResetPasswordRequest
|
|
{
|
|
public string NewPassword { get; set; } = string.Empty;
|
|
}
|
|
|
|
public class UserDto : IHasEntityId
|
|
{
|
|
public Guid Id { get; set; }
|
|
public Guid EntityId => Id;
|
|
public string Username { get; set; } = string.Empty;
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public Guid RoleId { get; set; }
|
|
public string RoleName { get; set; } = string.Empty;
|
|
public bool IsActive { get; set; }
|
|
public DateTime CreatedAt { get; set; }
|
|
}
|
|
|
|
public class UserRoleDetailDto
|
|
{
|
|
public Guid UserId { get; set; }
|
|
public string Username { get; set; } = string.Empty;
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
public List<RoleDto> AssignedRoles { get; set; } = [];
|
|
public List<RoleDto> UnassignedRoles { get; set; } = [];
|
|
}
|
|
|
|
public class AssignRoleRequest
|
|
{
|
|
public Guid RoleId { get; set; }
|
|
}
|
|
|
|
public record UserListFilter(string? Term, bool? IsActive); |