- Consolidate decimal.ToFormattedString into Schaad.Accounting.Formatting - Rename EnsureFileExisits -> EnsureFileExists and SplitPredefiniton* -> SplitPredefinition* (class, interface, files, DI reg) - AccountRepository: single-save year-rollover start-balance seed - Drop legacy .NET Standard packages redundant on net9.0 and the stale Interfaces\Extensions\ folder entry - Set culture via RequestLocalizationOptions middleware - Plan: item 9 (unit of work) split off into a dedicated PR D Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
38 lines
1.8 KiB
C#
38 lines
1.8 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 (see IMPROVEMENT_PLAN.md).
|
|
services.AddSingleton<ISettingsService, SettingsService>();
|
|
|
|
services.AddScoped<IAccountRepository, AccountRepository>();
|
|
services.AddScoped<IBankTransactionRepository, BankTransactionRepository>();
|
|
services.AddScoped<IBookingRuleRepository, BookingRuleRepository>();
|
|
services.AddScoped<IBookingTextRepository, BookingTextRepository>();
|
|
services.AddScoped<ISplitPredefinitionRepository, SplitPredefinitionRepository>();
|
|
services.AddScoped<ISubclassRepository, SubclassRepository>();
|
|
services.AddScoped<ITransactionRepository, TransactionRepository>();
|
|
|
|
services.AddScoped<IChartService, ChartService>();
|
|
services.AddScoped<IViewService, ViewService>();
|
|
services.AddScoped<IFileService, FileService>();
|
|
services.AddScoped<IAccountStatementService, AccountStatementService>();
|
|
services.AddScoped<ICreditCardStatementService, CreditCardStatementService>();
|
|
services.AddSingleton<IFxService, DummyFxService>();
|
|
services.AddSingleton<IPdfParsingService, PdfParsingService>();
|
|
|
|
return services;
|
|
}
|
|
}
|
|
}
|