-
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.
Made changes to force code reuse and keep SonarQube happy
- Loading branch information
1 parent
8ab448e
commit 2702912
Showing
17 changed files
with
239 additions
and
260 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System; | ||
|
||
namespace GetIntoTeachingApi.Models.Crm | ||
{ | ||
/// <summary> | ||
/// Provides the blueprint for an object which encapsulates a collection of | ||
/// <see cref="ContactChannelCreation"/> types defined by the | ||
/// parent <see cref="Candidate"/> instance. | ||
/// </summary> | ||
public sealed class ContactChannelCreations | ||
{ | ||
private readonly IList<ContactChannelCreation> _contactChannelCreations; | ||
|
||
/// <summary> | ||
/// Initialises a new collection of <see cref="ContactChannelCreation"/> on instantiation. | ||
/// </summary> | ||
public ContactChannelCreations() | ||
{ | ||
_contactChannelCreations = new List<ContactChannelCreation>(); | ||
} | ||
|
||
/// <summary> | ||
/// Offers read-only access to the underlying | ||
/// <see cref="ContactChannelCreation"/> collection. | ||
/// </summary> | ||
/// <returns> | ||
/// The read-only collection of <see cref="ContactChannelCreation"/> configured types. | ||
/// </returns> | ||
public IReadOnlyCollection<ContactChannelCreation> GetContactChannelCreations() => | ||
new ReadOnlyCollection<ContactChannelCreation>(_contactChannelCreations); | ||
|
||
/// <summary> | ||
/// Allows a safe mechanism to add (mutate) the underlying | ||
/// collection of <see cref="ContactChannelCreation"/> types. | ||
/// </summary> | ||
/// <param name="contactChannelCreation" | ||
/// The <see cref="ContactChannelCreation"/> type to add to the underlying collection. | ||
/// ></param> | ||
/// <exception cref="ArgumentNullException"> | ||
/// Exception type thrown if the <see cref="ContactChannelCreation"/> is null. | ||
/// </exception> | ||
public void AddContactChannelCreation(ContactChannelCreation contactChannelCreation) | ||
{ | ||
if (contactChannelCreation == null!) | ||
{ | ||
throw new ArgumentNullException( | ||
nameof(contactChannelCreation), | ||
"The 'ContactChannelCreation' cannot be null."); | ||
} | ||
_contactChannelCreations.Add(contactChannelCreation); | ||
} | ||
|
||
/// <summary> | ||
/// Allows the current list of <see cref="ContactChannelCreation"/> types to be reset. | ||
/// </summary> | ||
public void Reset() => _contactChannelCreations.Clear(); | ||
|
||
/// <summary> | ||
/// Determines whether we have any existing ContactChannelCreations. | ||
/// </summary> | ||
public bool HasExistingContactChannelCreations => _contactChannelCreations.Count > 0; | ||
} | ||
} |
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 @@ | ||
namespace GetIntoTeachingApi.Models.Crm | ||
{ | ||
/// <summary> | ||
/// Interface that defines the contract on which objects | ||
/// that wish to invoke contact channel creation behaviour must adhere. | ||
/// </summary> | ||
public interface ICreateContactChannel | ||
{ | ||
/// <summary> | ||
/// Provides the default read-only contact creation channel integer value. | ||
/// </summary> | ||
int? DefaultContactCreationChannel { get; } | ||
|
||
/// <summary> | ||
/// Provides the ability to assign and retrieve the channel source creation identifier. | ||
/// </summary> | ||
int? CreationChannelSourceId { get; set; } | ||
|
||
/// <summary> | ||
/// Provides the ability to assign and retrieve the channel service creation identifier. | ||
/// </summary> | ||
int? CreationChannelServiceId { get; set; } | ||
|
||
/// <summary> | ||
/// Provides the ability to assign and retrieve the channel activity creation identifier. | ||
/// </summary> | ||
int? CreationChannelActivityId { get; set; } | ||
} | ||
} |
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.