using Schaad.Accounting.Datasets; using Schaad.Accounting.Interfaces; using Schaad.Finance.Api; namespace Schaad.Accounting.Services { public class FxConverter : IFxConverter { private readonly IFxService fxService; private readonly SettingsDataset settings; public FxConverter(IFxService fxService, SettingsDataset settings) { this.fxService = fxService; this.settings = settings; } public decimal ConvertToChf(decimal amount, string fromCurrency) => fxService.ConvertCurrency(amount, fromCurrency, "CHF", settings.FixerIoApiKey); } }