dynamic reports

This commit is contained in:
Kukks
2023-11-10 12:40:08 +01:00
parent 9e8d694209
commit b77fa3307e
12 changed files with 775 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using BTCPayServer.Abstractions.Contracts;
using BTCPayServer.Abstractions.Models;
using BTCPayServer.Abstractions.Services;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace BTCPayServer.Plugins.DynamicReports;
public class DynamicReportsPlugin : BaseBTCPayServerPlugin
{
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
{
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.11.7" }
};
public override void Execute(IServiceCollection applicationBuilder)
{
applicationBuilder.AddSingleton<DynamicReportService>();
applicationBuilder.AddReportProvider<LegacyInvoiceExportReportProvider>();
applicationBuilder.AddSingleton<IHostedService>(provider => provider.GetRequiredService<DynamicReportService>());
applicationBuilder.AddSingleton<IUIExtension>(new UIExtension("DynamicReportsPlugin/Nav",
"server-nav"));
base.Execute(applicationBuilder);
}
}