33 lines
967 B
C#
33 lines
967 B
C#
using LCU.Library.Internal.IncentiveApiModels.Enums;
|
|
using LCU.API.Internal.Operations.IncentiveApi.Models;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Rules;
|
|
|
|
public class BusinessRuleService : IBusinessRuleService
|
|
{
|
|
private readonly IDepartmentService _departmentService;
|
|
|
|
public BusinessRuleService(IDepartmentService departmentService)
|
|
{
|
|
_departmentService = departmentService;
|
|
}
|
|
|
|
public IReadOnlyCollection<IPayoutRule> GetRules(PayoutType type)
|
|
{
|
|
var dept = _departmentService
|
|
.GetDepartmentsByDayforceGlCodeAsync(NewCheckingReferralRule.MemberServicesGlCode).GetAwaiter()
|
|
.GetResult();
|
|
|
|
return type switch
|
|
{
|
|
PayoutType.Department => new List<IPayoutRule>()
|
|
{
|
|
new NewCheckingReferralRule(dept.Id.Value)
|
|
},
|
|
PayoutType.Personal => new List<IPayoutRule>()
|
|
{
|
|
}
|
|
};
|
|
}
|
|
}
|