-
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: add more logs for magda geefonderneming
- Loading branch information
1 parent
0329b32
commit 5ef5bbb
Showing
4 changed files
with
69 additions
and
31 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
23 changes: 15 additions & 8 deletions
23
src/AssociationRegistry.Admin.Api/Magda/MagdaResponseExtensions.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,24 +1,31 @@ | ||
namespace AssociationRegistry.Admin.Api.Magda; | ||
|
||
using System; | ||
using System.Linq; | ||
using AssociationRegistry.Magda.Models; | ||
using AssociationRegistry.Magda.Models.GeefOnderneming; | ||
using AssociationRegistry.Magda.Onderneming.GeefOnderneming; | ||
using System; | ||
using System.Linq; | ||
|
||
public static class MagdaResponseExtensions | ||
{ | ||
public static string ConcatenateUitzonderingen(this UitzonderingType[] source, string separator) | ||
public static string ConcatenateUitzonderingen( | ||
this UitzonderingType[] source, | ||
string separator, | ||
UitzonderingTypeType uitzonderingTypeType) | ||
=> string.Join( | ||
separator, | ||
source.Where(type => type.Type == UitzonderingTypeType.FOUT) | ||
.Select(type => type.Diagnose)); | ||
source.Where(type => type.Type == uitzonderingTypeType) | ||
.Select(type => $"{type.Identificatie} - {type.Diagnose} - {type.Omstandigheid}")); | ||
|
||
public static bool HasUitzonderingenOfType(this ResponseEnvelope<GeefOndernemingResponseBody>? source, UitzonderingTypeType uitzonderingTypeType) | ||
public static bool HasUitzonderingenOfType( | ||
this ResponseEnvelope<GeefOndernemingResponseBody>? source, | ||
UitzonderingTypeType uitzonderingTypeType) | ||
{ | ||
return HasAnyUitzondering(source, type => type.Type == uitzonderingTypeType); | ||
return HasAnyUitzondering(source, predicate: type => type.Type == uitzonderingTypeType); | ||
} | ||
|
||
public static bool HasAnyUitzondering(this ResponseEnvelope<GeefOndernemingResponseBody>? source, Func<UitzonderingType, bool> predicate) | ||
public static bool HasAnyUitzondering( | ||
this ResponseEnvelope<GeefOndernemingResponseBody>? source, | ||
Func<UitzonderingType, bool> predicate) | ||
=> source?.Body?.GeefOndernemingResponse?.Repliek?.Antwoorden?.Antwoord?.Uitzonderingen?.Any(predicate) ?? false; | ||
} |
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