Adding
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
using LCU.Library.Internal.IncentiveApiModels.Entities;
|
||||
|
||||
namespace LCU.API.Internal.Operations.IncentiveApi.Models;
|
||||
|
||||
public class DepartmentGoals
|
||||
{
|
||||
public DepartmentGoals(int departmentId, int year)
|
||||
{
|
||||
DepartmentId = departmentId;
|
||||
Year = year;
|
||||
|
||||
MonthlyGoals = new PerProductGoal[12];
|
||||
for (var month = 0; month < 12; month++)
|
||||
{
|
||||
MonthlyGoals[month] = new PerProductGoal();
|
||||
}
|
||||
}
|
||||
|
||||
public int DepartmentId { get; }
|
||||
public int Year { get; }
|
||||
public PerProductGoal[] MonthlyGoals { get; }
|
||||
|
||||
public void ApplyAll(ICollection<Goal> findDepartmentGoals)
|
||||
{
|
||||
foreach (var goal in findDepartmentGoals)
|
||||
{
|
||||
MonthlyGoals[goal.StartDate.Month-1].ProductGoals[goal.Product] = goal.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user