shoc-backend/SeaHaven.Services/DTOs/IdentityDTOs.cs
Alexandre Brandizzi 66a49ab957 feat(auth): enforce one password policy on every password-setting path (SH-386)
Both hosts now apply the same Identity password rule: at least 6 characters
with one uppercase letter, one number and one special character. Change
password requires an authenticated caller, verifies the current password
before evaluating the new one, and reports a policy rejection separately
from a wrong current password.
2026-09-25 11:06:42 -03:00

86 lines
2.5 KiB
C#

namespace SeaHaven.Services.DTOs
{
public class LoginResultDTO
{
public string Token { get; set; } = string.Empty;
public DateTime Expiration { get; set; }
public string? Email { get; set; }
public string? UserRole { get; set; }
public string? PhoneNumber { get; set; }
public string Fullname { get; set; } = string.Empty;
public string Id { get; set; } = string.Empty;
}
public enum ChangePasswordStatus
{
Succeeded,
CurrentPasswordIncorrect,
PasswordRejected
}
public sealed class ChangePasswordResultDTO
{
public ChangePasswordStatus Status { get; init; }
}
public class UpdateProfileRequestDTO
{
public string? Name { get; set; }
public string? Email { get; set; }
public string? Contact { get; set; }
}
public class UserProfileDTO
{
public string? FirstName { get; set; }
public string? Email { get; set; }
public string? Contact { get; set; }
}
public class AddUserRequestDTO
{
public string? Name { get; set; }
public string? Email { get; set; }
public string? Contact { get; set; }
public string? Role { get; set; }
public int? AccountId { get; set; }
}
public class AddUserOutcomeDTO
{
public bool Success { get; set; }
public string? Error { get; set; }
}
public class EditUserRequestDTO
{
public string? Id { get; set; }
public string? Name { get; set; }
public string? Email { get; set; }
public string? Role { get; set; }
public int? AccountId { get; set; }
}
public class UserListRowDTO
{
public string? RoleName { get; set; }
public string? Email { get; set; }
public string? Name { get; set; }
public string Date { get; set; } = string.Empty;
public string? Status { get; set; }
public string? Id { get; set; }
public string? Phone { get; set; }
public string? Color { get; set; }
public bool? PendingRegistration { get; set; }
public IReadOnlyList<string> ServiceAreas { get; set; } = Array.Empty<string>();
}
public class UserProfileRowDTO
{
public string? Id { get; set; }
public string? Name { get; set; }
public DateTime? AddedDate { get; set; }
public string? Email { get; set; }
public string? Contact { get; set; }
}
}