73 lines
2.9 KiB
C#
73 lines
2.9 KiB
C#
using CsvHelper.Configuration.Attributes;
|
|
using LCU.Library.Internal.IncentiveApiModels.Entities;
|
|
using LCU.Library.Internal.IncentiveApiModels.Enums;
|
|
using LCU.API.Internal.Operations.IncentiveApi.Models.Action;
|
|
using LCU.API.Internal.Operations.IncentiveApi.Models.Constants;
|
|
|
|
namespace LCU.API.Internal.Operations.IncentiveApi.Models.Temenos;
|
|
|
|
public class TemenosCreditCardSale
|
|
{
|
|
public string ApplicationID { get; set; }
|
|
public string SubProduct { get; set; }
|
|
public string FinalLoanAmount { get; set; }
|
|
public string DisbursedDate { get; set; }
|
|
public string ApplicantFirstName { get; set; }
|
|
public string ApplicantLastName { get; set; }
|
|
public string OrganizationName { get; set; }
|
|
public string LOResponsibleEmployeeEmail { get; set; }
|
|
public string LODirectLoanOfficer { get; set; }
|
|
public string ReferringEmployeeEmail { get; set; }
|
|
[Ignore]
|
|
public bool IsPersonal { get => SubProduct.StartsWith(TemenosImportConstants.PersonalCardSubProduct); }
|
|
[Ignore]
|
|
public string MemberName { get => IsPersonal ? $"{ApplicantFirstName} {ApplicantLastName}" : OrganizationName; }
|
|
|
|
public Activity CreateActivity(AppUser appUser)
|
|
{
|
|
var homeDept = appUser.FindHomeDepartment();
|
|
return new Activity()
|
|
{
|
|
Product = Product.CreditCard,
|
|
Type = ActivityType.Sale,
|
|
State = ActivityState.Accepted,
|
|
SourceSystem = SystemType.Temenos,
|
|
SourceCreated = DateTime.Parse(DisbursedDate),
|
|
Accepted = DateTime.Parse(DisbursedDate).Date.AddHours(12),
|
|
SourceId = ApplicationID,
|
|
Detail = new ActivityDetail()
|
|
{
|
|
MemberName = MemberName,
|
|
AccountBalance = IActionFileObject.ParseMoneyDouble(FinalLoanAmount),
|
|
AccountStatus = SubProduct
|
|
},
|
|
AppUserId = appUser.Id,
|
|
EmployeeEmail = appUser.AdEmail,
|
|
EmployeeId = appUser.EmployeeId,
|
|
DepartmentId = homeDept.DepartmentId
|
|
};
|
|
}
|
|
|
|
public DeadActivity CreateDeadActivity(DeadActivityReason reasonCode, string note, string employeeEmail = null, string employeeId = null)
|
|
{
|
|
return new DeadActivity(ApplicationID, SystemType.Action, reasonCode, note)
|
|
{
|
|
Product = Product.CreditCard,
|
|
Type = ActivityType.Sale,
|
|
State = ActivityState.Accepted,
|
|
SourceSystem = SystemType.Temenos,
|
|
SourceCreated = DateTime.Parse(DisbursedDate),
|
|
Accepted = DateTime.Parse(DisbursedDate).Date.AddHours(12),
|
|
SourceId = ApplicationID,
|
|
DeadDetail = new DeadActivityDetail()
|
|
{
|
|
MemberName = MemberName,
|
|
AccountBalance = IActionFileObject.ParseMoneyDouble(FinalLoanAmount),
|
|
AccountStatus = SubProduct
|
|
},
|
|
EmployeeEmail = employeeEmail,
|
|
EmployeeId = employeeId,
|
|
};
|
|
}
|
|
}
|