Codebasis als Dateien ins Arbeitsrepo statt als Gitlink

QuellCode/CentronERP war nur als Gitlink (Submodul-Referenz auf 79c1142)
getrackt, ohne .gitmodules und ohne erreichbares Remote. Der
Untersuchungsgegenstand der Versuchsreihe war damit nicht reproduzierbar
gesichert: Ein Klon haette ein leeres Verzeichnis erhalten, und die Belege
der 3.287 Anforderungen waeren nicht ueberpruefbar gewesen.

Umstellung:
- Historie nach c:\DEV\CentronERP_git_snapshot_79c1142 ausgelagert
  (vollstaendig lesbar, enthaelt 79c1142 und Vorgaenger 89ccfd6)
- Gitlink aus dem Index entfernt
- Dateiinhalt aufgenommen: 24.557 Dateien, rund 333 MB

Die verschachtelte .gitignore der Codebasis gilt weiter, Build-Artefakte
bleiben ausgeschlossen. Details in Versuche/Versuch_01/_Codebasis-Nachweis.md
This commit is contained in:
Christoph Schwörer
2026-08-26 07:43:51 +02:00
parent 18edae75b6
commit f045b99a25
24664 changed files with 5846716 additions and 1 deletions
@@ -0,0 +1,164 @@
[
{
AccountIBAN: 'DE26930901000012345678',
Amount: 1671.4000000,
BIC: 'HIJKLMN',
BookingDate: DateTime,
BookingText: 'Abbuchung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.01,
Description: 'Bestbeschreibung 2',
I3D: 2,
IsCompleted: false,
IsVisible: false,
OnlineBankingConfigurationI3D: 22,
RelatedCustomerI3D: 10000,
RelatedCustomerName: 'c-entron software gmbh',
Sender: 'Test Sender',
TransactionAssignments: [
{
AccountTransactionI3D: 2,
AssignedAmount: 1671.36,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: 0.00,
BookedDate: null,
BookedReceiptDemandedGrossAmount: null,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: 0.00,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 1671.36,
ReceiptI3D: 4392,
ReceiptMatchingHeuristic: 4,
ReceiptMatchingRate: 75.0,
ReceiptNumber: 40262,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 1671.36,
ReceiptPaidGrossAmount: 0.0
}
],
TransactionState: 0,
TypeCode: '103'
},
{
AccountIBAN: 'DE12345678901234567890',
Amount: 190.5000000,
BIC: 'ABCDEFG',
BookingDate: DateTime,
BookingText: 'Überweisung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.75,
Description: 'Rechnung 40233, 40282',
I3D: 1,
IsCompleted: false,
IsVisible: true,
OnlineBankingConfigurationI3D: 1,
RelatedCustomerI3D: 10003,
RelatedCustomerName: 'Herzog Martin',
Sender: 'Martin Herzog',
TransactionAssignments: [
{
AccountTransactionI3D: 1,
AssignedAmount: 18.70,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: 0.00,
BookedDate: null,
BookedReceiptDemandedGrossAmount: null,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: 52.70,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: null,
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 71.40,
ReceiptI3D: 1349,
ReceiptMatchingHeuristic: 2,
ReceiptMatchingRate: 95.0,
ReceiptNumber: 40233,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 18.70,
ReceiptPaidGrossAmount: 0.0
},
{
AccountTransactionI3D: 1,
AssignedAmount: 154.80,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: 0.00,
BookedDate: null,
BookedReceiptDemandedGrossAmount: null,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: 0.00,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 154.80,
ReceiptI3D: 6553,
ReceiptMatchingHeuristic: 2,
ReceiptMatchingRate: 95.0,
ReceiptNumber: 40282,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 154.80,
ReceiptPaidGrossAmount: 0.0
},
{
AccountTransactionI3D: 1,
AssignedAmount: 17.0000000,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: 0.00,
BookedDate: null,
BookedReceiptDemandedGrossAmount: null,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: 0.00,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: null,
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 35.70,
ReceiptI3D: 5414,
ReceiptMatchingHeuristic: 5,
ReceiptMatchingRate: 70.0,
ReceiptNumber: 40274,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 35.70,
ReceiptPaidGrossAmount: 0.0
}
],
TransactionState: 0,
TypeCode: '103'
}
]
@@ -0,0 +1,164 @@
[
{
AccountIBAN: 'DE26930901000012345678',
Amount: 1671.4000000,
BIC: 'HIJKLMN',
BookingDate: DateTime,
BookingText: 'Abbuchung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.01,
Description: 'Bestbeschreibung 2',
I3D: 2,
IsCompleted: false,
IsVisible: false,
OnlineBankingConfigurationI3D: 22,
RelatedCustomerI3D: 10000,
RelatedCustomerName: 'c-entron software gmbh',
Sender: 'Test Sender',
TransactionAssignments: [
{
AccountTransactionI3D: 2,
AssignedAmount: 0.0,
AssignmentState: 0,
BookedByEmployeeI3D: 44,
BookedCreditVouchersGrossAmount: null,
BookedDate: DateTime,
BookedReceiptDemandedGrossAmount: 13090.00,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: null,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: true,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 0.0,
ReceiptI3D: 1372,
ReceiptMatchingHeuristic: 1,
ReceiptMatchingRate: 0.5,
ReceiptNumber: 40252,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 13090.0,
ReceiptPaidGrossAmount: 0.00
},
{
AccountTransactionI3D: 2,
AssignedAmount: 4356.86,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: null,
BookedDate: null,
BookedReceiptDemandedGrossAmount: 4356.86,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: null,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 0.0,
ReceiptI3D: 1318,
ReceiptMatchingHeuristic: 1,
ReceiptMatchingRate: 0.5,
ReceiptNumber: 40221,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 4356.86,
ReceiptPaidGrossAmount: 0.00
}
],
TransactionState: 0,
TypeCode: '103'
},
{
AccountIBAN: 'DE12345678901234567890',
Amount: 190.5000000,
BIC: 'ABCDEFG',
BookingDate: DateTime,
BookingText: 'Überweisung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.75,
Description: 'Rechnung 40233, 40282',
I3D: 1,
IsCompleted: false,
IsVisible: true,
OnlineBankingConfigurationI3D: 1,
RelatedCustomerI3D: 10003,
RelatedCustomerName: 'Herzog Martin',
Sender: 'Martin Herzog',
TransactionAssignments: [
{
AccountTransactionI3D: 1,
AssignedAmount: 0.0,
AssignmentState: 0,
BookedByEmployeeI3D: 44,
BookedCreditVouchersGrossAmount: null,
BookedDate: DateTime,
BookedReceiptDemandedGrossAmount: 23.80,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: null,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: true,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 0.0,
ReceiptI3D: 6565,
ReceiptMatchingHeuristic: 1,
ReceiptMatchingRate: 0.5,
ReceiptNumber: 40283,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 23.8,
ReceiptPaidGrossAmount: 0.00
},
{
AccountTransactionI3D: 1,
AssignedAmount: 154.8,
AssignmentState: 0,
BookedByEmployeeI3D: null,
BookedCreditVouchersGrossAmount: null,
BookedDate: null,
BookedReceiptDemandedGrossAmount: 154.80,
BookedReceiptOpenGrossAmount: null,
BookedReceiptPaidGrossAmount: null,
CloseReceiptAfterBooking: null,
CloseRelatedCreditVouchers: null,
CreditVouchersGrossAmount: 0.0,
I3D: 0,
IsBooked: false,
PaymentConditionI3D: null,
PaymentConditionName: null,
PaymentConditionText: null,
ReceiptCaption: '',
ReceiptDate: DateTime,
ReceiptDemandedGrossAmount: 0.0,
ReceiptI3D: 6553,
ReceiptMatchingHeuristic: 1,
ReceiptMatchingRate: 0.5,
ReceiptNumber: 40282,
ReceiptObjectKind: 4,
ReceiptOpenGrossAmount: 154.8,
ReceiptPaidGrossAmount: 0.00
}
],
TransactionState: 0,
TypeCode: '103'
}
]
@@ -0,0 +1,11 @@
[
{
BankAccountNumber: '1234567890',
Bic: 'ABCDEFG',
CustomerI3D: 10003,
CustomerName: 'Herzog Martin',
Iban: 'DE12345678901234567890',
OnlineBankingAccountTransactionBookingDate: DateTime,
OnlineBankingAccountTransactionI3D: 1
}
]
@@ -0,0 +1,11 @@
[
{
BankAccountNumber: '1234567890',
Bic: 'ABCDEFG',
CustomerI3D: 10003,
CustomerName: 'Herzog Martin',
Iban: 'DE12345678901234567890',
OnlineBankingAccountTransactionBookingDate: DateTime,
OnlineBankingAccountTransactionI3D: 1
}
]
@@ -0,0 +1,278 @@
using Centron.BusinessLogic;
using Centron.BusinessLogic.Accounting;
using Centron.BusinessLogic.Finances.OnlineBanking;
using Centron.BusinessLogic.Sales.Receipts.DataAndResults;
using Centron.BusinessLogic.WebServices.Administration.CentronConfigDb;
using Centron.BusinessLogic.WebServices.Finances.OnlineBanking;
using Centron.BusinessLogic.WebServices.PasswordManager;
using Centron.BusinessLogic.WebServices.Sales.Customers;
using Centron.BusinessLogic.WebServices.Sales.Receipts;
using Centron.BusinessLogic.WebServices.Sales.Receipts.ReceiptSearch;
using Centron.Data.Entities.Finances.OnlineBanking;
using Centron.Data.WebServices.Sales.Customers;
using Centron.Data.WebServices.Sales.Receipts.Invoices;
using Centron.Interfaces;
using Centron.Interfaces.Accounting;
using Centron.Interfaces.BL;
using Centron.Interfaces.Finances.OnlineBanking;
using Centron.Interfaces.Sales.Receipts.ReceiptSearch;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.Entities.Accounts.Accounting;
using CentronSoftware.Centron.WebServices.Entities.Finances.OnlineBanking;
using CentronSoftware.Centron.WebServices.Entities.PasswordManager;
using CentronSoftware.Centron.WebServices.RestRequests.OnlineBanking;
using DevExpress.Xpo;
using FastReport;
using FluentNHibernate.Conventions;
using Microsoft.Graph.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
namespace Centron.Tests.EndToEnd.Tests.OnlineBanking
{
public class OnlineBankingAccountTransactionTest : EndToEndTest
{
private int _configI3D;
public OnlineBankingAccountTransactionTest(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
this.PrepareDatabase();
this.CreateAndSaveAccountTransactions(); // Also checks if the SaveMethod prevents saving duplicates with the same data
// TODO: The new save method also auto checks for complete status. Is this really the right approach?
var accountTransactions1 = this.LoadAccountTransactions();
var accountTransactions2 = this.LoadAccountTransactions();
this.AddCustomerAndAssignmentsManually(accountTransactions1);
this.AddCustomerAndAssignmentsAutomatically(accountTransactions2);
this.TestCheckForUnknownIbans();
}
private void PrepareDatabase()
{
var user = this.GetLoggedInUser();
// Use file instead of config DB
this.WithSession(f => f.GetBL<PasswordManagerWebServiceBL>().UpdatePasswordManagerSettings(user, new PasswordManagerSettingsDTO
{
IsPasswordManagerGuidelineManagementActive = false,
SecondsUntilNewAuthentificationPasswordManagerAccess = 0,
MasterPasswordSaveLocation = MasterPasswordSaveLocation.SecureFile,
MasterPasswordSecureFileName = "TestMasterKey.txt"
}));
var masterkeySaveresult = this.WithSession(f => f.GetBL<CentronConfigurationDbWebServiceBL>().SetHotlineMasterKey(user, "1234ABC567")).ThrowIfError();
Assert.True(masterkeySaveresult);
var config = new OnlineBankingConfigurationFinApiDTO()
{
Name = "Test",
BranchI3D = 0
};
var configSaveResult = this.WithSession(f => f.GetBL<OnlineBankingConfigurationWebServiceBL>().SaveOnlineBankingConfiguration(config, user)).ThrowIfError();
this._configI3D = configSaveResult.I3D;
base.Sql(@"
UPDATE RechKopf
SET Bezahlt = 52.7
WHERE Nummer = 40233");
}
private void CreateAndSaveAccountTransactions()
{
using var session = new BLSession();
var accountTransactionsWebServiceBL = session.GetBL<OnlineBankingAccountTransactionsWebServiceBL>();
var user = this.GetLoggedInUser();
var transaction1 = new OnlineBankingAccountTransactionDTO()
{
OnlineBankingConfigurationI3D = this._configI3D,
TypeCode = "103",
BookingDate = new DateTime(new DateOnly(2024, 03,20), new TimeOnly(15, 00)),
Amount = 190.5m,
Currency = "EUR",
Description = "Rechnung 40233, 40282",
BookingText = "Überweisung",
BIC = "ABCDEFG",
AccountIBAN = "DE12345678901234567890",
Sender = "Martin Herzog",
RelatedCustomerI3D = 10000,
CustomerMatchingRate = 0.75,
IsCompleted = true,
IsVisible = true,
};
var transaction2 = new OnlineBankingAccountTransactionDTO()
{
OnlineBankingConfigurationI3D = 22,
TypeCode = "103",
BookingDate = new DateTime(new DateOnly(2024, 03, 21), new TimeOnly(09, 08)),
Amount = 1671.4m,
Currency = "EUR",
Description = "Bestbeschreibung 2",
BookingText = "Abbuchung",
BIC = "HIJKLMN",
AccountIBAN = "DE26930901000012345678",
Sender = "Test Sender",
RelatedCustomerI3D = 10012,
CustomerMatchingRate = 0.01,
IsCompleted = false,
IsVisible = false,
};
var savedAccountTransactions1 = accountTransactionsWebServiceBL.SaveOnlineBankingAccountTransactions(
new List<OnlineBankingAccountTransactionDTO>()
{
transaction1,
transaction2
}, user).ThrowIfError();
var duplicatesSaveResult = accountTransactionsWebServiceBL.SaveOnlineBankingAccountTransactions(
new List<OnlineBankingAccountTransactionDTO>()
{
transaction2,
transaction1
}, user);
if (duplicatesSaveResult.Status != ResultStatus.Warning || duplicatesSaveResult.Data.Count > 0)
throw new Exception("Account transactions with the same data were saved twice. There should be no data duplicates in the table!");
}
private IList<OnlineBankingAccountTransactionDTO> LoadAccountTransactions()
{
using var session = new BLSession();
var accountTransactionsWebServiceBL = session.GetBL<OnlineBankingAccountTransactionsWebServiceBL>();
var user = this.GetLoggedInUser();
var accountTransactions = accountTransactionsWebServiceBL.GetOnlineBankingAccountTransactionsByFilter(
new OnlineBankingAccountTransactionsFilter(), user).ThrowIfError();
this.Verifier.Verify($"OnlineBankingAccountTransactions", accountTransactions.ToList());
return accountTransactions;
}
private void AddCustomerAndAssignmentsManually(IList<OnlineBankingAccountTransactionDTO> accountTransactions)
{
using var session = new BLSession();
var accountTransactionsWebServiceBL = session.GetBL<OnlineBankingAccountTransactionsWebServiceBL>();
var customerWebServiceBL = session.GetBL<CustomerWebServiceBL>();
var receiptWebServiceBL = session.GetBL<ReceiptSearchWebServiceBL>();
var user = this.GetLoggedInUser();
var customers = customerWebServiceBL.GetCustomersByIDs(new List<int>() { 10000, 10003 });
var filter1 = new ReceiptSearchFilter() { ReceiptI3Ds = new List<int>() { 1318, 1372 } };
var receipts1 = receiptWebServiceBL.SearchReceipts(user, filter1, 1, int.MaxValue).ThrowIfError();
var filter2 = new ReceiptSearchFilter() { ReceiptI3Ds = new List<int>() { 6553, 6565 } };
var receipts2 = receiptWebServiceBL.SearchReceipts(user, filter2, 1, int.MaxValue).ThrowIfError();
if (accountTransactions.Count != 2 || customers.Count != 2 || receipts1.Count != 2 || receipts2.Count != 2)
throw new Exception("Expected two objects each for AccountTransactions, Customers and Receipts!");
for(int i=0; i<2; i++)
{
var accountTransaction = accountTransactions[i];
var customer = customers[i];
var receiptSearchResult = i == 0 ? receipts1 : receipts2;
var receipt1 = receiptSearchResult.Result[0];
var receipt2 = receiptSearchResult.Result[1];
accountTransaction.RelatedCustomerI3D = customer.I3D;
accountTransaction.RelatedCustomerName = customer.Name;
accountTransaction.TransactionAssignments.Add(new OnlineBankingTransactionAssignmentDTO()
{
AccountTransactionI3D = accountTransaction.I3D,
ReceiptI3D = receipt1.I3D,
ReceiptObjectKind = (CentronObjectKindNumeric) receipt1.ObjectKind,
ReceiptMatchingRate = 0.5,
BookedReceiptDemandedGrossAmount = receipt1.NetPriceComplete + receipt1.TaxPriceComplete,
ReceiptPaidGrossAmount = receipt1.PaidPrice,
ReceiptOpenGrossAmount = receipt1.OpenPrice,
AssignedAmount = 0m,
ReceiptMatchingHeuristic = OnlineBankingReceiptMatchingHeuristic.ManuallySet,
ReceiptDate = receipt1.DueDate.Value,
ReceiptNumber = receipt1.Number,
ReceiptCaption = receipt1.Caption,
IsBooked = true,
BookedByEmployeeI3D = 44,
BookedDate = new DateTime(new DateOnly(2024, 03, 22), new TimeOnly(10, 00)),
});
accountTransaction.TransactionAssignments.Add(new OnlineBankingTransactionAssignmentDTO()
{
AccountTransactionI3D = accountTransaction.I3D,
ReceiptI3D = receipt2.I3D,
ReceiptObjectKind = (CentronObjectKindNumeric) receipt2.ObjectKind,
ReceiptMatchingRate = 0.5,
BookedReceiptDemandedGrossAmount = receipt2.NetPriceComplete + receipt2.TaxPriceComplete,
ReceiptPaidGrossAmount = receipt2.PaidPrice,
ReceiptOpenGrossAmount = receipt2.OpenPrice,
AssignedAmount = receipt2.OpenPrice,
ReceiptMatchingHeuristic = OnlineBankingReceiptMatchingHeuristic.ManuallySet,
ReceiptDate = receipt2.DueDate.Value,
ReceiptNumber = receipt2.Number,
ReceiptCaption = receipt2.Caption,
IsBooked = false,
BookedByEmployeeI3D = null,
BookedDate = null
});
}
var savedAccountTransactions = accountTransactionsWebServiceBL.SaveOnlineBankingAccountTransactions(accountTransactions.ToList() , user).ThrowIfError();
this.Verifier.Verify($"AccountTransactionsWithManuallyAddedAssignments", accountTransactions.ToList());
}
private void AddCustomerAndAssignmentsAutomatically(IList<OnlineBankingAccountTransactionDTO> accountTransactions)
{
using var session = new BLSession();
var accountTransactionsWebServiceBL = session.GetBL<OnlineBankingAccountTransactionsWebServiceBL>();
var user = this.GetLoggedInUser();
var request = new AutoCompleteAccountTransactionsRequest() { OnlineBankingAccountTransactions = accountTransactions.ToList() };
var updated = accountTransactionsWebServiceBL.AutoCompleteAccountTransacitons(request, user).ThrowIfError();
this.Verifier.Verify($"AccountTransactionsWithAutomaticallyAddedAssignments", updated.ToList());
}
private void TestCheckForUnknownIbans()
{
using var session = new BLSession();
var accountTransactionsBL = session.GetBL<OnlineBankingAccountTransactionsBL>();
var user = this.GetLoggedInUser();
var request1 = new CheckForUnknownIbansRequest
{
IncludeCompleted = true
};
var result1 = accountTransactionsBL.CheckForUnknownIbans(request1, user).ThrowIfError();
this.Verifier.Verify($"CheckForUnknownIbans_IncludeCompleted", result1.ToList());
var request2 = new CheckForUnknownIbansRequest
{
IncludeCompleted = false,
DateFrom = new DateTime(2024, 03, 01),
DateTo = new DateTime(2024, 03, 31)
};
var result2 = accountTransactionsBL.CheckForUnknownIbans(request2, user).ThrowIfError();
this.Verifier.Verify($"CheckForUnknownIbans_WithDateRange", result2.ToList());
}
}
}
@@ -0,0 +1,46 @@
[
{
AccountIBAN: 'DE26930901000012345678',
Amount: 1671.4000000,
BIC: 'HIJKLMN',
BookingDate: DateTime,
BookingText: 'Abbuchung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.01,
Description: 'Bestbeschreibung 2',
I3D: 2,
IsCompleted: false,
IsVisible: false,
OnlineBankingConfigurationI3D: 22,
RelatedCustomerI3D: 10012,
RelatedCustomerName: '',
Sender: 'Test Sender',
TransactionAssignments: [],
TransactionState: 0,
TypeCode: '103'
},
{
AccountIBAN: 'DE12345678901234567890',
Amount: 190.5000000,
BIC: 'ABCDEFG',
BookingDate: DateTime,
BookingText: 'Überweisung',
CompletedDate: null,
Currency: 'EUR',
CustomerMatchingHeuristic: null,
CustomerMatchingRate: 0.75,
Description: 'Rechnung 40233, 40282',
I3D: 1,
IsCompleted: false,
IsVisible: true,
OnlineBankingConfigurationI3D: 1,
RelatedCustomerI3D: 10000,
RelatedCustomerName: '',
Sender: 'Martin Herzog',
TransactionAssignments: [],
TransactionState: 0,
TypeCode: '103'
}
]
@@ -0,0 +1,87 @@
using Centron.Interfaces.BL;
using Centron.BusinessLogic;
using Centron.BusinessLogic.WebServices.Administration.CentronConfigDb;
using Centron.BusinessLogic.WebServices.Finances.OnlineBanking;
using Centron.Tests.EndToEnd.Infrastructure;
using CentronSoftware.Centron.WebServices.Entities.Finances.OnlineBanking;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Centron.BusinessLogic.WebServices.PasswordManager;
using Xunit;
using Xunit.Abstractions;
using Centron.Interfaces.Finances.OnlineBanking;
using CentronSoftware.Centron.WebServices.Entities.PasswordManager;
namespace Centron.Tests.EndToEnd.Tests.OnlineBanking
{
public class OnlineBankingConfigurationFinApiTest : EndToEndTest
{
public OnlineBankingConfigurationFinApiTest(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
public override void Execute()
{
this.PrepareDatabase();
// Create
var savedFinApiConfig = this.CreateFinApiConfiguration();
// Load
var finApiConfigurations = this.LoadFinApiConfigurations();
}
private IList<OnlineBankingConfigurationDTO> LoadFinApiConfigurations()
{
using var session = new BLSession();
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
var user = this.GetLoggedInUser();
var filter1 = new OnlineBankingConfigurationsFilter() { ConfigurationType = OnlineBankingConfigurationType.SERVICE_FINAPI };
return onlineBankingConfigurationBL.GetOnlineBankingConfigurationsByFilter(filter1, isUnitTest: true).ThrowIfError();
}
private void PrepareDatabase()
{
var user = this.GetLoggedInUser();
// Use file instead of config DB
this.WithSession(f => f.GetBL<PasswordManagerWebServiceBL>().UpdatePasswordManagerSettings(user, new PasswordManagerSettingsDTO
{
IsPasswordManagerGuidelineManagementActive = false,
SecondsUntilNewAuthentificationPasswordManagerAccess = 0,
MasterPasswordSaveLocation = MasterPasswordSaveLocation.SecureFile,
MasterPasswordSecureFileName = "TestMasterKey.txt"
}));
var masterkeySaveresult = this.WithSession(f => f.GetBL<CentronConfigurationDbWebServiceBL>().SetHotlineMasterKey(user, "1234ABC567")).ThrowIfError();
Assert.True(masterkeySaveresult);
}
private OnlineBankingConfigurationFinApiDTO CreateFinApiConfiguration()
{
using var session = new BLSession();
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
var user = this.GetLoggedInUser();
var finApiConfigDTO = new OnlineBankingConfigurationFinApiDTO()
{
Name = "FinAPI Testkonfiguration",
Description = "Das ist eine Testkonfiguration für FinAPI",
BranchI3D = null,
CreatedByEmployeeI3D = user.UserI3D ?? 0,
CreatedDate = DateTime.Now,
CreatedVersion = "2409",
ChangedByEmployeeI3D = user.UserI3D ?? 0,
ChangedDate = DateTime.Now,
ChangedVersion = "2409",
UserAccountPassword = "test1",
};
return (OnlineBankingConfigurationFinApiDTO) onlineBankingConfigurationBL.SaveOnlineBankingConfiguration(finApiConfigDTO, user).ThrowIfError();
}
}
}
@@ -0,0 +1,197 @@
using Centron.Interfaces.BL;
using Centron.BusinessLogic;
using Centron.BusinessLogic.Finances.OnlineBanking;
using Centron.Data.Entities.Finances.OnlineBanking;
using Centron.Interfaces.Finances.OnlineBanking;
using Centron.Tests.EndToEnd.Infrastructure;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Centron.BusinessLogic.WebServices.Administration.CentronConfigDb;
using Xunit.Abstractions;
using CentronSoftware.Centron.WebServices.Entities.Finances.OnlineBanking;
using Xunit;
using Centron.BusinessLogic.WebServices.Finances.OnlineBanking;
using Centron.BusinessLogic.WebServices.PasswordManager;
using CentronSoftware.Centron.WebServices.Entities.PasswordManager;
namespace Centron.Tests.EndToEnd.Tests.OnlineBanking
{
public class OnlineBankingConfigurationTest : EndToEndTest
{
private List<OnlineBankingConfigurationDTO> _finTSConfigurations;
private List<OnlineBankingConfigurationDTO> _spreadsheetConfigurations;
public OnlineBankingConfigurationTest(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
//this.Verifier.Settings.IgnoreProperty<DunningSettingsDTO>(f => f.AdvisorEmailTextVariables);
this._finTSConfigurations = new List<OnlineBankingConfigurationDTO>();
this._spreadsheetConfigurations = new List<OnlineBankingConfigurationDTO>();
}
public override void Execute()
{
this.PrepareDatabase();
// Create
this.CreateFinTSOnlineBankingConfigurations();
this.CreateSpreadsheetOnlineBankingConfigurations();
// Load
this.LoadFinTSOnlineBankingConfigurations();
}
private void PrepareDatabase()
{
var user = this.GetLoggedInUser();
// Use file instead of config DB
this.WithSession(f => f.GetBL<PasswordManagerWebServiceBL>().UpdatePasswordManagerSettings(user, new PasswordManagerSettingsDTO
{
IsPasswordManagerGuidelineManagementActive = false,
SecondsUntilNewAuthentificationPasswordManagerAccess = 0,
MasterPasswordSaveLocation = MasterPasswordSaveLocation.SecureFile,
MasterPasswordSecureFileName = "TestMasterKey.txt"
}));
var masterkeySaveresult = this.WithSession(f => f.GetBL<CentronConfigurationDbWebServiceBL>().SetHotlineMasterKey(user, "1234ABC567")).ThrowIfError();
Assert.True(masterkeySaveresult);
/* reset all invoices dunning stuff and close all
this.Sql(@"UPDATE RechKopf
SET Mahnung1Datum = NULL,
Mahnung1BearbeiterI3D = NULL,
Mahnung2Datum = NULL,
Mahnung2BearbeiterI3D = NULL,
Mahnung3Datum = NULL,
Mahnung3BearbeiterI3D = NULL,
MahnInfo = NULL,
MahnStop = NULL,
Mahnstufe = 0,
Datum = '2020-01-01 00:00:00.000',
FaelligAm = '2020-01-20 00:00:00.000',
Status = 2");
*/
}
private void CreateFinTSOnlineBankingConfigurations()
{
using var session = new BLSession();
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
var user = this.GetLoggedInUser();
var fintsConfig1 = new OnlineBankingConfigurationFinTSDTO()
{
Name = "FINTS Testkonfiguration 1",
Description = "Das ist eine erste Testkonfiguration für HBCI",
BranchI3D = null,
CreatedByEmployeeI3D = user.UserI3D ?? 0,
CreatedDate = DateTime.Now,
CreatedVersion = "2310",
ChangedByEmployeeI3D = user.UserI3D ?? 0,
ChangedDate = DateTime.Now,
ChangedVersion = "2309",
IsFavorite = true,
AccountHolder = "Axel Schweiß",
AccountNumber = "0123456789",
AccountIBAN = "DE57630901000123456789",
AccountUserId = "Axel",
AccountUserPassword = "Schweiß",
BankCode = "63090100",
BankBIC = "ULMVDE66XXX",
ServiceURL = "https://www.volksbank.de/hbci",
ServiceVersion = "4.1",
};
var fintsConfig2 = new OnlineBankingConfigurationFinTSDTO()
{
Name = "FINTS Testkonfiguration 2",
Description = "Das ist eine zweite Testkonfiguration für HBCI",
BranchI3D = null,
CreatedByEmployeeI3D = user.UserI3D ?? 0,
CreatedDate = DateTime.Now,
CreatedVersion = "2310",
ChangedByEmployeeI3D = user.UserI3D ?? 0,
ChangedDate = DateTime.Now,
ChangedVersion = "2309",
IsFavorite = false,
AccountHolder = "Dieter Dünnbiss",
AccountNumber = "402048",
AccountIBAN = "DE72654500700000402048",
AccountUserId = "Ellen",
AccountUserPassword = "Bogen",
BankCode = "65450070",
BankBIC = "SBCRDE66XXX",
ServiceURL = "https://www.ksk-biberach.de/hbci",
ServiceVersion = "4.0",
};
var savedHbciConfig1 = onlineBankingConfigurationBL.SaveOnlineBankingConfiguration(fintsConfig1, user).ThrowIfError();
var savedHbciConfig2 = onlineBankingConfigurationBL.SaveOnlineBankingConfiguration(fintsConfig2, user).ThrowIfError();
this._finTSConfigurations.Add(savedHbciConfig1);
this._finTSConfigurations.Add(savedHbciConfig2);
}
private void CreateSpreadsheetOnlineBankingConfigurations()
{
using var session = new BLSession();
var onlineBankingBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
var user = this.GetLoggedInUser();
var spreadsheetConfig1 = new OnlineBankingConfigurationSpreadsheetDTO()
{
Name = "Spreadsheet (EXCEL) Testkonfiguration 1",
Description = "Das ist eine erste Testkonfiguration für EXCEL",
BranchI3D = null,
CreatedByEmployeeI3D = user.UserI3D ?? 0,
CreatedDate = DateTime.Now,
CreatedVersion = "2310",
ChangedByEmployeeI3D = user.UserI3D ?? 0,
ChangedDate = DateTime.Now,
ChangedVersion = "2309",
IsFavorite = true,
FileType = SpreadsheetFileType.EXCEL
};
var spreadsheetConfig2 = new OnlineBankingConfigurationSpreadsheetDTO()
{
Name = "Spreadsheet (CSV) Testkonfiguration 1",
Description = "Das ist eine erste Testkonfiguration für CSV",
BranchI3D = null,
CreatedByEmployeeI3D = user.UserI3D ?? 0,
CreatedDate = DateTime.Now,
CreatedVersion = "2310",
ChangedByEmployeeI3D = user.UserI3D ?? 0,
ChangedDate = DateTime.Now,
ChangedVersion = "2309",
IsFavorite = false,
FileType = SpreadsheetFileType.CSV
};
var savedSpreadsheetConfig1 = onlineBankingBL.SaveOnlineBankingConfiguration(spreadsheetConfig1, user).ThrowIfError();
var savedSpreadsheetConfig2 = onlineBankingBL.SaveOnlineBankingConfiguration(spreadsheetConfig2, user).ThrowIfError();
this._spreadsheetConfigurations.Add(savedSpreadsheetConfig1);
this._spreadsheetConfigurations.Add(savedSpreadsheetConfig2);
}
private void LoadFinTSOnlineBankingConfigurations()
{
using var session = new BLSession();
var onlineBankingConfigurationBL = session.GetBL<OnlineBankingConfigurationWebServiceBL>();
var user = this.GetLoggedInUser();
var filter1 = new OnlineBankingConfigurationsFilter() { ConfigurationType = OnlineBankingConfigurationType.SERVICE_FINTS };
var result1 = onlineBankingConfigurationBL.GetOnlineBankingConfigurationsByFilter(filter1, isUnitTest: true).ThrowIfError();
var filter2 = new OnlineBankingConfigurationsFilter() { I3Ds = this._spreadsheetConfigurations.Select(f => f.I3D).ToList() };
var result2 = onlineBankingConfigurationBL.GetOnlineBankingConfigurationsByFilter(filter2, isUnitTest: true).ThrowIfError();
}
}
}