Initial setup - gitea
This commit is contained in:
45
PriorBankParser/TransactionInfoDtoWriteMap.cs
Normal file
45
PriorBankParser/TransactionInfoDtoWriteMap.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System.Globalization;
|
||||
using CsvHelper.Configuration;
|
||||
using PriorBankParser.Dtos;
|
||||
|
||||
namespace PriorBankParser
|
||||
{
|
||||
internal sealed class TransactionInfoDtoWriteMap : ClassMap<TransactionDto>
|
||||
{
|
||||
private const string DateTimeString = "yyyy-MM-dd hh:mm:ss";
|
||||
private const string NumberFormat = "F";
|
||||
|
||||
public TransactionInfoDtoWriteMap()
|
||||
{
|
||||
Map(m => m.Contract)
|
||||
.ConvertUsing(m => m.Contract.Trim())
|
||||
.Index(10);
|
||||
Map(m => m.TransactionName)
|
||||
.ConvertUsing(m => m.TransactionName.Trim())
|
||||
.Index(20);
|
||||
Map(m => m.Category)
|
||||
.ConvertUsing(m => m.Category.Trim())
|
||||
.Index(30);
|
||||
Map(m => m.Currency)
|
||||
.ConvertUsing(m => m.Currency.Trim())
|
||||
.Index(40);
|
||||
Map(m => m.IsIncome)
|
||||
.Index(50);
|
||||
Map(m => m.TransactionDate)
|
||||
.Index(60)
|
||||
.ConvertUsing(c => c.TransactionDate.ToString(DateTimeString, CultureInfo.InvariantCulture));
|
||||
Map(m => m.OperationDate)
|
||||
.Index(70)
|
||||
.ConvertUsing(c => c.OperationDate.ToString(DateTimeString, CultureInfo.InvariantCulture));
|
||||
Map(m => m.Amount)
|
||||
.Index(80)
|
||||
.ConvertUsing(c => c.Amount.ToString(NumberFormat, CultureInfo.InvariantCulture));
|
||||
Map(m => m.Commission)
|
||||
.Index(90)
|
||||
.ConvertUsing(c => c.Commission.ToString(NumberFormat, CultureInfo.InvariantCulture));
|
||||
Map(m => m.AccountTurnover)
|
||||
.Index(100)
|
||||
.ConvertUsing(c => c.AccountTurnover.ToString(NumberFormat, CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user