Files
monorepo/LCU.API.Operations.IncentiveAPI/LCU.API.Internal.Operations.IncentiveApi/Models/GoalDispersal/GoalDispersalReceipt.cs
T
2026-03-17 09:53:09 -05:00

33 lines
1.2 KiB
C#

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<GoalChange>();
GoalDispersalErrors = new List<GoalDispersalReceiptItem>();
DepartmentId = deptId;
Strategy = strategy;
}
public int DepartmentId { get; set; }
[JsonIgnore]
public List<GoalChange> GoalChanges { get; set; }
public List<GoalDispersalReceiptItem> 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);
}
}