using adas_core.Domain.Enums;

namespace adas_core.LdapLogin.Configuration;

public class LdapConfig
{
    public bool Enabled { get; set; }
    public string? Server { get; set; }
    public int? Port { get; set; } = 389;
    public string? UserDomainName { get; set; }
    public string? UserNameProperty { get; set; } = "sAMAccountName";
    public string? SearchBase { get; set; }
    public string? GroupsProperty { get; set; } = "memberOf";
    public string? LdapUser { get; set; }
    public string? LdapPassword { get; set; }
    public string? DisplayNameProperty { get; set; } = "displayName";
    public string? FirstNameProperty { get; set; } = "givenName";
    public string? LastNameProperty { get; set; } = "sn";

    public List<AuthorityMap> AuthoritiesMap { get; set; } = [];

    public List<UserLdap> WhiteList { get; set; } = [];
}

public class UserLdap
{
    public string? Name { get; set; }
    public string? Username { get; set; }
    public string? Rol { get; set; }
    public List<ActionsEnum.Actions> Actions { get; set; } = [];
    public string? DisplayId { get; set; }
}

public class AuthorityMap
{
    public string Group { get; set; } = null!;
    public string? Rol { get; set; }
    public List<ActionsEnum.Actions> Actions { get; set; } = [];
    public string? DisplayId { get; set; } = null;
}