From 50a63b50b3a288876c31ba241ff5744d24b85b98 Mon Sep 17 00:00:00 2001 From: Arne Dumarey Date: Tue, 14 Jan 2025 15:58:47 +0100 Subject: [PATCH] fix(import-api): correct validation merger year --- .../Merger/Propose/ProposeMergersRequestValidator.cs | 2 +- .../Infrastructure/Modules/ProducerModule.cs | 2 ++ .../ImportApi/Merger/Propose/WhenProposingMerger.cs | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/MunicipalityRegistry.Api.Import/Merger/Propose/ProposeMergersRequestValidator.cs b/src/MunicipalityRegistry.Api.Import/Merger/Propose/ProposeMergersRequestValidator.cs index a9a45c66..ff20485f 100644 --- a/src/MunicipalityRegistry.Api.Import/Merger/Propose/ProposeMergersRequestValidator.cs +++ b/src/MunicipalityRegistry.Api.Import/Merger/Propose/ProposeMergersRequestValidator.cs @@ -10,7 +10,7 @@ public sealed class ProposeMergersRequestValidator : AbstractValidator request.MergerYear) - .GreaterThan(DateTime.Now.Year) + .GreaterThanOrEqualTo(DateTime.Now.Year) .DependentRules(() => { RuleFor(request => request.MergerYear) diff --git a/src/MunicipalityRegistry.Producer.Snapshot.Oslo/Infrastructure/Modules/ProducerModule.cs b/src/MunicipalityRegistry.Producer.Snapshot.Oslo/Infrastructure/Modules/ProducerModule.cs index bef8dd42..cb20a45b 100644 --- a/src/MunicipalityRegistry.Producer.Snapshot.Oslo/Infrastructure/Modules/ProducerModule.cs +++ b/src/MunicipalityRegistry.Producer.Snapshot.Oslo/Infrastructure/Modules/ProducerModule.cs @@ -59,6 +59,8 @@ private void RegisterProjectionSetup(ContainerBuilder builder) .RegisterEventstreamModule(_configuration) .RegisterModule(new ProjectorModule(_configuration)); + _services.AddOsloProxy(_configuration["OsloApiUrl"]); + RegisterProjections(builder); } diff --git a/test/MunicipalityRegistry.Tests/ImportApi/Merger/Propose/WhenProposingMerger.cs b/test/MunicipalityRegistry.Tests/ImportApi/Merger/Propose/WhenProposingMerger.cs index 8d2ab1fa..294b0cc9 100644 --- a/test/MunicipalityRegistry.Tests/ImportApi/Merger/Propose/WhenProposingMerger.cs +++ b/test/MunicipalityRegistry.Tests/ImportApi/Merger/Propose/WhenProposingMerger.cs @@ -63,7 +63,7 @@ public async Task GivenValidRequestWithNewDestinationMunicipality_ThenMunicipali var request = new ProposeMergersRequest { - MergerYear = 2025, + MergerYear = DateTime.Now.Year + 1, Municipalities = [ new ProposeMergerRequest @@ -147,7 +147,7 @@ public async Task GivenValidRequestWithExistingDestinationMunicipality_ThenMunic var request = new ProposeMergersRequest { - MergerYear = 2025, + MergerYear = DateTime.Now.Year + 1, Municipalities = [ new ProposeMergerRequest