<commit_before>package com.worth.ifs.competition.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.worth.ifs.application.domain.Application;
import com.worth.ifs.application.domain.Question;
import com.worth.ifs.application.domain.Section;
import com.worth.ifs.category.domain.Category;
import com.worth.ifs.competition.resource.CollaborationLevel;
import com.worth.ifs.competition.resource.CompetitionResource;
import com.worth.ifs.competition.resource.CompetitionSetupSection;
import com.worth.ifs.competition.resource.LeadApplicantType;
import com.worth.ifs.invite.domain.ProcessActivity;
import com.worth.ifs.user.domain.User;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;

/**
 * Competition defines database relations and a model to use client side and server side.
 */
@Entity
public class Competition implements ProcessActivity {

	@Transient
	private DateProvider dateProvider = new DateProvider();
	
    public CompetitionResource.Status getCompetitionStatus() {
        LocalDateTime today = dateProvider.provideDate();
        if(status.equals(CompetitionResource.Status.COMPETITION_SETUP)
                || status.equals(CompetitionResource.Status.READY_TO_OPEN)){
            return status;
        }else if(getStartDate() == null || getStartDate().isAfter(today)){<commit_msg>INFUND-3002: After discussing Andy returning the Ready To Open status when the competition status is COMPETITION_SETUP_FINISHED.<commit_after>package com.worth.ifs.competition.domain;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.worth.ifs.application.domain.Application;
import com.worth.ifs.application.domain.Question;
import com.worth.ifs.application.domain.Section;
import com.worth.ifs.category.domain.Category;
import com.worth.ifs.competition.resource.CollaborationLevel;
import com.worth.ifs.competition.resource.CompetitionResource;
import com.worth.ifs.competition.resource.CompetitionSetupSection;
import com.worth.ifs.competition.resource.LeadApplicantType;
import com.worth.ifs.invite.domain.ProcessActivity;
import com.worth.ifs.user.domain.User;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.util.*;

/**
 * Competition defines database relations and a model to use client side and server side.
 */
@Entity
public class Competition implements ProcessActivity {

	@Transient
	private DateProvider dateProvider = new DateProvider();
	
    public CompetitionResource.Status getCompetitionStatus() {
        LocalDateTime today = dateProvider.provideDate();
        if(status.equals(CompetitionResource.Status.COMPETITION_SETUP) ||
                status.equals(CompetitionResource.Status.READY_TO_OPEN)){
            return status;
        } else if (status.equals(CompetitionResource.Status.COMPETITION_SETUP_FINISHED)) {
            return CompetitionResource.Status.READY_TO_OPEN;
        } else if(getStartDate() == null || getStartDate().isAfter(today)){
{'fraction_non_alphanumeric': 0.09776536312849161, 'fraction_numerical': 0.0012414649286157666, 'mean_word_length': 5.162523900573614, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '142943', 'n_tokens_mistral': 905, 'n_tokens_neox': 857, 'n_words': 171}