using inutralia.Utils;
using Newtonsoft.Json;
using System;

namespace inutralia.Models
{
    [JsonObject(MemberSerialization.OptIn)]
    public class QuestionMessage : ObservableEntityData
    {
        public bool FromExpert => !FromUser;

        public QuestionMessage()
        {
            Text = "";
            FromUser = true;
            CreatedAt = DateUtilities.formatedDateToTimeStamp(DateTime.UtcNow);
        }

        [JsonProperty("message", Required = Required.Always)]
        private string _Text;
        public string Text
        {
            get { return _Text; }
            set { SetProperty(ref _Text, value, "Text"); }
        }

        [JsonProperty("from_user", Required = Required.Always)]
        public bool FromUser { get; set; }

        [JsonProperty("created_at", Required = Required.Always)]
        public int CreatedAt { get; set; }

        [JsonProperty("image", Required = Required.Always)]
        public string Image { get; set; }
    }
}
