class JobQueueBatch implements Serializable {

    public void setCompletedStatus(UUID aggregatorID) {
        if (this.status != JobStatus.RUNNING) {
            throw new JobQueueFailure(jobID, batchID, String.format("Cannot complete. JobStatus: %s", this.status));
        }
        if (!this.patients.isEmpty() && (this.patientIndex == null || this.getPatients().size() != this.patientIndex + 1)) {
            throw new JobQueueFailure(jobID, batchID, String.format("Cannot complete. Job processing not finished. Only on patient %d of %d", this.getPatientIndex().orElse(-1) + 1, patients.size()));
        }
        this.verifyAggregatorID(aggregatorID);
        this.status = JobStatus.COMPLETED;
        this.aggregatorID = null;
        this.patientIndex = null;
        completeTime = OffsetDateTime.now(ZoneOffset.UTC);

        this.setUpdateTime();
    }

    public  JobQueueBatch();
    public  JobQueueBatch(UUID jobID,
                         UUID orgID,
                         String providerID,
                         List<String> patients,
                         List<ResourceType> resourceTypes,
                         OffsetDateTime since,
                         OffsetDateTime transactionTime);

}