Sube carpetas API, API.Tests, Application y Domain del Backend
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using Application.Utils.Constants.Validation;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Application.DTOs.User.Request;
|
||||
|
||||
/// <summary>
|
||||
/// Request to change a user's password; self-service changes require CurrentPassword.
|
||||
/// </summary>
|
||||
public sealed class ChangePasswordRequest
|
||||
{
|
||||
[Required]
|
||||
[MinLength(UserFieldLengths.PasswordMinLength)]
|
||||
public string NewPassword { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Required only for self-service password changes.
|
||||
/// </summary>
|
||||
public string? CurrentPassword { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Application.DTOs.User.Request;
|
||||
|
||||
public sealed class SetUserActiveRequest
|
||||
{
|
||||
public bool IsActive { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Application.Utils.Constants.Validation;
|
||||
|
||||
using Domain.Enums;
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Application.DTOs.User.Request;
|
||||
|
||||
public sealed class UpdateUserRequest
|
||||
{
|
||||
[StringLength(UserFieldLengths.UsernameMaxLength, MinimumLength = UserFieldLengths.UsernameMinLength)]
|
||||
public string? Username { get; set; }
|
||||
|
||||
[EmailAddress]
|
||||
public string? Email { get; set; }
|
||||
|
||||
[ArgentinePhoneNumber]
|
||||
[MaxLength(UserFieldLengths.PhoneMaxLength, ErrorMessage = "Phone number must not exceed 15 characters.")]
|
||||
public string? Phone { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// When provided, replaces the target user's role; null updates profile fields without touching it.
|
||||
/// </summary>
|
||||
public UserRoleType? Role { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using Application.DTOs.Abstract.Request;
|
||||
|
||||
using Domain.Enums;
|
||||
|
||||
namespace Application.DTOs.User.Request;
|
||||
|
||||
public class UserFilteredRequest : PaginatedFilterRequest
|
||||
{
|
||||
public string? UserName { get; set; }
|
||||
public string? Email { get; set; }
|
||||
public UserRoleType? Role { get; set; }
|
||||
public string? PhoneNumber { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Application.DTOs.User.Response;
|
||||
|
||||
/// <summary>
|
||||
/// Confirms a forced password reset was performed; the generated temporary password is never included here.
|
||||
/// </summary>
|
||||
public sealed record ResetPasswordResponse(
|
||||
Guid UserId
|
||||
);
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
|
||||
namespace Application.DTOs.User.Response;
|
||||
|
||||
public sealed class UserResponse(
|
||||
Guid userId,
|
||||
string email,
|
||||
string username,
|
||||
string role,
|
||||
string? phone,
|
||||
Guid? createdByOwnerId,
|
||||
bool isActive)
|
||||
{
|
||||
public Guid UserId { get; init; } = userId;
|
||||
public string Email { get; init; } = email;
|
||||
public string Username { get; init; } = username;
|
||||
public string Role { get; init; } = role;
|
||||
public string? PhoneNumber { get; init; } = phone;
|
||||
public Guid? CreatedByOwnerId { get; init; } = createdByOwnerId;
|
||||
public bool IsActive { get; init; } = isActive;
|
||||
}
|
||||
Reference in New Issue
Block a user