-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #79 from digipost/SplittRecipient
Splitt recipient og fiks Identification
- Loading branch information
Showing
45 changed files
with
786 additions
and
916 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Digipost.Api.Client.Domain | ||
{ | ||
public abstract class DigipostRecipient : IDigipostRecipient | ||
{ | ||
|
||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
Digipost.Api.Client.Domain/Extensions/IdentificationTypeExtensions.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using System; | ||
using Digipost.Api.Client.Domain.Enums; | ||
|
||
namespace Digipost.Api.Client.Domain.Extensions | ||
{ | ||
public static class IdentificationTypeExtensions | ||
{ | ||
internal static IdentificationChoiceType ToIdentificationChoiceType(this IdentificationType identificationType) | ||
{ | ||
var identificationChoiceType = | ||
identificationType == IdentificationType.OrganizationNumber | ||
? OrganizationEnumWithSpellingDifference() | ||
: ParseEnumIgnoreCasing(identificationType); | ||
|
||
return identificationChoiceType; | ||
} | ||
|
||
private static IdentificationChoiceType ParseEnumIgnoreCasing(IdentificationType identificationType) | ||
{ | ||
return (IdentificationChoiceType) Enum.Parse(typeof(IdentificationChoiceType), identificationType.ToString(), ignoreCase: true); | ||
} | ||
|
||
internal static IdentificationChoiceType OrganizationEnumWithSpellingDifference() | ||
{ | ||
return IdentificationChoiceType.OrganisationNumber; | ||
} | ||
|
||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Digipost.Api.Client.Domain | ||
{ | ||
public interface IDigipostRecipient | ||
{ | ||
|
||
} | ||
} |
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
7 changes: 7 additions & 0 deletions
7
Digipost.Api.Client.Domain/Identify/IIdentificationRecipient.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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace Digipost.Api.Client.Domain.Identify | ||
{ | ||
public interface IIdentificationRecipient | ||
{ | ||
|
||
} | ||
} |
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,33 +1,12 @@ | ||
using System; | ||
using Digipost.Api.Client.Domain.Enums; | ||
using Digipost.Api.Client.Domain.SendMessage; | ||
|
||
namespace Digipost.Api.Client.Domain.Identify | ||
namespace Digipost.Api.Client.Domain.Identify | ||
{ | ||
[Obsolete("Use IdentificationByNameAndAddress or IdentificationById. Will be removed in future version.")] | ||
public class Identification : IIdentification | ||
{ | ||
public IdentificationChoiceType IdentificationChoiceType { get; set; } | ||
|
||
public IdentificationType IdentificationType | ||
{ | ||
get | ||
{ | ||
throw new NotImplementedException("Use IdentificationByNameAndAddress or IdentificationById class, as this will be removed in future version."); | ||
} | ||
} | ||
|
||
public Identification(IdentificationChoiceType identificationChoiceType, string value) | ||
{ | ||
IdentificationChoiceType = identificationChoiceType; | ||
Data = value; | ||
} | ||
public DigipostRecipient DigipostRecipient { get; set; } | ||
|
||
public Identification(RecipientByNameAndAddress recipientByNameAndAddress) | ||
public Identification(DigipostRecipient digipostRecipient) | ||
{ | ||
Data = recipientByNameAndAddress; | ||
DigipostRecipient = digipostRecipient; | ||
} | ||
|
||
public object Data { get; internal set; } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
Digipost.Api.Client.Domain/Identify/IdentificationByNameAndAddress.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.