using LCU.Library.Internal.IncentiveApiModels.Entities; using LCU.Library.Internal.IncentiveApiModels.Enums; using Newtonsoft.Json; using Newtonsoft.Json.Converters; namespace LCU.API.Internal.Operations.IncentiveApi.Models.GoalDispersal; public class GoalDispersalReceipt { public GoalDispersalReceipt(int deptId, GoalDispersalStrategy strategy) { GoalChanges = new List(); GoalDispersalErrors = new List(); DepartmentId = deptId; Strategy = strategy; } public int DepartmentId { get; set; } [JsonIgnore] public List GoalChanges { get; set; } public List GoalDispersalErrors { get; set; } [JsonConverter(typeof(StringEnumConverter))] public GoalDispersalStrategy Strategy { get; set; } public void AddNewDispersalError(GoalDispersalError errorType, string employeeId, string message, string employeeName = null) { var newError = new GoalDispersalReceiptItem(errorType, employeeId, message); if (!String.IsNullOrEmpty(employeeName)) { newError.EmployeeName = employeeName; } GoalDispersalErrors.Add(newError); } }