namespace Berufsschule_HAM.Models;

public class UserModel
{
    public required string Uid { get; set; }
    public string? Cn { get; set; }
    public string? Sn { get; set; }
    public string? Description { get; set; }
    public string? JpegPhoto { get; set; }
    public string? Title { get; set; }
    public string? UserPassword { get; set; }
    public UserModel(Dictionary<string, string> ldapData)
    {
        Uid = ldapData.GetValueOrDefault("uid") ?? throw new ArgumentException("UID is required");
        Cn = ldapData.GetValueOrDefault("cn");
        Sn = ldapData.GetValueOrDefault("sn");
        Description = ldapData.GetValueOrDefault("description");
        JpegPhoto = ldapData.GetValueOrDefault("jpegPhoto");
        Title = ldapData.GetValueOrDefault("title");
        UserPassword = ldapData.GetValueOrDefault("userPassword");
    }
}

public class UserAuthenticationResult
{
    public required bool Success;
    public UserNotAuthenticatedReason AuthenticationState { get; set; } = UserNotAuthenticatedReason.None;
}

public enum UserNotAuthenticatedReason
{
    None,
    InvalidCredentials,
    UserNotAuthorized,
    UserLockedOut
}