This commit is contained in:
Zeeshaun
2026-03-17 09:53:09 -05:00
parent cdcba54aa4
commit 1a0702a79a
590 changed files with 62058 additions and 0 deletions
@@ -0,0 +1,32 @@
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>()
{
}
};
}
}
@@ -0,0 +1,10 @@
using LCU.Library.Internal.IncentiveApiModels.Enums;
using LCU.API.Internal.Operations.IncentiveApi.Models;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Rules
{
public interface IBusinessRuleService
{
IReadOnlyCollection<IPayoutRule> GetRules(PayoutType type);
}
}
@@ -0,0 +1,26 @@
using LCU.Library.Internal.IncentiveApiModels.Entities;
using LCU.Library.Internal.IncentiveApiModels.Enums;
using LCU.API.Internal.Operations.IncentiveApi.Models;
namespace LCU.API.Internal.Operations.IncentiveApi.Services.Rules;
public class NewCheckingReferralRule : IPayoutRule
{
public static readonly int MemberServicesGlCode = 200;
public NewCheckingReferralRule(int memberServicesDepartmentId)
{
MemberServiceDeptId = memberServicesDepartmentId;
}
private int MemberServiceDeptId { get; }
public bool RestrictedByPayoutRule(Activity activity, Product countsForProduct)
{
var result = countsForProduct == activity.Product
&& activity.Product == Product.NewChecking
&& activity.Type == ActivityType.Referral
&& activity.DepartmentId != MemberServiceDeptId;
return result;
}
}