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 50a63b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 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
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 50a63b5

Please sign in to comment.