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,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="JetBrains.Annotations" Version="2025.2.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.5.1" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="System.Data.SQLite" Version="1.0.119" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\src\backend\Centron.BL\Centron.BL.csproj" />
<ProjectReference Include="..\..\..\src\backend\Centron.DAO\Centron.DAO.csproj" />
<ProjectReference Include="..\..\..\src\backend\Centron.Entities\Centron.Entities.csproj" />
</ItemGroup>
</Project>
@@ -0,0 +1,145 @@
using Centron.DAO.Mappings.Accounts;
using Centron.DAO.Mappings.CustomerArea;
using Centron.DAO.UserTypes;
using Centron.Data.Entities.Accounts;
using Centron.Data.Entities.CustomerArea;
using Centron.Data.Entities.ObjectTypes;
using Centron.Data.Entities.Sales.Receipts;
using Centron.Interfaces.Accounts;
using Centron.Interfaces.CustomerArea;
using Centron.Interfaces.Sales.CustomerAssets;
using FluentNHibernate.Mapping;
namespace Centron.Tests.BL.DatabaseMappings
{
/// <summary>
/// <b>IMPORTANT</b>: This is a replacement class for the real <see cref="AccountCustomerMaps"/> class for running in-memory unit tests.
/// Make sure to keep this class in sync with the real class.
/// </summary>
public class AccountCustomerMapsForTest : ClassMap<AccountCustomer>
{
public AccountCustomerMapsForTest()
{
Table("AccountCustomers");
Id(m => m.I3D).Column("I3D");
Map(m => m.BookKeepingExportDate).Column("BookKeepingExportDate").Nullable();
Map(m => m.Number).Column("Number");
Map(m => m.ReceiptConditionOfferI3D).Column("ReceiptConditionOfferI3D").Nullable();
Map(m => m.ReceiptConditionOrderI3D).Column("ReceiptConditionOrderI3D").Nullable();
Map(m => m.ReceiptConditionDeliveryListI3D).Column("ReceiptConditionDeliveryListI3D").Nullable();
Map(m => m.ReceiptConditionPickupListI3D).Column("ReceiptConditionPickupListI3D").Nullable();
Map(m => m.InvoiceDeliveryKind).Column("InvoiceDeliveryKind").Nullable();
Map(m => m.AlternativeInvoiceMailRecipientI3D).Column("AlternativeInvoiceMailRecipientI3D").Nullable();
Map(m => m.SalesControllingI3D).Column("SalesControllingI3D").Nullable();
Map(m => m.RootDirI3D).Column("RootDirI3D").Nullable();
Map(m => m.AlternativeDeliveryAddressContactI3D).Column("AlternativeDeliveryAddressContactI3D").Nullable();
Map(m => m.ClassificationI3D).Column("ClassificationI3D").Nullable();
Map(m => m.BookKeepingExportEmployeeI3D).Column("BookKeepingExportEmployeeI3D").Nullable();
Map(m => m.SpecialAgreementI3D).Column("SpecialAgreementI3D").Nullable();
Map(m => m.WarehouseI3D).Column("WarehouseI3D").Nullable();
Map(m => m.PriceListFromDistributorI3D).Column("PriceListFromDistributorI3D").Nullable();
Map(m => m.LockOrderAfterDunningLevel).Column("LockOrderAfterDunningLevel").Nullable();
Map(m => m.AlternativeInvoiceAccountI3D).Column("AlternativeInvoiceAccountI3D").Nullable();
Map(m => m.AlternativeInvoiceAddressI3D).Column("AlternativeInvoiceAddressI3D").Nullable();
Map(m => m.AlternativeInvoiceAddressContactI3D).Column("AlternativeInvoiceAddressContactI3D").Nullable();
Map(m => m.AlternativeDeliveryAccountI3D).Column("AlternativeDeliveryAccountI3D").Nullable();
Map(m => m.AlternativeDeliveryAddressI3D).Column("AlternativeDeliveryAddressI3D").Nullable();
Map(m => m.PriceList).Column("PriceList").Nullable();
Map(m => m.DunningLetterRecipientPersonI3D).Column("DunningLetterRecipientPersonI3D").Nullable();
Map(m => m.DunningLetterUseAlternativeInvoiceAddress).Column("DunningLetterUseAlternativeInvoiceAddress").Not.Nullable();
Map(m => m.DunningLetterAfterDays1).Column("DunningLetterAfterDays1").Nullable();
Map(m => m.DunningLetterAfterDays2).Column("DunningLetterAfterDays2").Nullable();
Map(m => m.DunningLetterAfterDays3).Column("DunningLetterAfterDays3").Nullable();
Map(m => m.ReceiptConditionInvoiceI3D).Column("ReceiptConditionInvoiceI3D").Nullable();
Map(m => m.ReceiptConditionCreditVoucherI3D).Column("ReceiptConditionCreditVoucherI3D").Nullable();
Map(m => m.ReceiptConditionDeliveryI3D).Column("ReceiptConditionDeliveryI3D").Nullable();
Map(m => m.ReceiptConditionDeliveryOfferI3D).Column("ReceiptConditionDeliveryOfferI3D").Nullable();
Map(m => m.ReceiptConditionDeliveryOrderI3D).Column("ReceiptConditionDeliveryOrderI3D").Nullable();
Map(m => m.LimitCalculationKind).Column("LimitCalculationKind").Nullable();
//Map(m => m.IsAccountKind1).Column("IsAccountKind1");
//Map(m => m.IsAccountKind2).Column("IsAccountKind2");
//Map(m => m.IsAccountKind3).Column("IsAccountKind3");
//Map(m => m.IsAccountKind4).Column("IsAccountKind4");
//Map(m => m.IsAccountKind5).Column("IsAccountKind5");
Map(m => m.IsPurchaseOrderNumberRequired).Column("IsPurchaseOrderNumberRequired");
Map(m => m.PrintProductionConfiguration).Column("PrintProductionConfiguration");
Map(m => m.ShippingCostsDeaktivated).Column("ShippingCostsDeaktivated");
Map(m => m.HasTicketApproval).Column("HasTicketApproval").Nullable();
Map(m => m.IsExclusiveOfVAT).Column("IsExclusiveOfVAT");
Map(m => m.IsBookKeepingExportDone).Column("IsBookKeepingExportDone");
Map(m => m.IsBookKeepingExportDeaktivated).Column("IsBookKeepingExportDeaktivated");
Map(m => m.IsProjectNumberRequired).Column("IsProjectNumberRequired");
Map(m => m.IsDiscountTextVisibilityDeaktivated).Column("IsDiscountTextVisibilityDeaktivated");
Map(m => m.IsProductionConfigurationMandatory).Column("IsProductionConfigurationMandatory");
Map(m => m.Discount).Column("Discount");
// IMPORTANT: This is the problematic column that causes a syntax error in the SQLite in-memory database.
// The original name of the column is 'Limit' which is a reserved keyword in SQLite.
// This is changed here for 'CreditLimit' to avoid the syntax error.
Map(m => m.Limit).Column("CreditLimit");
Map(m => m.ExtraChargeRetailPrice).Column("ExtraChargeRetailPrice");
Map(m => m.BookKeepingNumber).Column("BookKeepingNumber").Length(64);
Map(m => m.DeliveryText).Column("DeliveryText").Length(500).Nullable();
Map(m => m.DunningLetterKind).Column("DunningLetterKind").Length(50).Nullable();
Map(m => m.AlternativeInvoiceReceiver).Column("AlternativeInvoiceReceiver").Length(500).Nullable();
Map(m => m.AlternativeDeliveryReceiver).Column("AlternativeDeliveryReceiver").Length(500).Nullable();
Map(m => m.CommentOffer).Column("CommentOffer").Length(int.MaxValue).Nullable();
Map(m => m.BookKeepingCollectionAccount).Column("BookKeepingCollectionAccount").Length(24).Nullable();
Map(m => m.ProductRecipientNumber).Column("ProductRecipientNumber").Length(50).Nullable();
Map(m => m.MailNotificationAtHelpdeskCC).Column("MailNotificationAtHelpdeskCC").Length(255).Nullable();
Map(m => m.MailNotificationAtHelpdeskBCC).Column("MailNotificationAtHelpdeskBCC").Length(255).Nullable();
Map(m => m.CommentOrder).Column("CommentOrder").Length(int.MaxValue).Nullable();
Map(m => m.CommentDeliveryList).Column("CommentDeliveryList").Length(int.MaxValue).Nullable();
Map(m => m.CommentPickupList).Column("CommentPickupList").Length(int.MaxValue).Nullable();
Map(m => m.CommentInvoice).Column("CommentInvoice").Length(int.MaxValue).Nullable();
Map(m => m.CommentCreditVoucher).Column("CommentCreditVoucher").Length(int.MaxValue).Nullable();
Map(m => m.CommentHelpdesk).Column("CommentHelpdesk").Length(int.MaxValue).Nullable();
Map(m => m.DeliveryOption).Column("DeliveryOption").CustomType<DeliveryOption>().Nullable();
Map(m => m.CountServer).Column("CountServer").Nullable();
Map(m => m.CountPc).Column("CountPc").Nullable();
Map(m => m.ServerManufacturor).Column("ServerManufacturor").Length(80).Nullable();
Map(m => m.PcManufacturor).Column("PcManufacturor").Length(80).Nullable();
Map(m => m.PrinterManufacturor).Column("PrinterManufacturor").Length(80).Nullable();
Map(m => m.AcquisionComplete).Column("AcquisionComplete").Nullable();
Map(m => m.AcquisionImportant).Column("AcquisionImportant").Nullable();
Map(m => m.Vip).Column("Vip").Nullable();
Map(m => m.AdditionalInformation).Column("AdditionalInformation").Length(int.MaxValue).Nullable();
Map(m => m.BoughtByThusFar).Column("BoughtByThusFar").Length(80).Nullable();
Map(m => m.CrmText1).Column("CrmText1").Length(100).Nullable();
Map(m => m.CrmText2).Column("CrmText2").Length(100).Nullable();
Map(m => m.CrmText3).Column("CrmText3").Length(100).Nullable();
Map(m => m.CrmText4).Column("CrmText4").Length(100).Nullable();
Map(m => m.CrmText5).Column("CrmText5").Length(100).Nullable();
Map(m => m.CrmText6).Column("CrmText6").Length(100).Nullable();
Map(m => m.AcquisionFreeDate1).Column("AcquisionFreeDate1").Nullable();
Map(m => m.AcquisionFreeDate2).Column("AcquisionFreeDate2").Nullable();
Map(m => m.CoreDataComplete).Column("CoreDataComplete").Nullable();
Map(m => m.RiverbirdMsp).Column("RiverbirdMsp").Length(32).Nullable();
Map(m => m.HelpdeskClosingDontNotifyCustomer).Column("HelpdeskClosingDontNotifyCustomer").Nullable();
Map(m => m.ExportZUGFeRDDocument).Column("ExportZUGFeRDDocument").Nullable();
Map(m => m.LeitwegID).Column("LeitwegID").Length(50).Nullable();
Map(m => m.OwnSupplierNumber).Column("OwnSupplierNumber").Length(20).Nullable();
Map(m => m.ProvisionSchemaI3D).Column("ProvisionSchemaI3D").Nullable();
Map(m => m.CanSeeTicketsSBO).Column("CanSeeTicketsSBO").Not.Nullable();
Map(m => m.TicketsVisibleFromDateSBO).Column("TicketsVisibleFromDateSBO").Nullable();
Map(m => m.CustomerApprovalEnabledSBO).Column("CustomerApprovalEnabledSBO").Not.Nullable();
Map(m => m.DunningStop).Column("DunningStop").Nullable();
Map(m => m.DunningStopBegin).Column("DunningStopBegin").Nullable();
Map(m => m.DunningStopEnd).Column("DunningStopEnd").Nullable();
Map(m => m.DunningInfo).Column("DunningInfo").Length(int.MaxValue).Nullable();
Map(m => m.RiverbirdCustomerReference).Column("RiverbirdCustomerReference").Nullable();
Map(m => m.TelekomDiveCustomerNote).Column("TelekomDiveCustomerNote").Length(300).Nullable();
Map(m => m.ShowTelekomDiveCustomerNote).Column("ShowTelekomDiveCustomerNote").Nullable();
Map(m => m.MandatorBank).Column("MandatorBank").Nullable();
References<ReceiptReceiver>(f => f.ReceiptReceiverDelivery).Column("ReceiptReceiverDeliveryI3D").Nullable().Fetch.Join().Cascade.All();
References<ReceiptReceiver>(f => f.ReceiptReceiverInvoice).Column("ReceiptReceiverInvoiceI3D").Nullable().Fetch.Join().Cascade.All();
}
}
}
@@ -0,0 +1,116 @@
using Centron.BusinessLogic.WebServices;
using Centron.DAO.Mappings.Accounts;
using Centron.DAO.Mappings.Sales.Receipts;
using Centron.Data.Entities.Accounts;
using Centron.Data.Entities.Sales.Receipts;
using Centron.Tests.BL.DatabaseMappings;
using CentronSoftware.Centron.WebServices.Entities.Accounts;
using CentronSoftware.Centron.WebServices.Entities.Sales.Receipts.ReceiptReceiver;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using JetBrains.Annotations;
using NHibernate;
using NHibernate.Tool.hbm2ddl;
namespace Centron.Tests.DAO.Mappings.Accounts;
[TestSubject(typeof(AccountCustomerMaps))]
public class AccountCustomerMapsTest
{
[Fact]
public void ReceiptReceiverCanBeMapped()
{
var session = CreateSession();
var receipt = new AccountCustomer
{
I3D = 1,
Number = 2,
ReceiptReceiverDelivery = new ReceiptReceiver()
{
CompanyName = "Company",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "Street",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
},
ReceiptReceiverInvoice = new ReceiptReceiver()
{
CompanyName = "Company Invoice",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "Street Invoice",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
}
,
};
session.Save(receipt);
session.Flush();
var savedEntity = session.Get<AccountCustomer>(1);
Assert.NotNull(savedEntity);
var dto = ObjectMapper.Map<AccountCustomer, AccountCustomerDTO>(savedEntity);
Assert.NotNull(dto);
Assert.Equal("Company Invoice", dto.ReceiptReceiverInvoice.CompanyName);
var savedReceiptReceivers = session.Query<ReceiptReceiver>().ToList();
Assert.Equal(2, savedReceiptReceivers.Count);
dto.ReceiptReceiverDelivery = new ReceiptReceiverDTO()
{
CompanyName = "New Company Delivery",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "New Street Delivery",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
};
savedEntity.ReceiptReceiverDelivery = null;
savedEntity = ObjectMapper.Map(dto, savedEntity);
session.Save(savedEntity);
session.Flush();
var newSavedEntity = session.Get<AccountCustomer>(1);
Assert.NotNull(newSavedEntity);
dto = ObjectMapper.Map<AccountCustomer, AccountCustomerDTO>(newSavedEntity);
Assert.NotNull(dto);
Assert.Equal("New Company Delivery", dto.ReceiptReceiverDelivery.CompanyName);
savedReceiptReceivers = session.Query<ReceiptReceiver>().ToList();
Assert.Equal(3, savedReceiptReceivers.Count);
}
public ISession CreateSession()
{
var fluentConfiguration = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.FluentMappings.Add<AccountCustomerMapsForTest>())
.Mappings(m => m.FluentMappings.Add<ReceiptReceiverMaps>())
;
ISessionFactory sessionFactory = fluentConfiguration.BuildSessionFactory();
ISession session = sessionFactory.OpenSession();
new SchemaExport(fluentConfiguration.BuildConfiguration()).Execute(true, true, false, session.Connection, Console.Out);
return session;
}
}
@@ -0,0 +1,177 @@
using Centron.BusinessLogic.WebServices;
using Centron.DAO.Mappings.Sales.Receipts;
using Centron.DAO.Mappings.Sales.Receipts.Invoices;
using Centron.Data.Entities.Sales.Receipts;
using Centron.Data.Entities.Sales.Receipts.Invoices;
using Centron.Data.WebServices.Sales.Receipts.Invoices;
using Centron.Interfaces.Administration.Environment;
using Centron.Interfaces.Sales.Receipts;
using Centron.Interfaces.Sales.Receipts.Invoices;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Tool.hbm2ddl;
namespace Centron.Tests.DAO.Mappings.Sales.Receipts;
public class ReceiptBaseMapsTest
{
[Fact]
public void ReceiptReceiverCanBeMapped()
{
var session = CreateSession();
var receipt = new ReceiptInvoice()
{
I3D = 1,
CustomerI3D = 10,
Information = "Information",
ShowInformation = false,
IsCashAsset = false,
PurchaseOrderNumber = "12345",
AdditionalText = "Additional text",
ProjectNumber = "123456",
DeliveryConditionText = "",
PaymentConditionText = "",
DeliveryAddress = "Delivery address",
DeliveryAddressInformation = "",
InvoiceAddress = "Invoice address",
InvoiceAddressInformation = "",
LicenseeAddress = "Licensee address",
LicenseeAddressInformation = "",
IsPartialDeliveryPossible = false,
EsrAmount = "1",
EsrCodelineAmount = "1",
EsrReferenceNumber = "123",
IsFixed = false,
UsedAlternativeDeliveryAddress = false,
UsedAlternativeInvoiceAddress = false,
Provision = new List<ReceiptProvision>(),
PaidFC = 2,
ExternalInvoiceNumber = "345",
CurrencyFactorIsFixed = true,
CollectiveAccount = "Collective account",
TrackingNumber = "567",
TrackingNumberURL = "TrackURL",
Number = 2,
Date = DateTime.Now,
Version = 1,
State = ReceiptState.Active,
BranchOrigin = BranchOrigin.Creator,
CurrencyFactor = 1,
CurrencyString = "€",
ExclusiveOfVAT = false,
Receiver = "Receiver",
Phone = "12345",
Fax = "12345",
Email = "mail@a.com",
Street = "Street",
HasPostOfficeBox = false,
PostOfficeBox = "",
Zip = "12345",
City = "City",
ContactName = "Contact name",
CreatedThroughApplicationVersion = "2.0.2504.5",
ChangedThroughApplicationVersion = "",
ChangedThroughApplication = CreatedThroughApplication.WebServices,
ConcurrencyControlGuid = Guid.NewGuid(),
ReceiptReceiver = new ReceiptReceiver()
{
CompanyName = "Company",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "Street",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
},
ReceiptReceiverInvoice = new ReceiptReceiver()
{
CompanyName = "Company",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "Street Invoice",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
}
,
ReceiptReceiverLicense = new ReceiptReceiver()
{
CompanyName = "Company License",
Department = "Department",
ContactName = "Contact",
ContactDepartment = "C Department",
Street = "Street",
HouseNumber = "1",
Zip = "12345",
City = "City",
Country = "Country",
CountryI3D = 4,
PostOfficeBox = "",
HasPostOfficeBox = false,
AdditionalAddressSupplement = ""
}
};
session.Save(receipt);
session.Flush();
var savedEntity = session.Get<ReceiptInvoice>(1);
Assert.NotNull(savedEntity);
var dto = ObjectMapper.Map<IReceiptInvoice, ReceiptInvoiceDTO>(savedEntity);
Assert.NotNull(dto);
Assert.Equal("Company License", dto.ReceiptReceiverLicense.CompanyName);
var savedReceiptReceivers = session.Query<ReceiptReceiver>().ToList();
Assert.Equal(3, savedReceiptReceivers.Count);
}
public ISession CreateSession()
{
var fluentConfiguration = Fluently.Configure()
.Database(SQLiteConfiguration.Standard.InMemory)
.Mappings(m => m.FluentMappings.Add<ReceiptInvoiceMaps>())
.Mappings(m => m.FluentMappings.Add<ReceiptReceiverMaps>())
.Mappings(m => m.FluentMappings.Add<ReceiptInvoiceItemMaps>())
;
ISessionFactory sessionFactory = fluentConfiguration.BuildSessionFactory();
ISession session = sessionFactory.OpenSession();
new SchemaExport(fluentConfiguration.BuildConfiguration()).Execute(true, true, false, session.Connection, Console.Out);
return session;
}
}