using EVCB_OCPP.Packet.Features;
using EVCB_OCPP.Packet.Utilities;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVCB_OCPP.Packet.Messages.Reservation
{
    public class ReserveNowRequest : IRequest
    {

        public ReserveNowRequest()
        {
            Action = Actions.ReserveNow.ToString();
        }

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

        [Required]
        public int connectorId { set; get; }


        [Required]
        [JsonConverter(typeof(UTCDateTimeConverter))]
        public DateTime expiryDate { set; get; }

        [Required(AllowEmptyStrings = true)]
        public string idTag { set; get; }

        public string parentIdTag { set; get; }

        [Required]
        public int reservationId { set; get; }

        public bool TransactionRelated()
        {
            return false;
        }

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