From d3d2e8bb2208a61b6aff58f386cc1ba603d1c5a7 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Fri, 8 Aug 2014 18:19:54 +0000 Subject: [PATCH] Committing work. Build is still broken. --- .../BankDataReaders/SEPaymentsBankgiroReader.cs | 13 +++++++++++++ .../BankDataReaders/TabSeparatedValuesReader.cs | 11 +++++++++++ Logic/Financial/ExternalBankDataProfile.cs | 10 +++++++++- Logic/Financial/FinancialAccount.cs | 1 + Logic/Financial/IBankDataAccountReader.cs | 10 ++++++++++ Logic/Financial/IBankDataPaymentsReader.cs | 11 +++++++++++ Logic/Financial/StockBankDataReaders.cs | 15 +++++++++++++++ Logic/Logic.csproj | 5 +++++ 8 files changed, 75 insertions(+), 1 deletion(-) create mode 100644 Logic/Financial/BankDataReaders/SEPaymentsBankgiroReader.cs create mode 100644 Logic/Financial/BankDataReaders/TabSeparatedValuesReader.cs create mode 100644 Logic/Financial/IBankDataAccountReader.cs create mode 100644 Logic/Financial/IBankDataPaymentsReader.cs create mode 100644 Logic/Financial/StockBankDataReaders.cs diff --git a/Logic/Financial/BankDataReaders/SEPaymentsBankgiroReader.cs b/Logic/Financial/BankDataReaders/SEPaymentsBankgiroReader.cs new file mode 100644 index 00000000..26e9aa71 --- /dev/null +++ b/Logic/Financial/BankDataReaders/SEPaymentsBankgiroReader.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Swarmops.Logic.Financial.BankDataReaders +{ +// ReSharper disable once InconsistentNaming + class SEPaymentsBankgiroReader: IBankDataPaymentsReader + { + + } +} diff --git a/Logic/Financial/BankDataReaders/TabSeparatedValuesReader.cs b/Logic/Financial/BankDataReaders/TabSeparatedValuesReader.cs new file mode 100644 index 00000000..ac33e557 --- /dev/null +++ b/Logic/Financial/BankDataReaders/TabSeparatedValuesReader.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Swarmops.Logic.Financial.BankDataReaders +{ + public class TabSeparatedValuesReader: IBankDataAccountReader + { + } +} diff --git a/Logic/Financial/ExternalBankDataProfile.cs b/Logic/Financial/ExternalBankDataProfile.cs index 942b3cc4..b1e28091 100644 --- a/Logic/Financial/ExternalBankDataProfile.cs +++ b/Logic/Financial/ExternalBankDataProfile.cs @@ -56,6 +56,9 @@ namespace Swarmops.Logic.Financial result.FeeSignage = FeeSignage.Unknown; // no inline fees result.Precision = ExternalBankDateTimePrecision.Day; + result.BankDataAccountReader = StockBankDataReaders.TabSeparatedValuesAccountReader; + result.BankDataPaymentsReader = StockBankDataReaders.SEPaymentsBankgiroReader; + return result; } @@ -63,7 +66,7 @@ namespace Swarmops.Logic.Financial { result.Name = "Paypal"; result.Country = null; - result.Culture = "sv-SE"; // what the actual fuck? Paypal's giving me sv-SE culture + result.Culture = "sv-SE"; // what the actual fuck? Paypal's giving me sv-SE culture in export file result.FieldNames[ExternalBankDataFieldName.Date] = "Date"; result.FieldNames[ExternalBankDataFieldName.Time] = "Time"; @@ -80,6 +83,9 @@ namespace Swarmops.Logic.Financial result.FeeSignage = FeeSignage.Negative; result.Precision = ExternalBankDateTimePrecision.Second; + result.BankDataAccountReader = StockBankDataReaders.TabSeparatedValuesAccountReader; + result.BankDataPaymentsReader = null; // No aggregated payments with Paypal + return result; } @@ -96,6 +102,8 @@ namespace Swarmops.Logic.Financial public LatestTransactionLocation LatestTransactionLocation; public ExternalBankDateTimePrecision Precision; public FeeSignage FeeSignage; + public string BankDataAccountReader { get; set; } + public string BankDataPaymentsReader { get; set; } public Dictionary FieldNames { get; private set; } } diff --git a/Logic/Financial/FinancialAccount.cs b/Logic/Financial/FinancialAccount.cs index 59c1d5e1..20ba9fe4 100644 --- a/Logic/Financial/FinancialAccount.cs +++ b/Logic/Financial/FinancialAccount.cs @@ -189,6 +189,7 @@ namespace Swarmops.Logic.Financial } + #region ITreeNode Members diff --git a/Logic/Financial/IBankDataAccountReader.cs b/Logic/Financial/IBankDataAccountReader.cs new file mode 100644 index 00000000..fcb8bd4a --- /dev/null +++ b/Logic/Financial/IBankDataAccountReader.cs @@ -0,0 +1,10 @@ +using System.IO; +using Swarmops.Logic.Financial.BankDataReaders; + +namespace Swarmops.Logic.Financial +{ + interface IBankDataAccountReader + { + ImportedBankData ReadData(TextReader data, IBankDataPaymentsReader paymentsReader); + } +} diff --git a/Logic/Financial/IBankDataPaymentsReader.cs b/Logic/Financial/IBankDataPaymentsReader.cs new file mode 100644 index 00000000..706bf583 --- /dev/null +++ b/Logic/Financial/IBankDataPaymentsReader.cs @@ -0,0 +1,11 @@ +namespace Swarmops.Logic.Financial +{ + interface IBankDataPaymentsReader + { + void GetParameterList(); // TODO - need to find types of params and return for this guy + void SetParameters(); // TODO - ditto + string GetDescriptionRegex(); + string GenerateUniquePaymentGroupId(); // parameters here? + void ImportPaymentsFile(); // Input parameter(s)? + } +} diff --git a/Logic/Financial/StockBankDataReaders.cs b/Logic/Financial/StockBankDataReaders.cs new file mode 100644 index 00000000..d7ae0d31 --- /dev/null +++ b/Logic/Financial/StockBankDataReaders.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Swarmops.Logic.Financial +{ + // ReSharper disable InconsistentNaming + class StockBankDataReaders + { + public static string TabSeparatedValuesAccountReader { get { return "TabSeparatedValuesReader"; }} + public static string SEPaymentsBankgiroReader { get { return "SEPaymentsBankgiroReader"; }} + } + // ReSharper restore InconsistentNaming +} diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index ee8b162d..7fd87da1 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -95,6 +95,10 @@ + + + + @@ -108,6 +112,7 @@ +