-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add MQ deactivated event to change log (#1062)
- Loading branch information
Showing
4 changed files
with
141 additions
and
1 deletion.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...dSystem/src/TeachingRecordSystem.Core/Events/MandatoryQualificationDqtDeactivatedEvent.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,9 @@ | ||
using TeachingRecordSystem.Core.Events.Models; | ||
|
||
namespace TeachingRecordSystem.Core.Events; | ||
|
||
public record MandatoryQualificationDqtDeactivatedEvent : EventBase, IEventWithPersonId, IEventWithMandatoryQualification | ||
{ | ||
public required Guid PersonId { get; init; } | ||
public required MandatoryQualification MandatoryQualification { get; init; } | ||
} |
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
44 changes: 44 additions & 0 deletions
44
...ges/Persons/PersonDetail/Timeline/Events/MandatoryQualificationDqtDeactivatedEvent.cshtml
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,44 @@ | ||
@using TeachingRecordSystem.Core.Events | ||
@model TimelineItem<TimelineEvent<MandatoryQualificationDqtDeactivatedEvent>> | ||
@{ | ||
var deactivatedEvent = Model.ItemModel.Event; | ||
var mandatoryQualification = deactivatedEvent.MandatoryQualification; | ||
var raisedByUser = Model.ItemModel.RaisedByUser; | ||
var raisedBy = deactivatedEvent.RaisedBy.IsDqtUser ? (raisedByUser.DqtUser?.Name ?? "Unknown") : (raisedByUser.User?.Name) ?? "Unknown"; | ||
} | ||
|
||
<div class="moj-timeline__item govuk-!-padding-bottom-2" data-testid="timeline-item"> | ||
<div class="moj-timeline__header"> | ||
<h2 class="moj-timeline__title">Mandatory qualification deactivated</h2> | ||
</div> | ||
<p class="moj-timeline__date"> | ||
<span data-testid="raised-by">By @raisedBy on</span> | ||
<time datetime="@deactivatedEvent.CreatedUtc.ToString("O")" data-testid="timeline-item-time"> | ||
@deactivatedEvent.CreatedUtc.ToString("dd MMMMM yyyy 'at' h:mm tt") | ||
</time> | ||
</p> | ||
<div class="moj-timeline__description"> | ||
<govuk-summary-list> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Training provider</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="provider">@(mandatoryQualification.Provider is not null ? mandatoryQualification.Provider.Name : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Specialism</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="specialism">@(mandatoryQualification.Specialism.HasValue ? mandatoryQualification.Specialism.Value.GetTitle() : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Start date</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="start-date">@(mandatoryQualification.StartDate.HasValue ? mandatoryQualification.StartDate.Value.ToString("d MMMM yyyy") : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>Status</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="status">@(mandatoryQualification.Status.HasValue ? mandatoryQualification.Status.Value.GetTitle() : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
<govuk-summary-list-row> | ||
<govuk-summary-list-row-key>End date</govuk-summary-list-row-key> | ||
<govuk-summary-list-row-value data-testid="end-date">@(mandatoryQualification.EndDate.HasValue ? mandatoryQualification.EndDate.Value.ToString("d MMMM yyyy") : "None")</govuk-summary-list-row-value> | ||
</govuk-summary-list-row> | ||
</govuk-summary-list> | ||
</div> | ||
</div> |
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