using DbController;
using Tabletop.Core.Models.Abstract;

namespace Tabletop.Core.Models
{
    public class Template : ArmyBase, IDbModel<int?>
    {
        [CompareField("template_id")]
        public int TemplateId { get; set; }
        [CompareField("user_id")]
        public int UserId { get; set; }
        [CompareField("name")]
        public string Name { get; set; } = string.Empty;
        [CompareField("force")]
        public int Force { get; set; }

        public int? GetIdentifier()
        {
            return TemplateId > 0 ? TemplateId : null;
        }

        public override Dictionary<string, object?> GetParameters()
        {
            var baseParams = base.GetParameters();

            baseParams["TEMPLATE_ID"] = TemplateId;
            baseParams["USER_ID"] = UserId;
            baseParams["NAME"] = Name;
            baseParams["FORCE"] = Force;

            return baseParams;
        }
    }
}