AccountingNext/Schaad.Accounting.UI/Extensions.cs
Claudio Schaad eefbfff3eb Add "Wasser" page for the water bills (#11)
Co-authored-by: Claudio Schaad <c.schaad@pog.ch>
Co-committed-by: Claudio Schaad <c.schaad@pog.ch>
2026-10-30 20:19:07 +00:00

45 lines
2.3 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<ISplitPredefinitionRepository, SplitPredefinitionRepository>();
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.AddScoped<ICreditCardStatementService, CreditCardStatementService>();
services.AddSingleton<IFxService, DummyFxService>();
services.AddScoped<IFxConverter, FxConverter>();
services.AddSingleton<IPdfParsingService, PdfParsingService>();
return services;
}
}
}