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,18 @@
using LCU.Library.Internal.IncentiveApiModels.Entities;
using LCU.Library.Internal.IncentiveApiModels.Results;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class ActiveEmployeeReceipt
{
public ActiveEmployeeReceipt(IDictionary<string,string> reportRow)
{
ReportRow = reportRow;
Status = ActiveEmployeeReceiptStatus.NOT_PROCESSED;
}
public AppUser AppUser { get; set; }
public IDictionary<string,string> ReportRow { get; }
public ActiveEmployeeResult EmployeeRow { get; set; }
public ActiveEmployeeReceiptStatus Status { get; set; }
}
@@ -0,0 +1,10 @@
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public enum ActiveEmployeeReceiptStatus
{
NOT_PROCESSED,
SUCCESS,
MISSING_ROLE,
MISSING_DATA,
EXCEPTION
}
@@ -0,0 +1,55 @@
using System.ComponentModel.DataAnnotations;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class EmployeeDetailsUpdate
{
public string OldEmail { get; set; }
public string OldEmployeeId { get; set; }
public string OldFullName { get; set; }
public string NewEmail { get; set; }
public string NewEmployeeId { get; set; }
public string NewFullName { get; set; }
public bool NewDetailsMatchOld()
{
return OldEmail.Equals(NewEmail, StringComparison.InvariantCultureIgnoreCase)
&& OldEmployeeId.Equals(NewEmployeeId, StringComparison.InvariantCultureIgnoreCase)
&& OldFullName.Equals(NewFullName, StringComparison.InvariantCultureIgnoreCase);
}
public string InvalidUpdateData()
{
if (NewDetailsMatchOld())
{
return $"Invalid Update Data: Old Details Match Updated Details";
}
if (string.IsNullOrWhiteSpace(NewEmail))
{
return $"Invalid Update Data: NewEmail: {NewEmail}";
}
if (!new EmailAddressAttribute().IsValid(NewEmail))
{
return $"Invalid Update Data: NewEmail Is Not A Valid Email: {NewEmail}";
}
if (!NewEmail.Contains("@landmarkcu.com", StringComparison.InvariantCultureIgnoreCase))
{
return $"Invalid Update Data: NewEmail Is Not A Valid Internal Email: {NewEmail}";
}
if (string.IsNullOrWhiteSpace(NewEmployeeId))
{
return $"Invalid Update Data: NewEmployeeId: {NewEmployeeId}";
}
if (string.IsNullOrWhiteSpace(NewFullName))
{
return $"Invalid Update Data: NewFullName: {NewFullName}";
}
return "";
}
}
@@ -0,0 +1,10 @@
using LCU.Library.Internal.IncentiveApiModels.Entities;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class EmployeeDetailsUpdateResult
{
public AppUser AppUser { get; set; }
public string UpdateMessage { get; set; }
public bool UpdatedSuccessfully { get; set; }
}
@@ -0,0 +1,25 @@
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
[DataContract]
public class Paging
{
[DataMember(Name = "Next", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Next")]
public string Next { get; set; }
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Paging {\n");
sb.Append(" Next: ").Append(Next).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
@@ -0,0 +1,13 @@
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class Payload
{
public string RequestId { get; set; }
public List<ProcessResult> ProcessResults { get; set; }
}
public class Payload<T> : Payload
{
public T Data { get; set; }
public Paging Paging { get; set; }
}
@@ -0,0 +1,9 @@
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class PayoutEntry
{
public string Code { get; set; }
public string EmployeeName { get; set; }
public string EmployeeId { get; set; }
public decimal PayoutTotal { get; set; }
}
@@ -0,0 +1,42 @@
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
[DataContract]
public class ProcessResult
{
[DataMember(Name = "Code", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Code")]
public string Code { get; set; }
[DataMember(Name = "Context", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Context")]
public string Context { get; set; }
[DataMember(Name = "Level", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Level")]
public string Level { get; set; }
[DataMember(Name = "Message", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Message")]
public string Message { get; set; }
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class ProcessResult {\n");
sb.Append(" Code: ").Append(Code).Append("\n");
sb.Append(" Context: ").Append(Context).Append("\n");
sb.Append(" Level: ").Append(Level).Append("\n");
sb.Append(" Message: ").Append(Message).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
@@ -0,0 +1,33 @@
using System.Runtime.Serialization;
using System.Text;
using Newtonsoft.Json;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
[DataContract]
public class Report
{
[DataMember(Name = "XRefCode", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "XRefCode")]
public string XRefCode { get; set; }
[DataMember(Name = "Rows", EmitDefaultValue = false)]
[JsonProperty(PropertyName = "Rows")]
public List<Dictionary<String, string>> Rows { get; set; }
public override string ToString()
{
var sb = new StringBuilder();
sb.Append("class Report {\n");
sb.Append(" XRefCode: ").Append(XRefCode).Append("\n");
sb.Append(" Rows: ").Append(Rows).Append("\n");
sb.Append("}\n");
return sb.ToString();
}
public string ToJson()
{
return JsonConvert.SerializeObject(this, Formatting.Indented);
}
}
@@ -0,0 +1,19 @@
using LCU.Library.Internal.IncentiveApiModels.Entities;
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class TerminatedEmployeeReceipt
{
public TerminatedEmployeeReceipt(AppUser terminated, PayoutEntry lastMonthPayout, PayoutEntry thisMonthPayout, AppUser manager)
{
Terminated = terminated;
LastMonthPayout = lastMonthPayout;
ThisMonthPayout = thisMonthPayout;
Manager = manager;
}
public AppUser Terminated { get; }
public AppUser Manager { get; }
public PayoutEntry LastMonthPayout { get; }
public PayoutEntry ThisMonthPayout { get; }
}
@@ -0,0 +1,25 @@
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Dayforce;
public class TerminatedEmployeeResult
{
public TerminatedEmployeeResult(IReadOnlyDictionary<string, string> row)
{
DisplayName = row["Employee_DisplayName"];
EmployeeNumber = row["EmployeeEmploymentStatus_EmployeeNumber"];
LoginName = row["IdLibrary_LoginName"];
if (row.ContainsKey("EmployeeManager_ManagerEmployeeNumber"))
{
ManagerKey = row["EmployeeManager_ManagerEmployeeNumber"];
}
var termDate = row["Employee_TerminationDate"];
TerminationDate = string.IsNullOrWhiteSpace(termDate) ? DateTime.Now : DateTime.Parse(termDate);
}
public string DisplayName { get; }
public string EmployeeNumber { get; }
public string LoginName { get; }
public string ManagerKey { get; }
public DateTime TerminationDate { get; }
}