package performa.orm;

import oneit.objstore.rdbms.filters.EqualsFilter;
import oneit.utils.filter.Filter;
import performa.orm.types.JobStatus;


public class Client extends BaseClient
{
    private static final long serialVersionUID = 0L;
    
    // This constructor should not be called
    public Client ()
    {
        // Do not add any code to this, always put it in initialiseNewObject
    }
    
    public int getApplicationCountByStatus(JobStatus jobStatus)
    {
        Filter<Job> filter  =   Job.SearchByAll().andJobStatus(new EqualsFilter<>(jobStatus));
        
        return pipelineClient().toJobs(filter).toJobApplications().uniqueVals().size();
    }

    
    @Override
    public String getToString() 
    {
        return getClientName();
    }
}