package org.innovateuk.ifs.supporter.dashboard.viewmodel;

import org.innovateuk.ifs.competition.resource.CompetitionResource;
import org.innovateuk.ifs.pagination.PaginationViewModel;
import org.innovateuk.ifs.supporter.resource.SupporterDashboardApplicationPageResource;
import org.innovateuk.ifs.supporter.resource.SupporterDashboardApplicationResource;

import java.time.ZonedDateTime;
import java.util.List;

import static org.innovateuk.ifs.util.TimeZoneUtil.toUkTimeZone;

public class SupporterCompetitionDashboardViewModel {

    private final long competitionId;
    private final String competitionName;
    private final ZonedDateTime deadline;
    private final List<SupporterDashboardApplicationResource> applications;
    private final PaginationViewModel pagination;

    public SupporterCompetitionDashboardViewModel(SupporterDashboardApplicationPageResource pageResource, CompetitionResource competition) {
        this.competitionId = competition.getId();
        this.competitionName = competition.getName();
        this.deadline = toUkTimeZone(competition.getAssessorDeadlineDate());
        this.applications = pageResource.getContent();
        this.pagination = new PaginationViewModel(pageResource);
    }

    public long getCompetitionId() {
        return competitionId;
    }

    public String getCompetitionName() {
        return competitionName;
    }

    public ZonedDateTime getDeadline() {
        return deadline;
    }

    public List<SupporterDashboardApplicationResource> getApplications() {
        return applications;
    }

    public PaginationViewModel getPagination() {
        return pagination;
    }
}

@@ -112,32 +112,98 @@
 titionResource;%0A
+import org.innovateuk.ifs.competition.resource.CompetitionStatus;%0A
 import org.innov
@@ -244,16 +244,16 @@
 wModel;%0A
-
 import o
@@ -788,24 +788,68 @@
 plications;%0A
+    private final boolean assessmentClosed;%0A
     private 
@@ -1260,24 +1260,137 @@
 tContent();%0A
+        this.assessmentClosed = competition.getCompetitionStatus().isLaterThan(CompetitionStatus.IN_ASSESSMENT);%0A
         this
@@ -1747,24 +1747,24 @@
 cations() %7B%0A
-
         retu
@@ -1779,32 +1779,114 @@
 cations;%0A    %7D%0A%0A
+    public boolean isAssessmentClosed() %7B%0A        return assessmentClosed;%0A    %7D%0A%0A
     public Pagin

Revert "Revert "IFS-8410 adding assessment closed which got lost""