30 lines
854 B
C#
30 lines
854 B
C#
using LCU.Library.Internal.IncentiveApiModels.Common;
|
|
using LCU.Library.Internal.IncentiveApiModels.Entities;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApi.Models;
|
|
|
|
public class DepartmentGoalsForRange
|
|
{
|
|
public DepartmentGoalsForRange(int departmentId, MonthRange monthRange)
|
|
{
|
|
DepartmentId = departmentId;
|
|
MonthRange = monthRange;
|
|
Goals = new PerProductGoal();
|
|
GoalAudit = new List<Goal>();
|
|
}
|
|
|
|
public int DepartmentId { get; set; }
|
|
public MonthRange MonthRange { get; set; }
|
|
public PerProductGoal Goals { get; }
|
|
public IEnumerable<Goal> GoalAudit { get; set; }
|
|
|
|
public void ApplyAll(ICollection<Goal> goals)
|
|
{
|
|
GoalAudit = GoalAudit.Concat(goals);
|
|
foreach (var goal in goals)
|
|
{
|
|
Goals.ProductGoals[goal.Product] += goal.Value;
|
|
}
|
|
}
|
|
}
|