-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: OR-1992 rename contactgegeven.type to contactgegeven.contactgeg…
…eventype
- Loading branch information
Erik Talboom
committed
Nov 24, 2023
1 parent
9be98a1
commit 1cb71f3
Showing
90 changed files
with
1,140 additions
and
1,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 14 additions & 11 deletions
25
...tactgegevens/FeitelijkeVereniging/VoegContactGegevenToe/VoegContactGegevenToeValidator.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
namespace AssociationRegistry.Admin.Api.Verenigingen.Contactgegevens.FeitelijkeVereniging.VoegContactGegevenToe; | ||
|
||
using Infrastructure.Validation; | ||
using Vereniging; | ||
using FluentValidation; | ||
using Infrastructure.Validation; | ||
using RequestsModels; | ||
using Vereniging; | ||
|
||
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract | ||
public class VoegContactgegevenToeValidator : AbstractValidator<VoegContactgegevenToeRequest> | ||
{ | ||
public VoegContactgegevenToeValidator() | ||
{ | ||
RuleFor(request => request.Contactgegeven).NotNull() | ||
.WithMessage("'Contactgegeven' is verplicht."); | ||
.WithMessage("'Contactgegeven' is verplicht."); | ||
|
||
When( | ||
request => request.Contactgegeven is not null, | ||
() => this.RequireNotNullOrEmpty(request => request.Contactgegeven.Waarde) | ||
predicate: request => request.Contactgegeven is not null, | ||
action: () => this.RequireNotNullOrEmpty(request => request.Contactgegeven.Waarde) | ||
); | ||
|
||
When( | ||
request => request.Contactgegeven is not null, | ||
() => this.RequireNotNullOrEmpty(request => request.Contactgegeven.Type) | ||
predicate: request => request.Contactgegeven is not null, | ||
action: () => this.RequireNotNullOrEmpty(request => request.Contactgegeven.Type) | ||
); | ||
|
||
When( | ||
request => request.Contactgegeven is not null && !string.IsNullOrEmpty(request.Contactgegeven.Type), | ||
() => RuleFor(request => request.Contactgegeven.Type) | ||
.Must(ContactgegevenType.CanParse) | ||
.WithMessage(t => $"De waarde '{t.Contactgegeven.Type}' is geen gekend contactgegeven type.") | ||
predicate: request => request.Contactgegeven is not null && !string.IsNullOrEmpty(request.Contactgegeven.Type), | ||
action: () => RuleFor(request => request.Contactgegeven.Type) | ||
.Must(Contactgegeventype.CanParse) | ||
.WithMessage(t => $"De waarde '{t.Contactgegeven.Type}' is geen gekend contactgegeven type.") | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.