using System;
using System.Collections.Generic;
using Sockeye.Biz;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace Sockeye.Models
{


    public class CustomerNotifySubscription
    {
        public long Id { get; set; }
        public uint Concurrency { get; set; }

        [Required]
        public long TranslationId { get; set; }
        [Required]
        public string LanguageOverride { get; set; }
        [Required]
        public string TimeZoneOverride { get; set; }
        [Required]
        public string CurrencyName { get; set; }
        [Required]
        public bool Hour12 { get; set; }

        public List<string> CustomerTags { get; set; }//Tags to match customer with this notification        
        public TimeSpan AdvanceNotice { get; set; }
        public long? LinkReportId { get; set; }

        //CREATE NOTIFY EVENT CONDITIONS - Following fields are all conditions set on whether to create a notify event or not
        public SockType SockType { get; set; }//Note: must be specific object, not global for any object related stuff to avoid many role issues and also potential overload
        [Required]
        public NotifyEventType EventType { get; set; }
        [Required]
        public long IdValue { get; set; }//if required, this must match, default is zero to match to not set
        public decimal DecValue { get; set; }//if required this must match or be greater or something      
        public List<string> Tags { get; set; }//Tags to filter an event, object *must* have these tags to generate event related to it (AT TIME OF UPDATE)    
        [Required]
        public string Template { get; set; }
        
        [Required]
        public string Subject { get; set; }
        

        //DELIVERY CONDITIONS - following are all conditions on *whether* to deliver the existing notify event or not
        public TimeSpan AgeValue { get; set; }//for events that depend on an age of something (e.g. WorkorderStatusAge), This value determines when event has "come of age" but advancenotice controls how far in advance of this delivery is made

        public CustomerNotifySubscription()
        {
            Tags = new List<string>();
            SockType = SockType.NoType;
            IdValue = 0;
            DecValue = 0;
            AgeValue = TimeSpan.Zero;
            AdvanceNotice = TimeSpan.Zero;
            LinkReportId = 0;

        }

    }//eoc

}//eons
