package org.jeasy.jobs.request;

import java.time.LocalDateTime;

public class JobRequest {

    private int id;
    private int jobId;
    private String parameters;
    // TODO add priotity
    private JobRequestStatus status;
    private LocalDateTime creationDate;
    private LocalDateTime processingDate;

    public JobRequest() {
    }

    public JobRequest(int id, int jobId, String parameters, JobRequestStatus status, LocalDateTime creationDate, LocalDateTime processingDate) {
        this.id = id;
        this.jobId = jobId;
        this.parameters = parameters;
        this.status = status;
        this.creationDate = creationDate;
        this.processingDate = processingDate;
    }

    public JobRequest(int jobId, String parameters, JobRequestStatus status, LocalDateTime creationDate, LocalDateTime processingDate) {
        this.jobId = jobId;
        this.parameters = parameters;
        this.status = status;
        this.creationDate = creationDate;
        this.processingDate = processingDate;
    }

    public int getId() {
        return id;
    }

    public int getJobId() {
        return jobId;
    }

    public String getParameters() {
        return parameters;
    }

    public JobRequestStatus getStatus() {
        return status;
    }

    public LocalDateTime getCreationDate() {
        return creationDate;
    }

    public LocalDateTime getProcessingDate() {
        return processingDate;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setJobId(int jobId) {
        this.jobId = jobId;
    }

    public void setParameters(String parameters) {
        this.parameters = parameters;
    }

    public void setStatus(JobRequestStatus status) {
        this.status = status;
    }

    public void setCreationDate(LocalDateTime creationDate) {
        this.creationDate = creationDate;
    }

    public void setProcessingDate(LocalDateTime processingDate) {
        this.processingDate = processingDate;
    }

    @Override
    public String toString() {
        return "JobRequest{" +
                "id=" + id +
                ", jobId=" + jobId +
                ", parameters='" + parameters + '\'' +
                ", status=" + status +
                ", creationDate=" + creationDate +
                ", processingDate=" + processingDate +
                '}';
    }
}

@@ -368,16 +368,8 @@
 int 
-id, int 
 jobI
@@ -392,116 +392,11 @@
 ters
-, JobRequestStatus status, LocalDateTime creationDate, LocalDateTime processingDate) %7B%0A        this.id = id;
+) %7B
 %0A   
@@ -472,38 +472,56 @@
   this.status = 
-status
+JobRequestStatus.PENDING
 ;%0A        this.c
@@ -538,66 +538,27 @@
 e = 
-creationDate;%0A        this.processingDate = processingDate
+LocalDateTime.now()
 ;%0A  

add constructor with jobId and parameters.