Skip to content

Commit

Permalink
Added review count
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Howes committed Aug 24, 2021
1 parent b3906c8 commit 55fee3a
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<VacancyReviewedConfirmationViewModel> GetVacancyReviewedOrches
Title = vacancy.Title,
VacancyReference = vacancy.VacancyReference?.ToString(),
EmployerName = employer.Name,
IsResubmit = vacancy.ReviewDate.HasValue,
IsResubmit = vacancy.ReviewCount > 1,
IsVacancyRejectedByEmployerNotificationSelected = preferences.NotificationTypes.HasFlag(NotificationTypes.VacancyRejectedByEmployer)
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ private Vacancy CreateClone(CloneVacancyCommand message, Vacancy vacancy)
clone.TransferInfo = null;
clone.ReviewByUser = null;
clone.ReviewDate = null;
clone.ReviewCount = 0;

return clone;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public async Task Handle(ReviewVacancyCommand message, CancellationToken cancell

vacancy.Status = VacancyStatus.Review;
vacancy.ReviewDate = now;
vacancy.ReviewCount += 1;
vacancy.ReviewByUser = message.User;
vacancy.LastUpdatedDate = now;
vacancy.LastUpdatedByUser = message.User;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Vacancy
public VacancyUser SubmittedByUser { get; set; }
public DateTime? ReviewDate { get; set; }
public VacancyUser ReviewByUser { get; set; }
public int ReviewCount { get; set; }
public DateTime? ApprovedDate { get; set; }
public DateTime? LiveDate { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private static void AssertKnownProperties(Vacancy original, Vacancy clone)
{nameof(Vacancy.SubmittedDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.SubmittedByUser), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ReviewDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ReviewCount), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.Ignore)},
{nameof(Vacancy.ReviewByUser), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.ApprovedDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
{nameof(Vacancy.LiveDate), (o, c, s) => AssertProperty(o, c, s, CloneAssertType.IsNull)},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public async Task GivenEmployerDescription_ThenShouldUpdateVacancyWithThatDescri
vacancy.Status.Should().Be(VacancyStatus.Review);
vacancy.ReviewDate.Should().Be(now);
vacancy.ReviewByUser.Should().Be(user);
vacancy.ReviewCount.Should().Be(1);
vacancy.LastUpdatedDate.Should().Be(now);
vacancy.LastUpdatedByUser.Should().Be(user);
vacancy.EmployerDescription.Should().Be(expectedDescription);
Expand Down Expand Up @@ -77,6 +78,7 @@ public async Task ShouldNotChangeEmployerDescriptionIfNotSpecifiedInCommand()
vacancy.Status.Should().Be(VacancyStatus.Review);
vacancy.ReviewDate.Should().Be(now);
vacancy.ReviewByUser.Should().Be(user);
vacancy.ReviewCount.Should().Be(1);
vacancy.LastUpdatedDate.Should().Be(now);
vacancy.LastUpdatedByUser.Should().Be(user);
vacancy.EmployerDescription.Should().Be(expectedDescription);
Expand Down

0 comments on commit 55fee3a

Please sign in to comment.