AccountingNext/Schaad.Accounting.UI/Extensions.cs
Claudio Schaad 1a3d93e0e3 Remove dead and unused code
- CSS: drop the Bootstrap template leftovers (NavMenu.razor.css, most of
  MainLayout.razor.css, button/form rules in app.css) and the copied
  Fluent demo rules in BankTransactions.razor.css.
- Bootstrap: keep only bootstrap.min.css (+ map); 42 unused files removed.
- Credit-card statement import, never wired into the Blazor UI: service
  methods, GetCreditCardStatementPath, DI registrations for
  ICreditCardStatementService/IPdfParsingService, FreeSpire.PDF.
- CSV export (GetTransactionListCsvAsync), only called from tests.
- Split predefinitions: model, repository and the JSON editor entry.
- Unused members: TrySetYear, GetUploadPath (+ DataFolders.Uploads),
  GetClasses; unused usings, fields and parameters.
- Home.razor.css -> PendingBookings.razor.css: the pending-bookings table
  moved there in "PR U-10" and had lost its styling since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:46:08 +01:00

42 lines
2.1 KiB
C#

using Schaad.Accounting.Interfaces;
using Schaad.Accounting.Repositories;
using Schaad.Accounting.Services;
using Schaad.Finance.Api;
using Schaad.Finance.Services;
namespace Schaad.Accounting.UI
{
public static class Extensions
{
public static IServiceCollection AddAccounting(this IServiceCollection services)
{
// Singleton because MyHeader triggers a full page reload (forceLoad: true) after
// changing year/mandator; a Scoped instance would be recreated on the new circuit
// and lose the selection. TODO: persist selection to a cookie/query string so this
// can safely become Scoped.
services.AddSingleton<ISettingsService, SettingsService>();
services.AddScoped<RepositoryCache>();
services.AddScoped<IAccountRepository, AccountRepository>();
services.AddScoped<IBankTransactionRepository, BankTransactionRepository>();
services.AddScoped<IBookingRuleRepository, BookingRuleRepository>();
services.AddScoped<IBookingTextRepository, BookingTextRepository>();
services.AddScoped<IElectricityBillRepository, ElectricityBillRepository>();
services.AddScoped<IWaterBillRepository, WaterBillRepository>();
services.AddScoped<ISubclassRepository, SubclassRepository>();
services.AddScoped<ITransactionRepository, TransactionRepository>();
services.AddScoped<IMultiYearRepository, MultiYearRepository>();
services.AddScoped<IRawDataRepository, RawDataRepository>();
services.AddScoped<IChartService, ChartService>();
services.AddScoped<IAnalyticsService, AnalyticsService>();
services.AddScoped<IViewService, ViewService>();
services.AddScoped<IFileService, FileService>();
services.AddScoped<IAccountStatementService, AccountStatementService>();
services.AddSingleton<IFxService, DummyFxService>();
services.AddScoped<IFxConverter, FxConverter>();
return services;
}
}
}