package model.job;

import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateTime;
import org.mongojack.ObjectId;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;

@JsonInclude(Include.NON_NULL)
public class Job {
	public String jobId;
	public PiazzaJobType jobType;
	public DateTime submitted;
	public String submitterApiKey;
	public String status;
	public JobProgress progress = new JobProgress();
	public List<JobProgress> history = new ArrayList<JobProgress>();
	public Object result = null; // TODO: How to represent this model?

	@ObjectId
	@JsonProperty("_id")
	public String getJobId() {
		return jobId;
	}

	@ObjectId
	@JsonProperty("_id")
	public void setJobId(String jobId) {
		this.jobId = jobId;
	}
}

@@ -128,16 +128,68 @@
 ectId;%0A%0A
+import com.fasterxml.jackson.annotation.JsonIgnore;%0A
 import c
@@ -225,32 +225,32 @@
 on.JsonInclude;%0A
-
 import com.faste
@@ -452,16 +452,29 @@
 obType;%0A
+%09@JsonIgnore%0A
 %09public 
@@ -885,16 +885,16 @@
 obId) %7B%0A
-
 %09%09this.j
@@ -909,11 +909,265 @@
 obId;%0A%09%7D
+%0A%0A%09@JsonProperty(%22submitted%22)%0A%09public String getSubmittedString() %7B%0A%09%09// Defaults to ISO8601%0A%09%09return submitted.toString();%0A%09%7D%0A%0A%09@JsonProperty(%22submitted%22)%0A%09public void setSubmittedString(String submitted) %7B%0A%09%09this.submitted = new DateTime(submitted);%0A%09%7D
 %0A%7D%0A

Serialize DateTime to ISO8601