Skip to content

Commit 90aed62

Browse files
committed
TD-4223-LastAccessDateSetToNullForNewCourses
1 parent 72e8140 commit 90aed62

File tree

8 files changed

+33
-10
lines changed

8 files changed

+33
-10
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202406140805)]
6+
public class UpdateProgressMarkSubmittedTimeAsNullable : Migration
7+
{
8+
public override void Up()
9+
{
10+
Alter.Table("Progress")
11+
.AlterColumn("SubmittedTime")
12+
.AsDateTime()
13+
.Nullable();
14+
}
15+
public override void Down()
16+
{
17+
Alter.Table("Progress")
18+
.AlterColumn("SubmittedTime")
19+
.AsDateTime()
20+
.NotNullable();
21+
}
22+
}
23+
}

DigitalLearningSolutions.Data/DataServices/CourseDataService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ public IEnumerable<CourseStatistics> GetNonArchivedCourseStatisticsAtCentreFilte
864864

865865
public IEnumerable<DelegateCourseInfo> GetDelegateCoursesInfo(int delegateId)
866866
{
867-
return connection.Query<DelegateCourseInfo>(
867+
return connection.Query<DelegateCourseInfo>(
868868
$@"{selectDelegateCourseInfoQuery}
869869
WHERE pr.CandidateID = @delegateId
870870
AND pr.RemovedDate IS NULL
@@ -910,7 +910,7 @@ AND ap.DefaultContentTypeID <> 4
910910
da.CentreID,
911911
ap.ArchivedDate",
912912
new { delegateId }
913-
);
913+
);
914914
}
915915

916916
public DelegateCourseInfo? GetDelegateCourseInfoByProgressId(int progressId)

DigitalLearningSolutions.Data/DataServices/ProgressDataService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ int CreateNewDelegateProgress(
2020
int delegateId,
2121
int customisationId,
2222
int customisationVersion,
23-
DateTime submittedTime,
23+
DateTime? submittedTime,
2424
int enrollmentMethodId,
2525
int? enrolledByAdminId,
2626
DateTime? completeByDate,
@@ -163,7 +163,7 @@ public int CreateNewDelegateProgress(
163163
int delegateId,
164164
int customisationId,
165165
int customisationVersion,
166-
DateTime submittedTime,
166+
DateTime? submittedTime,
167167
int enrollmentMethodId,
168168
int? enrolledByAdminId,
169169
DateTime? completeByDate,

DigitalLearningSolutions.Data/Models/Courses/DelegateCourseInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public DelegateCourseInfo(
6868
string? supervisorSurname,
6969
bool? supervisorAdminActive,
7070
DateTime enrolled,
71-
DateTime lastUpdated,
71+
DateTime? lastUpdated,
7272
DateTime? completeBy,
7373
DateTime? completed,
7474
DateTime? evaluated,
@@ -145,7 +145,7 @@ bool isDelegateActive
145145
public bool AllCentresCourse { get; set; }
146146
public int ProgressId { get; set; }
147147
public bool IsProgressLocked { get; set; }
148-
public DateTime LastUpdated { get; set; }
148+
public DateTime? LastUpdated { get; set; }
149149
public DateTime? CompleteBy { get; set; }
150150
public DateTime? RemovedDate { get; set; }
151151
public DateTime? Completed { get; set; }

DigitalLearningSolutions.Web/Services/CourseDelegatesDownloadFileService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ DataRow row
547547
}
548548
row[DelegateId] = courseDelegate.CandidateNumber;
549549
row[Enrolled] = courseDelegate.Enrolled.Date;
550-
row[LastAccessed] = courseDelegate.LastUpdated.Date;
550+
row[LastAccessed] = courseDelegate.LastUpdated?.Date;
551551
row[CompleteBy] = courseDelegate.CompleteBy?.Date;
552552
row[CompletedDate] = courseDelegate.Completed?.Date;
553553
row[Logins] = courseDelegate.LoginCount;

DigitalLearningSolutions.Web/Services/EnrolService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void EnrolDelegateOnCourse(int delegateId, int customisationId, int custo
114114
delegateId,
115115
customisationId,
116116
customisationVersion,
117-
clockUtility.UtcNow,
117+
null,
118118
2,
119119
enrolledByAdminId,
120120
completeByDate,

DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Delegates/Shared/DelegateCourseInfoViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private DelegateCourseInfoViewModel(DelegateCourseInfo info)
6464
: "None";
6565

6666
CompleteBy = info.CompleteBy?.ToString(DateHelper.StandardDateAndTimeFormat);
67-
LastAccessed = info.LastUpdated.ToString(DateHelper.StandardDateAndTimeFormat);
67+
LastAccessed = info.LastUpdated?.ToString(DateHelper.StandardDateAndTimeFormat);
6868
Completed = info.Completed?.ToString(DateHelper.StandardDateAndTimeFormat);
6969
Evaluated = info.Evaluated?.ToString(DateHelper.StandardDateAndTimeFormat);
7070
RemovedDate = info.RemovedDate?.ToString(DateHelper.StandardDateAndTimeFormat);

DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/Shared/_DelegateCourseProgressDetailsWithStatusTags.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
Last access
8080
</dt>
8181
<dd class="nhsuk-summary-list__value" data-name-for-sorting="last-accessed">
82-
@Model.LastAccessed
82+
@(Model.LastAccessed ?? "-")
8383
</dd>
8484
<dd class="nhsuk-summary-list__actions"></dd>
8585
</div>

0 commit comments

Comments
 (0)