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.Messages;

/// <summary>
/// Represents a campaign model
/// </summary>
public partial record CampaignModel : BaseNopEntityModel
{
    #region Ctor

    public CampaignModel()
    {
        AvailableStores = new List<SelectListItem>();
        AvailableCustomerRoles = new List<SelectListItem>();
        AvailableNewsLetterSubscriptionTypes = new List<SelectListItem>();
        AvailableEmailAccounts = new List<SelectListItem>();
        CopyCampaignModel = new CopyCampaignModel();
    }

    #endregion

    #region Properties

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.Name")]
    public string Name { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.Subject")]
    public string Subject { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.Body")]
    public string Body { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.Store")]
    public int StoreId { get; set; }
    public IList<SelectListItem> AvailableStores { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.CustomerRole")]
    public int CustomerRoleId { get; set; }
    public IList<SelectListItem> AvailableCustomerRoles { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.NewsLetterSubscriptionType")]
    public int NewsLetterSubscriptionTypeId { get; set; }
    public IList<SelectListItem> AvailableNewsLetterSubscriptionTypes { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.CreatedOn")]
    public DateTime CreatedOn { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.DontSendBeforeDate")]
    [UIHint("DateTimeNullable")]
    public DateTime? DontSendBeforeDate { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.AllowedTokens")]
    public string AllowedTokens { get; set; }

    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.EmailAccount")]
    public int EmailAccountId { get; set; }
    public IList<SelectListItem> AvailableEmailAccounts { get; set; }

    [DataType(DataType.EmailAddress)]
    [NopResourceDisplayName("Admin.Promotions.Campaigns.Fields.TestEmail")]
    public string TestEmail { get; set; }

    public CopyCampaignModel CopyCampaignModel { get; set; }

    #endregion
}