PAN-50 Created the DTO for theorems

This commit is contained in:
2019-03-03 18:36:14 -07:00
parent f6de79a3d4
commit 9d7673ebf2
2 changed files with 20 additions and 0 deletions
@@ -1,4 +1,19 @@
package edu.msudenver.tsp.persistence.dto; package edu.msudenver.tsp.persistence.dto;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.hibernate.annotations.Type;
import javax.persistence.Column;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
public class TheoremDto extends BaseDto { public class TheoremDto extends BaseDto {
@NotBlank @Size(min = 1, max = 512, message = "theorem name must be between 1 and 512 characters") private String name;
@NotNull @JsonProperty("theorem_type") private TheoremType theoremType;
@NotNull private String branch;
@Type(type = "json") @Column(columnDefinition = "jsonb") @JsonProperty("referenced_definitions") private List<String> referencedDefinitions;
@Type(type = "json") @Column(columnDefinition = "jsonb") @JsonProperty("referenced_theorems") private List<String> referencedTheorems;
@NotNull @JsonProperty("proven_status") private boolean provenStatus;
} }
@@ -0,0 +1,5 @@
package edu.msudenver.tsp.persistence.dto;
public enum TheoremType {
THEOREM, PROPOSITION, LEMMA, COROLLARY
}