feat: Add OfacFileService

- Add initial OfacFileService including deps
- Added Moq and MockHttp as dependencies
  for testing
This commit is contained in:
Stevan Freeborn
2024-08-12 09:41:59 -05:00
parent 24aa6ff35c
commit 1af9c7012c
6 changed files with 101 additions and 1 deletions
@@ -23,6 +23,7 @@
<ItemGroup>
<InternalsVisibleTo Include="$(AssemblyName).Tests" />
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
</ItemGroup>
</Project>
@@ -0,0 +1,29 @@
namespace SanctionsSearch.Worker.Services;
interface IOfacFileService
{
}
class OfacFileService(
HttpClient client,
ILogger<OfacFileService> logger,
IOptionsSnapshot<OfacFileServiceOptions> options
) : IOfacFileService
{
private readonly HttpClient _client = client ?? throw new ArgumentNullException(nameof(client));
private readonly ILogger<OfacFileService> _logger = logger ?? throw new ArgumentNullException(nameof(logger));
private readonly OfacFileServiceOptions _options = options?.Value ?? throw new ArgumentNullException(nameof(options));
}
class OfacFileServiceOptions
{
public string Url { get; set; } = string.Empty;
public string SdnFileName { get; set; } = string.Empty;
public string AddressFileName { get; set; } = string.Empty;
public string AltNamesFileName { get; set; } = string.Empty;
public string CommentsFileName { get; set; } = string.Empty;
public string ConPrimaryNameFileName { get; set; } = string.Empty;
public string ConAddressesFileName { get; set; } = string.Empty;
public string ConAltNamesFileName { get; set; } = string.Empty;
public string ConCommentsFileName { get; set; } = string.Empty;
}
+1
View File
@@ -2,3 +2,4 @@ global using SanctionsSearch.Worker;
global using Serilog;
global using Serilog.Formatting.Compact;
global using Serilog.Exceptions;
global using Microsoft.Extensions.Options;