Files
2026-04-20 14:47:24 -05:00

334 lines
13 KiB
C#

using System;
using LCU.API.Collections.RepoApi.Models.Reporting;
using LCU.Shared.Collections.RepoApiLib.Models.Reporting;
namespace LCU.Shared.Collections.RepoApiLib.Formatting
{
public static class StdReportEntryColumns
{
public static Func<StdReportEntry, ReportHeaderCellMap> Member(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Member",
Cell = ReportCellFormatting.CreateStringCell(entry?.IndividualName)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> AccountNo(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Account No",
Cell = ReportCellFormatting.CreateStringCell(entry?.AccountNo)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> AccountCode(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Account Code",
Cell = ReportCellFormatting.CreateStringCell(entry?.AccountTypeCode)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Balance(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Balance",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.Balance)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Status(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Status",
Cell = ReportCellFormatting.CreateStringCell(entry?.Status)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DaysInStatus(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Days in Status",
Cell = ReportCellFormatting.CreateIntCell(entry?.DaysInStatus)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Bankruptcy(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Bankruptcy",
Cell = ReportCellFormatting.CreateStringCell(entry?.Bankruptcy)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Collector(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Collector",
Cell = ReportCellFormatting.CreateStringCell(entry?.Collector)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DaysCurrentDelq(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Days Current Delq",
Cell = ReportCellFormatting.CreateIntCell(entry?.DaysCurrentDelq)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DaysDelqWhenAdded(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Days Delq When Added",
Cell = ReportCellFormatting.CreateIntCell(entry?.DaysDelqWhenAdded)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DelinquentAmount(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Delinquent Amount",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.DelinquentAmount)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> LastPaymentAmount(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Last Payment Amount",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.LastPaymentAmount)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> LastPaymentDate(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Last Payment Date",
Cell = ReportCellFormatting.CreateDateCell(entry?.LastPaymentDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Auction(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Auction",
Cell = ReportCellFormatting.CreateStringCell(entry?.AuctionName)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Collateral(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Collateral",
Cell = ReportCellFormatting.CreateStringCell($"{entry?.Year} {entry?.Make} {entry?.Model}")
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> RepoCompany(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Repo Company",
Cell = ReportCellFormatting.CreateStringCell(entry?.RepoCompany)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> RepoType(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Repo Type",
Cell = ReportCellFormatting.CreateStringCell(entry?.RepoType)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DateAssigned(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Date Assigned",
Cell = ReportCellFormatting.CreateDateCell(entry?.RepoCompanyAssignmentDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DateRepoed(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Date Repoed",
Cell = ReportCellFormatting.CreateDateCell(entry?.DateRepoed)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> RepoDuration(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Repo Duration",
Cell = ReportCellFormatting.CreateIntCell(entry?.RepoDuration)
};
}
// IMSAutoFile Data
public static Func<StdReportEntry, ReportHeaderCellMap> AutoImsStatus(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "AutoIMS Status",
Cell = ReportCellFormatting.CreateStringCell(entry?.AutoImsStatus)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DateSold(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Date Sold",
Cell = ReportCellFormatting.CreateDateCell(entry?.SoldDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> DateEnteredAutoIMS(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Date Entered AutoIMS",
Cell = ReportCellFormatting.CreateDateCell(entry?.DateEnteredAutoIMS)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> ScheduledSaleDate(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Scheduled Sale Date",
Cell = ReportCellFormatting.CreateDateCell(entry?.ScheduledSaleDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> GrossPercentFloor(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Gross % Floor",
Cell = ReportCellFormatting.CreatePercentageCell(entry?.GrossPercentFloor)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> NetPercentFloor(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Net % Floor",
Cell = ReportCellFormatting.CreatePercentageCell(entry?.NetPercentFloor)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> TotalCharges(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Total Charges",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.TotalCharges)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> Grade(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Grade",
Cell = ReportCellFormatting.CreateDecimalCell(entry?.Grade, true)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> FloorPrice(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Floor Price",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.FloorPrice)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> GrossSalePrice(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Gross Sale Price",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.GrossSalePrice)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> FilteredStatus(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Filtered Status",
Cell = ReportCellFormatting.CreateStringCell(entry?.FilteredStatus)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> FilteredStatusChangeDate(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Filtered Status Changed On",
Cell = ReportCellFormatting.CreateDateCell(entry?.FilteredStatusChangeDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> O4RDate(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "First O4R",
Cell = ReportCellFormatting.CreateDateCell(entry?.O4RDate)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> SurplusDeficiency(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Surplus / Deficiency",
Cell = ReportCellFormatting.CreateCurrencyCell(entry?.GrossSalePrice - entry?.Balance)
};
}
public static Func<StdReportEntry, ReportHeaderCellMap> AutoIMSAssignmentToSold(string alternateHeader = null)
{
return (StdReportEntry entry) => new ReportHeaderCellMap()
{
Header = alternateHeader ?? "Days AutoIMS to Sold",
Cell = ReportCellFormatting.CreateIntCell(
entry != null ?
(
(entry.DateEnteredAutoIMS != null && entry.SoldDate != null) ?
(int?) (entry.SoldDate.Value - entry.DateEnteredAutoIMS.Value).TotalDays
: null
)
: null
)
};
}
}
}