Skip to content

Commit

Permalink
Refactoring Web -> Bot project (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
danilbrenner authored Dec 4, 2024
1 parent 6a6618b commit 9515d65
Show file tree
Hide file tree
Showing 19 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Bw.VaultDigest.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A7F1BBFA-321
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FBEA0FE3-3679-47B8-BAC0-F8EB6C89C207}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bw.VaultDigest.Web", "src\Bw.VaultDigest.Web\Bw.VaultDigest.Web.csproj", "{50807D46-15B1-43A4-827D-65F0582739B5}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bw.VaultDigest.Bot", "src\Bw.VaultDigest.Bot\Bw.VaultDigest.Bot.csproj", "{50807D46-15B1-43A4-827D-65F0582739B5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bw.VaultDigest.UnitTests", "tests\Bw.VaultDigest.UnitTests\Bw.VaultDigest.UnitTests.csproj", "{7A62018F-0504-43A3-B24E-4C8188E1A3A4}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Bw.VaultDigest.Web;
namespace Bw.VaultDigest.Bot;

public static class ApplicationBuilderExtensions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Bw.VaultDigest.Bot.Options;
using Bw.VaultDigest.Bot.Requests;
using Bw.VaultDigest.Data.Abstractions;
using Bw.VaultDigest.Infrastructure.Abstractions;
using Bw.VaultDigest.Telemetry;
using Bw.VaultDigest.Web.Options;
using Bw.VaultDigest.Web.Requests;
using MediatR;
using Microsoft.Extensions.Options;

namespace Bw.VaultDigest.Web.Handlers;
namespace Bw.VaultDigest.Bot.Handlers;

public class SendDigestEmailHandler(
MetricsFactory metricsFactory,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Bw.VaultDigest.Bot.Requests;
using Bw.VaultDigest.Data.Abstractions;
using Bw.VaultDigest.Infrastructure;
using Bw.VaultDigest.Infrastructure.Abstractions;
using Bw.VaultDigest.Telemetry;
using Bw.VaultDigest.Web.Requests;
using MediatR;

namespace Bw.VaultDigest.Web.Handlers;
namespace Bw.VaultDigest.Bot.Handlers;

public class SyncLoginsHandler(
ILogger<SyncLoginsHandler> logger,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using NCrontab;

namespace Bw.VaultDigest.Web.HostedServices;
namespace Bw.VaultDigest.Bot.HostedServices;

public abstract class ScheduledServiceBase(CrontabSchedule cron, bool skipOnStartup, ILogger logger) : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Bw.VaultDigest.Web.Options;
using Bw.VaultDigest.Web.Requests;
using Bw.VaultDigest.Bot.Options;
using Bw.VaultDigest.Bot.Requests;
using MediatR;
using Microsoft.Extensions.Options;
using NCrontab;

namespace Bw.VaultDigest.Web.HostedServices;
namespace Bw.VaultDigest.Bot.HostedServices;

public class SendDigestService(ILogger<SendDigestService> logger, IOptions<ScheduleOptions> options, IMediator mediator)
: ScheduledServiceBase(CrontabSchedule.Parse(options.Value.SendDigest), true, logger)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Bw.VaultDigest.Web.Options;
using Bw.VaultDigest.Web.Requests;
using Bw.VaultDigest.Bot.Options;
using Bw.VaultDigest.Bot.Requests;
using MediatR;
using Microsoft.Extensions.Options;
using NCrontab;

namespace Bw.VaultDigest.Web.HostedServices;
namespace Bw.VaultDigest.Bot.HostedServices;

public class SyncService(ILogger<SyncService> logger, IOptions<ScheduleOptions> options, IMediator mediator)
: ScheduledServiceBase(CrontabSchedule.Parse(options.Value.SyncLogins), true, logger)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Bw.VaultDigest.Web.Options;
namespace Bw.VaultDigest.Bot.Options;

public class EmailContentOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Bw.VaultDigest.Web.Options;
namespace Bw.VaultDigest.Bot.Options;

public class ScheduleOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using Bw.VaultDigest.Data;
using Bw.VaultDigest.Infrastructure;
using Bw.VaultDigest.Web;
using Bw.VaultDigest.Web.Options;
using Bw.VaultDigest.Bot;
using Bw.VaultDigest.Bot.Options;
using Bw.VaultDigest.Telemetry;
using Bw.VaultDigest.Web.HostedServices;
using Bw.VaultDigest.Bot.HostedServices;
using Serilog;

Log.Logger = new LoggerConfiguration()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
"Local": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Local"
}
},
"Production": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": false,
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Production"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Bw.VaultDigest.Model;
using MediatR;

namespace Bw.VaultDigest.Web.Requests;
namespace Bw.VaultDigest.Bot.Requests;

public record SyncLoginsCommand : IRequest;
public record SendDigestCommand : IRequest;
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Bw.VaultDigest.Common\Bw.VaultDigest.Common.csproj"/>
<ProjectReference Include="..\..\src\Bw.VaultDigest.Infrastructure\Bw.VaultDigest.Infrastructure.csproj"/>
<ProjectReference Include="..\..\src\Bw.VaultDigest.Web\Bw.VaultDigest.Web.csproj" />
<ProjectReference Include="..\..\src\Bw.VaultDigest.Bot\Bw.VaultDigest.Bot.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AutoFixture;
using Bw.VaultDigest.Infrastructure.EmailNotifierClient;
using Bw.VaultDigest.Model;
using Bw.VaultDigest.Web.Handlers;
using Bw.VaultDigest.Bot.Handlers;
using ScottPlot;

namespace Bw.VaultDigest.UnitTests.Services;
Expand Down

0 comments on commit 9515d65

Please sign in to comment.