namespace SIGCM.Domain.Entities;

public class User
{
    public int Id { get; set; }
    public required string Username { get; set; }
    public required string PasswordHash { get; set; }
    public required string Role { get; set; }
    public string? Email { get; set; }
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public int FailedLoginAttempts { get; set; } = 0;
    public DateTime? LockoutEnd { get; set; }
    public bool MustChangePassword { get; set; } = true;
    public bool IsActive { get; set; } = true;

    // Campos de seguridad adicional
    public DateTime? LastLogin { get; set; }
    
    // Soporte para OAuth y MFA
    public string? GoogleId { get; set; }
    public bool IsMfaEnabled { get; set; }
    public string? MfaSecret { get; set; }

    // Datos de Facturación y Contacto (Unificados con Clientes)
    public int? ClientId { get; set; } // Opcional: ID de herencia o referencia externa
    public string? BillingName { get; set; } // Equivale a Client.Name
    public string? BillingAddress { get; set; } // Equivale a Client.Address
    public string? BillingTaxId { get; set; } // CUIT/DNI
    public string? BillingTaxType { get; set; } // Condición fiscal
    public string? Phone { get; set; } // Nuevo: Teléfono de contacto
}
