Adding
This commit is contained in:
+38
@@ -0,0 +1,38 @@
|
||||
using LCU.Library.Internal.IncentiveApiModels.Entities;
|
||||
|
||||
namespace LCU.API.Internal.Operations.IncentiveApi.Models;
|
||||
|
||||
public class PersonnelGoals
|
||||
{
|
||||
public PersonnelGoals(int departmentId, int year, int month, ICollection<AppUser> personnel)
|
||||
{
|
||||
DepartmentId = departmentId;
|
||||
Year = year;
|
||||
Month = month;
|
||||
Personnel = personnel;
|
||||
Goals = new Dictionary<string, PerProductGoal>();
|
||||
foreach (var person in personnel)
|
||||
{
|
||||
Goals[person.EmployeeId] = new PerProductGoal();
|
||||
}
|
||||
}
|
||||
|
||||
public int DepartmentId { get; }
|
||||
public int Year { get; }
|
||||
public int Month { get; }
|
||||
public ICollection<AppUser> Personnel { get; }
|
||||
public ICollection<Goal> GoalAudit { get; set; }
|
||||
public IDictionary<string, PerProductGoal> Goals { get; }
|
||||
|
||||
public void ApplyAll(ICollection<Goal> findDepartmentGoals)
|
||||
{
|
||||
GoalAudit = findDepartmentGoals;
|
||||
foreach (var goal in findDepartmentGoals)
|
||||
{
|
||||
if (Goals.Keys.Contains(goal.EmployeeId))
|
||||
{
|
||||
Goals[goal.EmployeeId].ProductGoals[goal.Product] = goal.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user