Adding
This commit is contained in:
+61
@@ -0,0 +1,61 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LCU.Library.Internal.IncentiveApiModels.Results
|
||||
{
|
||||
public class ActiveEmployeeResult
|
||||
{
|
||||
public ActiveEmployeeResult(IReadOnlyDictionary<string, string> row)
|
||||
{
|
||||
DisplayName = row["Employee_DisplayName"];
|
||||
EmployeeNumber = row["EmployeeEmploymentStatus_EmployeeNumber"];
|
||||
var hireDate = row["Employee_HireDate"];
|
||||
HireDate = string.IsNullOrWhiteSpace(hireDate) ? DateTime.Now : DateTime.Parse(hireDate);
|
||||
LoginName = row["IdLibrary_LoginName"];
|
||||
if (row.ContainsKey("EmployeeManager_ManagerEmployeeNumber"))
|
||||
{
|
||||
ManagerKey = row["EmployeeManager_ManagerEmployeeNumber"];
|
||||
}
|
||||
|
||||
OrgCode = row["OrgUnit_LedgerCode"];
|
||||
OrgUnit = row["OrgUnit_ShortName"];
|
||||
Role = row["Job_ShortName"];
|
||||
Status = row["EmploymentStatus_ShortName"];
|
||||
}
|
||||
|
||||
public string DisplayName { get; }
|
||||
public string EmployeeNumber { get; }
|
||||
public DateTime HireDate { get; }
|
||||
public string LoginName { get; }
|
||||
public string? ManagerKey { get; }
|
||||
public string OrgCode { get; }
|
||||
public string OrgUnit { get; }
|
||||
public string Role { get; }
|
||||
public string Status { get; }
|
||||
|
||||
public bool CanProcess()
|
||||
{
|
||||
return !string.IsNullOrWhiteSpace(EmployeeNumber)
|
||||
&& !string.IsNullOrWhiteSpace(LoginName)
|
||||
&& !string.IsNullOrWhiteSpace(OrgUnit)
|
||||
&& !string.IsNullOrWhiteSpace(Role)
|
||||
&& !string.IsNullOrWhiteSpace(Status)
|
||||
&& Status == "Active";
|
||||
}
|
||||
|
||||
public string GetDnaOrgCode()
|
||||
{
|
||||
return "1" + OrgCode;
|
||||
}
|
||||
|
||||
public DateTime DetermineHireDate()
|
||||
{
|
||||
if (HireDate != DateTime.MinValue)
|
||||
{
|
||||
return HireDate;
|
||||
}
|
||||
|
||||
return new DateTime(DateTime.Today.Year, DateTime.Today.Month, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
namespace LCU.Library.Internal.IncentiveApiModels.Results
|
||||
{
|
||||
public class DataIntegrityAuditResult
|
||||
{
|
||||
public bool MaintenanceAutomationFailed { get; set; }
|
||||
public bool MaintenanceWasRequired { get; set; }
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace LCU.Library.Internal.IncentiveApiModels.Results
|
||||
{
|
||||
public class ProcessResult
|
||||
{
|
||||
public ProcessResult()
|
||||
{
|
||||
Success = true;
|
||||
MessageStack = new List<string>();
|
||||
}
|
||||
|
||||
public bool Success { get; set; }
|
||||
public List<string> MessageStack { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user