2024-12-26 13:38:43 +03:00
|
|
|
|
using PasswordPolicy = Mirea.Api.Dto.Common.PasswordPolicy;
|
2024-12-18 07:27:57 +03:00
|
|
|
|
|
|
|
|
|
namespace Mirea.Api.Endpoint.Common.MapperDto;
|
|
|
|
|
|
|
|
|
|
public static class PasswordPolicyConverter
|
|
|
|
|
{
|
2024-12-26 13:38:43 +03:00
|
|
|
|
public static Security.Common.Model.PasswordPolicy ConvertFromDto(this PasswordPolicy policy) =>
|
2024-12-18 07:27:57 +03:00
|
|
|
|
new(policy.MinimumLength,
|
|
|
|
|
policy.RequireLetter,
|
|
|
|
|
policy.RequireLettersDifferentCase,
|
|
|
|
|
policy.RequireDigit,
|
|
|
|
|
policy.RequireSpecialCharacter);
|
|
|
|
|
|
2024-12-26 13:38:43 +03:00
|
|
|
|
public static PasswordPolicy ConvertToDto(this Security.Common.Model.PasswordPolicy policy) =>
|
2024-12-18 07:27:57 +03:00
|
|
|
|
new()
|
|
|
|
|
{
|
|
|
|
|
MinimumLength = policy.MinimumLength,
|
|
|
|
|
RequireLetter = policy.RequireLetter,
|
|
|
|
|
RequireDigit = policy.RequireDigit,
|
|
|
|
|
RequireSpecialCharacter = policy.RequireSpecialCharacter,
|
|
|
|
|
RequireLettersDifferentCase = policy.RequireLettersDifferentCase
|
|
|
|
|
};
|
|
|
|
|
}
|