using EVCB_OCPP.Packet.Features;
using EVCB_OCPP.Packet.Messages.SubTypes;
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.Packet.Messages.SmartCharging
{
    public class GetCompositeScheduleRequest : IRequest
    {

        public GetCompositeScheduleRequest()
        {
            Action = Actions.GetCompositeSchedule.ToString();
        }

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

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


        [JsonConverter(typeof(StringEnumConverter))]
        public ChargingRateUnitType? chargingRateUnit { set; get; }

        public bool TransactionRelated()
        {
            return false;
        }

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