using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc.Rendering;
using Nop.Web.Framework.Models;
using Nop.Web.Framework.Mvc.ModelBinding;

namespace Nop.Web.Areas.Admin.Models.Customers;

/// <summary>
/// Represents a customer search model
/// </summary>
public partial record CustomerSearchModel : BaseSearchModel, IAclSupportedModel
{
    #region Ctor

    public CustomerSearchModel()
    {
        SelectedCustomerRoleIds = new List<int>();
        AvailableCustomerRoles = new List<SelectListItem>();
        AvailableActiveValues = new List<SelectListItem>();
    }

    #endregion

    #region Properties

    [NopResourceDisplayName("Admin.Customers.Customers.List.CustomerRoles")]
    public IList<int> SelectedCustomerRoleIds { get; set; }

    public IList<SelectListItem> AvailableCustomerRoles { get; set; }

    [DataType(DataType.EmailAddress)]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchEmail")]
    public string SearchEmail { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchUsername")]
    public string SearchUsername { get; set; }

    public bool UsernamesEnabled { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchFirstName")]
    public string SearchFirstName { get; set; }
    public bool FirstNameEnabled { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchLastName")]
    public string SearchLastName { get; set; }
    public bool LastNameEnabled { get; set; }

    [UIHint("DateNullable")]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchLastActivityFrom")]
    public DateTime? SearchLastActivityFrom { get; set; }

    [UIHint("DateNullable")]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchLastActivityTo")]
    public DateTime? SearchLastActivityTo { get; set; }

    [UIHint("DateNullable")]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchRegistrationDateFrom")]
    public DateTime? SearchRegistrationDateFrom { get; set; }

    [UIHint("DateNullable")]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchRegistrationDateTo")]
    public DateTime? SearchRegistrationDateTo { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchDateOfBirth")]
    public string SearchDayOfBirth { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchDateOfBirth")]
    public string SearchMonthOfBirth { get; set; }

    public bool DateOfBirthEnabled { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchCompany")]
    public string SearchCompany { get; set; }

    public bool CompanyEnabled { get; set; }

    [DataType(DataType.PhoneNumber)]
    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchPhone")]
    public string SearchPhone { get; set; }

    public bool PhoneEnabled { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchZipCode")]
    public string SearchZipPostalCode { get; set; }

    public bool ZipPostalCodeEnabled { get; set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchIpAddress")]
    public string SearchIpAddress { get; set; }

    public bool AvatarEnabled { get; internal set; }

    [NopResourceDisplayName("Admin.Customers.Customers.List.SearchIsActive")]
    public bool? SearchIsActive { get; set; } = true;
    public IList<SelectListItem> AvailableActiveValues { get; set; }

    #endregion
}