Skip to content

Commit

Permalink
fix(import-api): correct validation merger year
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneD committed Jan 16, 2025
1 parent 7ba3a08 commit 760a4c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed class ProposeMergersRequestValidator : AbstractValidator<ProposeMe
public ProposeMergersRequestValidator(LegacyContext legacyContext, ImportContext importContext)
{
RuleFor(request => request.MergerYear)
.GreaterThan(DateTime.Now.Year)
.GreaterThanOrEqualTo(DateTime.Now.Year)
.DependentRules(() =>
{
RuleFor(request => request.MergerYear)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ private void RegisterProjectionSetup(ContainerBuilder builder)
.RegisterEventstreamModule(_configuration)
.RegisterModule(new ProjectorModule(_configuration));

_services.AddOsloProxy(_configuration["OsloApiUrl"]);

RegisterProjections(builder);
}

Expand Down
4 changes: 2 additions & 2 deletions src/MunicipalityRegistry.Producer/Infrastructure/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static async Task Main(string[] args)
AppDomain.CurrentDomain.UnhandledException += (_, eventArgs) =>
Log.Fatal((Exception)eventArgs.ExceptionObject, "Encountered a fatal exception, exiting program.");

Log.Information("Initializing ParcelRegistry.Producer");
Log.Information("Initializing MunicipalityRegistry.Producer");

var host = new HostBuilder()
.ConfigureAppConfiguration((_, configurationBuilder) =>
Expand Down Expand Up @@ -120,7 +120,7 @@ public static async Task Main(string[] args)
.UseConsoleLifetime()
.Build();

Log.Information("Starting ParcelRegistry.Producer");
Log.Information("Starting MunicipalityRegistry.Producer");

var logger = host.Services.GetRequiredService<ILogger<Program>>();
var configuration = host.Services.GetRequiredService<IConfiguration>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task GivenValidRequestWithNewDestinationMunicipality_ThenMunicipali

var request = new ProposeMergersRequest
{
MergerYear = 2025,
MergerYear = DateTime.Now.Year + 1,
Municipalities =
[
new ProposeMergerRequest
Expand Down Expand Up @@ -147,7 +147,7 @@ public async Task GivenValidRequestWithExistingDestinationMunicipality_ThenMunic

var request = new ProposeMergersRequest
{
MergerYear = 2025,
MergerYear = DateTime.Now.Year + 1,
Municipalities =
[
new ProposeMergerRequest
Expand Down

0 comments on commit 760a4c2

Please sign in to comment.