using System;
using Newtonsoft.Json;

namespace InABox.Integration.Logikal
{
    public class LogikalMessage
    {
        public Guid ID { get; set; }
        public LogikalMethod Method { get; set; }
        public String Payload { get; set; }
        
        public static LogikalMessage Error(string message)
        {
            return new LogikalMessage()
            {
                ID = Guid.NewGuid(), 
                Method = LogikalMethod.Error,
                Payload = JsonConvert.SerializeObject(new LogikalErrorResponse()
                {
                    Message = message
                })
                
            };
        }

    }
}
