refactor: extract Models and Data into MoneyMap.Core shared library
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using CsvHelper.Configuration;
|
||||
|
||||
namespace MoneyMap.Models.Import;
|
||||
|
||||
public sealed class TransactionCsvRowMap : ClassMap<TransactionCsvRow>
|
||||
{
|
||||
public TransactionCsvRowMap(bool hasCategory)
|
||||
{
|
||||
Map(m => m.Date).Name("Date");
|
||||
Map(m => m.Transaction).Name("Transaction");
|
||||
Map(m => m.Name).Name("Name");
|
||||
Map(m => m.Memo).Name("Memo");
|
||||
Map(m => m.Amount).Name("Amount");
|
||||
|
||||
if (hasCategory)
|
||||
{
|
||||
Map(m => m.Category).Name("Category");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (hasCategory)
|
||||
{
|
||||
Map(m => m.Category).Name("Category");
|
||||
}
|
||||
else
|
||||
{
|
||||
Map(m => m.Category).Constant(string.Empty).Optional();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user