-
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.
- Loading branch information
1 parent
aa58368
commit b8677e4
Showing
33 changed files
with
1,118 additions
and
1,441 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
130 changes: 65 additions & 65 deletions
130
NotificationApi/NotificationApi.Client/NotificationApiClient.cs
Large diffs are not rendered by default.
Oops, something went wrong.
18 changes: 5 additions & 13 deletions
18
NotificationApi/NotificationApi.Common/BadRequestException.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,16 +1,8 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace NotificationApi.Common | ||
{ | ||
/// <summary> | ||
/// Exception to throw when input data passed downstream from the api input is in an invalid format | ||
/// </summary> | ||
[Serializable] | ||
public class BadRequestException : Exception | ||
{ | ||
protected BadRequestException(SerializationInfo info, StreamingContext context) : base(info, context) { } | ||
namespace NotificationApi.Common; | ||
|
||
public BadRequestException(string message) : base(message) { } | ||
} | ||
} | ||
/// <summary> | ||
/// Exception to throw when input data passed downstream from the api input is in an invalid format | ||
/// </summary> | ||
public class BadRequestException(string message) : Exception(message); |
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
6 changes: 0 additions & 6 deletions
6
NotificationApi/NotificationApi.Contract/IAssemblyReference.cs
This file was deleted.
Oops, something went wrong.
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,9 +1,7 @@ | ||
namespace NotificationApi.Contract | ||
namespace NotificationApi.Contract; | ||
|
||
public enum MessageType | ||
{ | ||
// Public contract for NotificationApi.Domain.Enums.MessageType | ||
public enum MessageType | ||
{ | ||
Email = 1, | ||
SMS = 2 | ||
} | ||
Email = 1, | ||
SMS = 2 | ||
} |
116 changes: 57 additions & 59 deletions
116
NotificationApi/NotificationApi.Contract/NotificationType.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,61 +1,59 @@ | ||
namespace NotificationApi.Contract | ||
namespace NotificationApi.Contract; | ||
|
||
public enum NotificationType | ||
{ | ||
// Public contract for NotificationApi.Domain.Enums.NotificationType | ||
public enum NotificationType | ||
{ | ||
CreateIndividual = 1, | ||
CreateRepresentative = 2, | ||
PasswordReset = 3, | ||
HearingConfirmationLip = 4, | ||
HearingConfirmationRepresentative = 5, | ||
HearingConfirmationJudge = 6, | ||
HearingConfirmationJoh = 7, | ||
HearingConfirmationLipMultiDay = 8, | ||
HearingConfirmationRepresentativeMultiDay = 9, | ||
HearingConfirmationJudgeMultiDay = 10, | ||
HearingConfirmationJohMultiDay = 11, | ||
HearingAmendmentLip = 12, | ||
HearingAmendmentRepresentative = 13, | ||
HearingAmendmentJudge = 14, | ||
HearingAmendmentJoh = 15, | ||
HearingReminderLip = 16, | ||
HearingReminderRepresentative = 17, | ||
HearingReminderJoh = 18, | ||
HearingConfirmationEJudJudge = 19, | ||
HearingConfirmationEJudJudgeMultiDay = 20, | ||
HearingAmendmentEJudJudge = 21, | ||
HearingAmendmentEJudJoh = 22, | ||
HearingReminderEJudJoh = 23, | ||
HearingConfirmationEJudJoh = 24, | ||
HearingConfirmationEJudJohMultiDay = 25, | ||
EJudJohDemoOrTest = 26, | ||
EJudJudgeDemoOrTest = 27, | ||
JudgeDemoOrTest = 28, | ||
ParticipantDemoOrTest = 29, | ||
TelephoneHearingConfirmation = 30, | ||
TelephoneHearingConfirmationMultiDay = 31, | ||
CreateStaffMember = 32, | ||
HearingAmendmentStaffMember = 33, | ||
HearingConfirmationStaffMember = 34, | ||
HearingConfirmationStaffMemberMultiDay = 35, | ||
StaffMemberDemoOrTest = 36, | ||
NewHearingReminderLIP = 37, | ||
NewHearingReminderRepresentative = 38, | ||
NewHearingReminderJOH = 39, | ||
NewHearingReminderEJudJoh = 40, | ||
NewUserLipWelcome = 41, | ||
NewUserLipConfirmation = 42, | ||
NewUserLipConfirmationMultiDay = 43, | ||
ExistingUserLipConfirmation = 44, | ||
ExistingUserLipConfirmationMultiDay = 45, | ||
NewHearingReminderLipSingleDay = 46, | ||
NewHearingReminderLipMultiDay = 47, | ||
NewUserRepresentativeWelcome = 48, | ||
NewUserRepresentativeConfirmation = 49, | ||
NewUserRepresentativeConfirmationMultiDay = 50, | ||
ExistingUserRepresentativeConfirmation = 51, | ||
ExistingUserRepresentativeConfirmationMultiDay = 52, | ||
NewHearingReminderRepresentativeSingleDay = 53, | ||
NewHearingReminderRepresentativeMultiDay = 54, | ||
} | ||
CreateIndividual = 1, | ||
CreateRepresentative = 2, | ||
PasswordReset = 3, | ||
HearingConfirmationLip = 4, | ||
HearingConfirmationRepresentative = 5, | ||
HearingConfirmationJudge = 6, | ||
HearingConfirmationJoh = 7, | ||
HearingConfirmationLipMultiDay = 8, | ||
HearingConfirmationRepresentativeMultiDay = 9, | ||
HearingConfirmationJudgeMultiDay = 10, | ||
HearingConfirmationJohMultiDay = 11, | ||
HearingAmendmentLip = 12, | ||
HearingAmendmentRepresentative = 13, | ||
HearingAmendmentJudge = 14, | ||
HearingAmendmentJoh = 15, | ||
HearingReminderLip = 16, | ||
HearingReminderRepresentative = 17, | ||
HearingReminderJoh = 18, | ||
HearingConfirmationEJudJudge = 19, | ||
HearingConfirmationEJudJudgeMultiDay = 20, | ||
HearingAmendmentEJudJudge = 21, | ||
HearingAmendmentEJudJoh = 22, | ||
HearingReminderEJudJoh = 23, | ||
HearingConfirmationEJudJoh = 24, | ||
HearingConfirmationEJudJohMultiDay = 25, | ||
EJudJohDemoOrTest = 26, | ||
EJudJudgeDemoOrTest = 27, | ||
JudgeDemoOrTest = 28, | ||
ParticipantDemoOrTest = 29, | ||
TelephoneHearingConfirmation = 30, | ||
TelephoneHearingConfirmationMultiDay = 31, | ||
CreateStaffMember = 32, | ||
HearingAmendmentStaffMember = 33, | ||
HearingConfirmationStaffMember = 34, | ||
HearingConfirmationStaffMemberMultiDay = 35, | ||
StaffMemberDemoOrTest = 36, | ||
NewHearingReminderLIP = 37, | ||
NewHearingReminderRepresentative = 38, | ||
NewHearingReminderJOH = 39, | ||
NewHearingReminderEJudJoh = 40, | ||
NewUserLipWelcome = 41, | ||
NewUserLipConfirmation = 42, | ||
NewUserLipConfirmationMultiDay = 43, | ||
ExistingUserLipConfirmation = 44, | ||
ExistingUserLipConfirmationMultiDay = 45, | ||
NewHearingReminderLipSingleDay = 46, | ||
NewHearingReminderLipMultiDay = 47, | ||
NewUserRepresentativeWelcome = 48, | ||
NewUserRepresentativeConfirmation = 49, | ||
NewUserRepresentativeConfirmationMultiDay = 50, | ||
ExistingUserRepresentativeConfirmation = 51, | ||
ExistingUserRepresentativeConfirmationMultiDay = 52, | ||
NewHearingReminderRepresentativeSingleDay = 53, | ||
NewHearingReminderRepresentativeMultiDay = 54, | ||
} |
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
20 changes: 3 additions & 17 deletions
20
NotificationApi/NotificationApi.DAL/Exceptions/DuplicateNotificationTemplateException.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,21 +1,7 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
using NotificationApi.Domain.Enums; | ||
|
||
namespace NotificationApi.DAL.Exceptions | ||
{ | ||
namespace NotificationApi.DAL.Exceptions; | ||
|
||
[Serializable] | ||
public class DuplicateNotificationTemplateException : Exception | ||
{ | ||
public DuplicateNotificationTemplateException(NotificationType notificationType) : base( | ||
$"Duplicate entry for notification type {notificationType} found") | ||
{ | ||
} | ||
|
||
protected DuplicateNotificationTemplateException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
} | ||
} | ||
public class DuplicateNotificationTemplateException(NotificationType notificationType) | ||
: Exception($"Duplicate entry for notification type {notificationType} found"); |
20 changes: 6 additions & 14 deletions
20
NotificationApi/NotificationApi.DAL/Queries/Core/QueryHandler.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,20 +1,12 @@ | ||
using System.Threading.Tasks; | ||
|
||
namespace NotificationApi.DAL.Queries.Core | ||
namespace NotificationApi.DAL.Queries.Core; | ||
|
||
public class QueryHandler(IQueryHandlerFactory queryHandlerFactory) : IQueryHandler | ||
{ | ||
public class QueryHandler : IQueryHandler | ||
public Task<TResult> Handle<TQuery, TResult>(TQuery query) where TQuery : IQuery where TResult : class | ||
{ | ||
private readonly IQueryHandlerFactory _queryHandlerFactory; | ||
|
||
public QueryHandler(IQueryHandlerFactory queryHandlerFactory) | ||
{ | ||
_queryHandlerFactory = queryHandlerFactory; | ||
} | ||
|
||
public Task<TResult> Handle<TQuery, TResult>(TQuery query) where TQuery : IQuery where TResult : class | ||
{ | ||
var handler = _queryHandlerFactory.Create<TQuery, TResult>(query); | ||
return handler.Handle(query); | ||
} | ||
var handler = queryHandlerFactory.Create<TQuery, TResult>(query); | ||
return handler.Handle(query); | ||
} | ||
} |
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.