using EVCB_OCPP.Packet20.DataTypes;
using EVCB_OCPP.Packet20.DataTypes.EnumTypes;
using EVCB_OCPP.Packet20.Features;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVCB_OCPP.Packet20.Messages
{
    public class BootNotificationRequest : IRequest
    {
        [Required]
        [JsonConverter(typeof(StringEnumConverter))]
        public BootReasonEnumType Reason { set; get; }

        /// <summary>
        /// Identifies the Charging Station
        /// </summary>
        [Required]
        public ChargingStationType ChargingStation { set; get; }

        [JsonIgnore]
        public string Action { set; get; }    

        public BootNotificationRequest()
        {
            Action = Actions.BootNotification.ToString();
        }

        public bool TransactionRelated()
        {
            return false;
        }

        public bool Validate()
        {
            return Validator.TryValidateObject(this, new ValidationContext(this), null, true);
        }
    }
}
