using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;

namespace Test
{
    public class dtoBaseTenant : dtoBaseModel
    {
        public Guid TenantID { get; set; }
        [DisplayName("Product")]
        public Guid ProductID { get; set; }
        [DisplayName("Product")]
        public string ProductName { get; set; }
        public Guid SageCustomerID { get; set; }
        [StringLength(100)]
        [DisplayName("Tenant Code")]
        public string TenantCode { get; set; }
        [StringLength(20)]
        [DisplayName("Tenant Status")]
        public string TenantStatusText { get; set; }
        [DisplayName("Activation Status")]
        public short ActivationStatus { get; set; }
        public short TenantStatus { get; set; }
        //Customer Info
        [Required(ErrorMessage = "The Sage customer number is required.")]
        [StringLength(40)]
        [DisplayName("Sage Customer Number")]
        public string SageCustomerNumber { get; set; }
        [Required(ErrorMessage = "The billing account number is required.")]
        [StringLength(40)]
        [DisplayName("Billing Account Number")]
        public string BillingAccountNumber { get; set; }
        [Required(ErrorMessage = "The customer is required.")]
        [StringLength(40)]
        [RegularExpression(@"[A-Za-z0-9$!*`,.()_+ -]+", ErrorMessage = "The customer can only contain letters, numbers, spaces, or the following special characters: . _ + - ! * ` ( ) $")]
        [DisplayName("Customer")]
        public string CustomerName { get; set; }
        //[Required(ErrorMessage = "The tenant is required.", AllowEmptyStrings=true)]
        [StringLength(100)]
        [RegularExpression(@"[A-Za-z0-9$!*`,.()_+ -]*", ErrorMessage = "The tenant can only contain letters, numbers, spaces, or the following special characters: . _ + - ! * ` ( ) $")]
        [DisplayName("Tenant")]
        public string TenantName { get; set; }
        [DisplayName("Activation Code")]
        public Nullable<Guid> ActivationCode { get; set; }
        [DisplayName("Product Version")]
        public DateTime? ProductVersion { get; set; }
        [DisplayName("Usage Type")]
        public short UsageType { get; set; }

        //Aside from the tenant info, the info for the admin is also part of the model.        
        public Guid ProductUserID { get; set; }
        [Required(ErrorMessage = "The Email is required.")]
        [StringLength(100)]
        [RegularExpression(@"^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$", ErrorMessage = "Invalid Email.")]
        [DisplayName("Email")]
        public string InvitationEmail { get; set; }
        private List<dtoBaseTenantApp> _apps = new List<dtoBaseTenantApp>();
        public List<dtoBaseTenantApp> Apps { get { return _apps; } }   
    
    }
}
