-
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.
refactor: or-1716 migrate dubbel info to verenigingStatus
- Loading branch information
Showing
15 changed files
with
65 additions
and
52 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
namespace AssociationRegistry.Vereniging; | ||
|
||
public class VerenigingStatus | ||
public abstract record VerenigingStatus(string StatusNaam) | ||
{ | ||
public static readonly VerenigingStatus Actief = new("Actief"); | ||
public static readonly VerenigingStatus Gestopt = new("Gestopt"); | ||
public static readonly VerenigingStatus Dubbel = new("Dubbel"); | ||
public record StatusActief() : VerenigingStatus("Actief"); | ||
public record StatusGestopt() : VerenigingStatus("Gestopt"); | ||
public record StatusDubbel(VCode VCodeAuthentiekeVereniging, VerenigingStatus VorigeVerenigingStatus) : VerenigingStatus("Dubbel"); | ||
|
||
public string Naam { get; } | ||
public static VerenigingStatus Actief => new StatusActief(); | ||
public static VerenigingStatus Gestopt => new StatusGestopt(); | ||
|
||
public VerenigingStatus(string naam) | ||
public VerenigingStatus ParseVorigeStatus(string vorigeStatus) | ||
{ | ||
Naam = naam; | ||
switch (vorigeStatus) | ||
{ | ||
case "Actief": return new StatusActief(); | ||
case "Gestopt": return new StatusGestopt(); | ||
default: throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
|
||
public static readonly VerenigingStatus[] All = | ||
{ | ||
Actief, | ||
Gestopt, | ||
Dubbel | ||
}; | ||
|
||
public static VerenigingStatus Parse(string naam) | ||
=> All.Single(t => t.Naam == naam); | ||
} | ||
|
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
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