diff --git a/transactions/process.go b/transactions/process.go index 34c913b..b9a8f7d 100644 --- a/transactions/process.go +++ b/transactions/process.go @@ -13,8 +13,8 @@ func Process(revolutFile string, aibFile string, startDate time.Time) { revolutLines := utils.ReadInputFile(revolutFile) aibLines := utils.ReadInputFile(aibFile) - report = report.AddTransactions(revolutLines) - report = report.AddTransactions(aibLines) + report = report.AddTransactions(revolutLines, true) + report = report.AddTransactions(aibLines, false) report.Sort() report.Output() diff --git a/transactions/report.go b/transactions/report.go index e972785..7a9205f 100644 --- a/transactions/report.go +++ b/transactions/report.go @@ -3,7 +3,6 @@ package transactions import ( "fmt" "time" - "strings" "sort" ) @@ -20,8 +19,7 @@ func NewReport(startDate time.Time) *report { return r } -func (r report) AddTransactions(rawData[]string) *report { - isRevolut := strings.HasPrefix(rawData[0], "Completed Date") +func (r report) AddTransactions(rawData[]string, isRevolut bool) *report { if isRevolut { for i := len(rawData) - 1; i > 0; i-- { transaction := NewRevolutTransaction(rawData[i])