2026-08-19 23:25:08 +07:00
|
|
|
using mws.backend.dotnet.application.Permissions;
|
2026-08-13 23:10:22 +07:00
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
namespace mws.backend.dotnet.application.Users;
|
|
|
|
|
|
|
|
|
|
public class CreateUserRequest
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
public string Username { get; set; } = string.Empty;
|
|
|
|
|
public string DisplayName { get; set; } = string.Empty;
|
|
|
|
|
public string Password { get; set; } = string.Empty;
|
2026-08-19 23:25:08 +07:00
|
|
|
public Guid? RoleId { get; set; }
|
2026-08-13 23:10:22 +07:00
|
|
|
}
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
public class UpdateUserRequest
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
public string DisplayName { get; set; } = string.Empty;
|
2026-08-19 23:25:08 +07:00
|
|
|
public Guid? RoleId { get; set; }
|
2026-08-13 23:10:22 +07:00
|
|
|
public bool IsActive { get; set; } = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class ResetPasswordRequest
|
|
|
|
|
{
|
|
|
|
|
public string NewPassword { get; set; } = string.Empty;
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-19 23:25:08 +07:00
|
|
|
public class UserDto
|
2026-08-13 23:10:22 +07:00
|
|
|
{
|
|
|
|
|
public Guid Id { get; set; }
|
|
|
|
|
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; }
|
|
|
|
|
}
|
2026-08-19 23:25:08 +07:00
|
|
|
|
|
|
|
|
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; }
|
2026-09-13 18:02:09 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public record UserListFilter(string? Term, bool? IsActive);
|