Skip to content
Snippets Groups Projects
Commit b66e443a authored by Inaki Etxaniz's avatar Inaki Etxaniz Committed by Etxaniz Errazkin, Iñaki
Browse files

Final version

parent a914b7c3
No related branches found
No related tags found
No related merge requests found
Showing
with 767 additions and 73 deletions
# SPDX-License-Identifier: Apache-2.0
FROM maven:3.8.1-jdk-11 as builder FROM maven:3.8.1-jdk-11 as builder
WORKDIR /code WORKDIR /code
......
...@@ -330,6 +330,21 @@ ...@@ -330,6 +330,21 @@
<groupId>io.dropwizard.metrics</groupId> <groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId> <artifactId>metrics-core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.10</version>
</dependency>
<dependency>
<groupId>jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.13</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20200518</version>
</dependency>
<!-- jhipster-needle-maven-add-dependency --> <!-- jhipster-needle-maven-add-dependency -->
</dependencies> </dependencies>
......
# SPDX-License-Identifier: Apache-2.0
package com.medina.coc.backend; package com.medina.coc.backend;
import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.builder.SpringApplicationBuilder;
......
# SPDX-License-Identifier: Apache-2.0
package com.medina.coc.backend; package com.medina.coc.backend;
import com.medina.coc.backend.config.ApplicationProperties; import com.medina.coc.backend.config.ApplicationProperties;
......
# SPDX-License-Identifier: Apache-2.0
package com.medina.coc.backend; package com.medina.coc.backend;
import java.lang.annotation.ElementType; import java.lang.annotation.ElementType;
......
...@@ -8,5 +8,37 @@ import org.springframework.boot.context.properties.ConfigurationProperties; ...@@ -8,5 +8,37 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
* Properties are configured in the {@code application.yml} file. * Properties are configured in the {@code application.yml} file.
* See {@link tech.jhipster.config.JHipsterProperties} for a good example. * See {@link tech.jhipster.config.JHipsterProperties} for a good example.
*/ */
@ConfigurationProperties(prefix = "application", ignoreUnknownFields = false) @ConfigurationProperties(prefix = "application", ignoreUnknownFields = true)
public class ApplicationProperties {} public class ApplicationProperties {
private String satraLoginUrl;
private String satraPracticeUrl;
private String orchestratorUrl;
public String getSatraLoginUrl() {
return satraLoginUrl;
}
public void setSatraLoginUrl(String satraLoginUrl) {
this.satraLoginUrl = satraLoginUrl;
}
public String getSatraPracticeUrl() {
return satraPracticeUrl;
}
public void setSatraPracticeUrl(String satraPracticeUrl) {
this.satraPracticeUrl = satraPracticeUrl;
}
public String getOrchestratorUrl() {
return orchestratorUrl;
}
public void setOrchestratorUrl(String orchestratorUrl) {
this.orchestratorUrl = orchestratorUrl;
}
}
...@@ -10,6 +10,7 @@ public final class Constants { ...@@ -10,6 +10,7 @@ public final class Constants {
public static final String SYSTEM = "system"; public static final String SYSTEM = "system";
public static final String DEFAULT_LANGUAGE = "en"; public static final String DEFAULT_LANGUAGE = "en";
public static final String NA = "N/A";
private Constants() {} private Constants() {}
} }
...@@ -9,17 +9,18 @@ import javax.persistence.GenerationType; ...@@ -9,17 +9,18 @@ import javax.persistence.GenerationType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.hibernate.annotations.Cache; import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.CacheConcurrencyStrategy;
/** /**
* QuestionnairePurpose entity.\n\n@author Diego Rosado * AuditLog entity.\n\n@author Diego Rosado
*/ */
@Entity @Entity
@Table(name = "questionnaire_purpose") @Table(name = "audit_logs")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class QuestionnairePurpose implements Serializable { public class AuditLog implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -29,18 +30,53 @@ public class QuestionnairePurpose implements Serializable { ...@@ -29,18 +30,53 @@ public class QuestionnairePurpose implements Serializable {
private Long id; private Long id;
/** /**
* purpose * dateLog
*/ */
@NotNull @NotNull
@Column(name = "purpose", nullable = false) @Size(max = 20)
private String purpose; @Column(name = "date_log", length = 20, nullable = false)
private String dateLog;
/**
* user
*/
@NotNull
@Size(max = 50)
@Column(name = "user", length = 50, nullable = false)
private String user;
/**
* entity
*/
@NotNull
@Size(max = 60)
@Column(name = "entity", length = 60, nullable = false)
private String entity;
/**
* target
*/
@NotNull
@Size(max = 255)
@Column(name = "target", length = 255, nullable = false)
private String target;
/**
* operation
*/
@NotNull
@Size(max = 10)
@Column(name = "operation", length = 10, nullable = false)
private String operation;
// jhipster-needle-entity-add-field - JHipster will add fields here
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
public QuestionnairePurpose id(Long id) { public AuditLog id(Long id) {
this.setId(id); this.setId(id);
return this; return this;
} }
...@@ -49,41 +85,102 @@ public class QuestionnairePurpose implements Serializable { ...@@ -49,41 +85,102 @@ public class QuestionnairePurpose implements Serializable {
this.id = id; this.id = id;
} }
public String getPurpose() { public String getDateLog() {
return this.purpose; return this.dateLog;
}
public AuditLog dateLog(String dateLog) {
this.setDateLog(dateLog);
return this;
}
public void setDateLog(String dateLog) {
this.dateLog = dateLog;
}
public String getUser() {
return this.user;
} }
public QuestionnairePurpose purpose(String purpose) { public AuditLog user(String user) {
this.setPurpose(purpose); this.setUser(user);
return this; return this;
} }
public void setPurpose(String purpose) { public void setUser(String user) {
this.purpose = purpose; this.user = user;
} }
public String getEntity() {
return this.entity;
}
public AuditLog entity(String entity) {
this.setEntity(entity);
return this;
}
public void setEntity(String entity) {
this.entity = entity;
}
public String getTarget() {
return this.target;
}
public AuditLog target(String target) {
this.setTarget(target);
return this;
}
public void setTarget(String target) {
this.target = target;
}
public String getOperation() {
return this.operation;
}
public AuditLog operation(String operation) {
this.setOperation(operation);
return this;
}
public void setOperation(String operation) {
this.operation = operation;
}
// jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
return true; return true;
} }
if (!(o instanceof QuestionnairePurpose)) { if (!(o instanceof AuditLog)) {
return false; return false;
} }
return id != null && id.equals(((QuestionnairePurpose) o).id); return id != null && id.equals(((AuditLog) o).id);
} }
@Override @Override
public int hashCode() { public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode(); return getClass().hashCode();
} }
// prettier-ignore // prettier-ignore
@Override @Override
public String toString() { public String toString() {
return "QuestionnairePurpose{" + return "AuditLog{" +
"id=" + getId() + "id=" + getId() +
", purpose='" + getPurpose() + "'" + ", dateLog='" + getDateLog() + "'" +
", user='" + getUser() + "'" +
", entity='" + getEntity() + "'" +
", target='" + getTarget() + "'" +
", operation='" + getOperation() + "'" +
"}"; "}";
} }
} }
...@@ -43,11 +43,18 @@ public class Question implements Serializable { ...@@ -43,11 +43,18 @@ public class Question implements Serializable {
private String question; private String question;
/** /**
* evidence * defaultEvidence
*/ */
@NotNull @NotNull
@Column(name = "evidence", nullable = false) @Column(name = "default_evidence", nullable = false)
private String evidence; private String defaultEvidence;
/**
* defaultComment
*/
@NotNull
@Column(name = "default_comment", nullable = false)
private String defaultComment;
/** /**
* assuranceLevelId * assuranceLevelId
...@@ -116,17 +123,30 @@ public class Question implements Serializable { ...@@ -116,17 +123,30 @@ public class Question implements Serializable {
this.question = question; this.question = question;
} }
public String getEvidence() { public String getDefaultEvidence() {
return this.evidence; return this.defaultEvidence;
}
public Question defaultEvidence(String defaultEvidence) {
this.setDefaultEvidence(defaultEvidence);
return this;
}
public void setDefaultEvidence(String defaultEvidence) {
this.defaultEvidence = defaultEvidence;
}
public String getDefaultComment() {
return this.defaultComment;
} }
public Question evidence(String evidence) { public Question defaultComment(String defaultComment) {
this.setEvidence(evidence); this.setDefaultComment(defaultComment);
return this; return this;
} }
public void setEvidence(String evidence) { public void setDefaultComment(String defaultComment) {
this.evidence = evidence; this.defaultComment = defaultComment;
} }
public Long getAssuranceLevelId() { public Long getAssuranceLevelId() {
...@@ -204,7 +224,8 @@ public class Question implements Serializable { ...@@ -204,7 +224,8 @@ public class Question implements Serializable {
"id=" + getId() + "id=" + getId() +
", code='" + getCode() + "'" + ", code='" + getCode() + "'" +
", question='" + getQuestion() + "'" + ", question='" + getQuestion() + "'" +
", evidence='" + getEvidence() + "'" + ", defaultEvidence='" + getDefaultEvidence() + "'" +
", defaultComment='" + getDefaultComment() + "'" +
", assuranceLevelId='" + getAssuranceLevelId() + "'" + ", assuranceLevelId='" + getAssuranceLevelId() + "'" +
", controlId='" + getControlId() + "'" + ", controlId='" + getControlId() + "'" +
", tomId='" + getTomId() + "'" + ", tomId='" + getTomId() + "'" +
......
package com.medina.coc.backend.domain; package com.medina.coc.backend.domain;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
...@@ -13,6 +15,8 @@ import javax.validation.constraints.NotNull; ...@@ -13,6 +15,8 @@ import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Cache; import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.medina.coc.backend.util.CollectionUtil;
/** /**
* Questionnaire entity.\n\n@author Diego Rosado * Questionnaire entity.\n\n@author Diego Rosado
*/ */
...@@ -28,19 +32,60 @@ public class Questionnaire implements Serializable { ...@@ -28,19 +32,60 @@ public class Questionnaire implements Serializable {
@Column(name = "id") @Column(name = "id")
private Long id; private Long id;
/**
* name
*/
@NotNull
@Column(name = "name", nullable = false)
private String name;
/**
* evidences
*/
@NotNull
@Column(name = "evidences", nullable = false)
private String evidences;
/**
* comments
*/
@NotNull
@Column(name = "comments", nullable = false)
private String comments;
/**
* lastUpdate
*/
@Column(name = "last_update", nullable = true)
private Long lastUpdate;
/** /**
* frameworkId * frameworkId
*/ */
@NotNull @NotNull
@Column(name = "frameworkId", nullable = false) @Column(name = "framework_id", nullable = false)
private Long frameworkId; private Long frameworkId;
/** /**
* purposeId * controlId
*/ */
@NotNull @NotNull
@Column(name = "purposeId", nullable = false) @Column(name = "control_id", nullable = false)
private Long purposeId; private Long controlId;
/**
* tomId
*/
@NotNull
@Column(name = "tom_id", nullable = false)
private Long tomId;
/**
* assuranceLevelId
*/
@NotNull
@Column(name = "assuranceLevelId", nullable = false)
private Long assuranceLevelId;
/** /**
* questionId * questionId
...@@ -63,6 +108,11 @@ public class Questionnaire implements Serializable { ...@@ -63,6 +108,11 @@ public class Questionnaire implements Serializable {
@Column(name = "userId", nullable = false) @Column(name = "userId", nullable = false)
private String userId; private String userId;
/**
* questionnaireNonConformityList
*/
private transient List<QuestionnaireNonConformity> questionnaireNonConformityList = new ArrayList<QuestionnaireNonConformity>();
public Long getId() { public Long getId() {
return this.id; return this.id;
...@@ -77,6 +127,58 @@ public class Questionnaire implements Serializable { ...@@ -77,6 +127,58 @@ public class Questionnaire implements Serializable {
this.id = id; this.id = id;
} }
public String getName() {
return this.name;
}
public Questionnaire name(String name) {
this.setName(name);
return this;
}
public void setName(String name) {
this.name = name;
}
public String getEvidences() {
return this.evidences;
}
public Questionnaire evidences(String evidences) {
this.setEvidences(evidences);
return this;
}
public void setEvidences(String evidences) {
this.evidences = evidences;
}
public String getComments() {
return this.comments;
}
public Questionnaire comments(String comments) {
this.setComments(comments);
return this;
}
public void setComments(String comments) {
this.comments = comments;
}
public Long getLastUpdate() {
return this.lastUpdate;
}
public Questionnaire lastUpdate(Long lastUpdate) {
this.setLastUpdate(lastUpdate);
return this;
}
public void setLastUpdate(Long lastUpdate) {
this.lastUpdate = lastUpdate;
}
public Long getFrameworkId() { public Long getFrameworkId() {
return this.frameworkId; return this.frameworkId;
} }
...@@ -90,17 +192,43 @@ public class Questionnaire implements Serializable { ...@@ -90,17 +192,43 @@ public class Questionnaire implements Serializable {
this.frameworkId = frameworkId; this.frameworkId = frameworkId;
} }
public Long getPurposeId() { public Long getControlId() {
return this.purposeId; return this.controlId;
} }
public Questionnaire purposeId(Long purposeId) { public Questionnaire controlId(Long controlId) {
this.setPurposeId(purposeId); this.setControlId(controlId);
return this; return this;
} }
public void setPurposeId(Long purposeId) { public void setControlId(Long controlId) {
this.purposeId = purposeId; this.controlId = controlId;
}
public Long getTomId() {
return this.tomId;
}
public Questionnaire tomId(Long tomId) {
this.setTomId(tomId);
return this;
}
public void setTomId(Long tomId) {
this.tomId = tomId;
}
public Long getAssuranceLevelId() {
return this.assuranceLevelId;
}
public Questionnaire assuranceLevelId(Long assuranceLevelId) {
this.setAssuranceLevelId(assuranceLevelId);
return this;
}
public void setAssuranceLevelId(Long assuranceLevelId) {
this.assuranceLevelId = assuranceLevelId;
} }
public Long getQuestionId() { public Long getQuestionId() {
...@@ -142,6 +270,14 @@ public class Questionnaire implements Serializable { ...@@ -142,6 +270,14 @@ public class Questionnaire implements Serializable {
this.userId = userId; this.userId = userId;
} }
public List<QuestionnaireNonConformity> getQuestionnaireNonConformityList() {
return CollectionUtil.isNullOrEmpty(questionnaireNonConformityList) ? new ArrayList<QuestionnaireNonConformity>() : questionnaireNonConformityList;
}
public void setQuestionnaireNonConformityList(List<QuestionnaireNonConformity> questionnaireNonConformityList) {
this.questionnaireNonConformityList = CollectionUtil.isNullOrEmpty(questionnaireNonConformityList) ? new ArrayList<QuestionnaireNonConformity>() : questionnaireNonConformityList;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) { if (this == o) {
...@@ -163,8 +299,14 @@ public class Questionnaire implements Serializable { ...@@ -163,8 +299,14 @@ public class Questionnaire implements Serializable {
public String toString() { public String toString() {
return "Questionnaire{" + return "Questionnaire{" +
"id=" + getId() + "id=" + getId() +
", name='" + getName() + "'" +
", evidences='" + getEvidences() + "'" +
", comments='" + getComments() + "'" +
", lastUpdate='" + getLastUpdate() + "'" +
", frameworkId='" + getFrameworkId() + "'" + ", frameworkId='" + getFrameworkId() + "'" +
", purposeId='" + getPurposeId() + "'" + ", controlId='" + getControlId() + "'" +
", tomId='" + getTomId() + "'" +
", assuranceLevelId='" + getAssuranceLevelId() + "'" +
", questionId='" + getQuestionId() + "'" + ", questionId='" + getQuestionId() + "'" +
", answerId='" + getAnswerId() + "'" + ", answerId='" + getAnswerId() + "'" +
", userId='" + getUserId() + "'" + ", userId='" + getUserId() + "'" +
......
package com.medina.coc.backend.domain;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import com.medina.coc.backend.domain.key.QuestionnaireNonConformityId;
/**
* QuestionnaireNonConformity entity.\n\n@author Diego Rosado
*/
@Entity
@Table(name = "questionnaire_non_conformities")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@IdClass(QuestionnaireNonConformityId.class)
public class QuestionnaireNonConformity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* questionnaireName
*/
@Id
@Column(name = "questionnaire_name")
private String questionnaireName;
/**
* tomId
*/
@Id
@Column(name = "tom_id")
private Long tomId;
/**
* comments
*/
@NotNull
@Column(name = "comments", nullable = false)
private String comments;
/**
* compliance
*/
@NotNull
@Column(name = "compliance", nullable = false)
private String compliance;
public QuestionnaireNonConformity() {}
public QuestionnaireNonConformity(String questionnaireName, Long tomId,
String comments, String compliance) {
this.questionnaireName = questionnaireName;
this.tomId = tomId;
this.comments = comments;
this.compliance = compliance;
}
public String getQuestionnaireName() {
return this.questionnaireName;
}
public QuestionnaireNonConformity questionnaireName(String questionnaireName) {
this.setQuestionnaireName(questionnaireName);
return this;
}
public void setQuestionnaireName(String questionnaireName) {
this.questionnaireName = questionnaireName;
}
public Long getTomId() {
return this.tomId;
}
public QuestionnaireNonConformity tomId(Long tomId) {
this.setTomId(tomId);
return this;
}
public void setTomId(Long tomId) {
this.tomId = tomId;
}
public String getComments() {
return this.comments;
}
public QuestionnaireNonConformity comments(String comments) {
this.setComments(comments);
return this;
}
public void setComments(String comments) {
this.comments = comments;
}
public String getCompliance() {
return this.compliance;
}
public QuestionnaireNonConformity compliance(String compliance) {
this.setCompliance(compliance);
return this;
}
public void setCompliance(String compliance) {
this.compliance = compliance;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QuestionnaireNonConformity)) {
return false;
}
return tomId != null && tomId.equals(((QuestionnaireNonConformity) o).tomId);
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "QuestionnaireNonConformity{" +
"questionnaireName=" + getQuestionnaireName() +
", tomId='" + getTomId() + "'" +
", comments='" + getComments() + "'" +
", compliance='" + getCompliance() + "'" +
"}";
}
}
...@@ -52,20 +52,6 @@ public class SecurityControl implements Serializable { ...@@ -52,20 +52,6 @@ public class SecurityControl implements Serializable {
@Column(name = "description", nullable = false) @Column(name = "description", nullable = false)
private String description; private String description;
/**
* guidance
*/
@NotNull
@Column(name = "guidance", nullable = false)
private String guidance;
/**
* riskReductionWeight
*/
@NotNull
@Column(name = "risk_reduction_weight", nullable = false)
private Float riskReductionWeight;
@OneToMany(mappedBy = "securityControl") @OneToMany(mappedBy = "securityControl")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@JsonIgnoreProperties(value = { "securityControl" }, allowSetters = true) @JsonIgnoreProperties(value = { "securityControl" }, allowSetters = true)
...@@ -153,32 +139,6 @@ public class SecurityControl implements Serializable { ...@@ -153,32 +139,6 @@ public class SecurityControl implements Serializable {
this.description = description; this.description = description;
} }
public String getGuidance() {
return this.guidance;
}
public SecurityControl guidance(String guidance) {
this.setGuidance(guidance);
return this;
}
public void setGuidance(String guidance) {
this.guidance = guidance;
}
public Float getRiskReductionWeight() {
return this.riskReductionWeight;
}
public SecurityControl riskReductionWeight(Float riskReductionWeight) {
this.setRiskReductionWeight(riskReductionWeight);
return this;
}
public void setRiskReductionWeight(Float riskReductionWeight) {
this.riskReductionWeight = riskReductionWeight;
}
public Set<SimilarControl> getSimilarControls() { public Set<SimilarControl> getSimilarControls() {
return this.similarControls; return this.similarControls;
} }
...@@ -276,8 +236,6 @@ public class SecurityControl implements Serializable { ...@@ -276,8 +236,6 @@ public class SecurityControl implements Serializable {
", name='" + getName() + "'" + ", name='" + getName() + "'" +
", objective='" + getObjective() + "'" + ", objective='" + getObjective() + "'" +
", description='" + getDescription() + "'" + ", description='" + getDescription() + "'" +
", guidance='" + getGuidance() + "'" +
", riskReductionWeight=" + getRiskReductionWeight() +
"}"; "}";
} }
} }
...@@ -63,6 +63,12 @@ public class Tom implements Serializable { ...@@ -63,6 +63,12 @@ public class Tom implements Serializable {
@Column(name = "type", nullable = false) @Column(name = "type", nullable = false)
private Type type; private Type type;
/**
* guidance
*/
@Column(name = "guidance", nullable = true)
private String guidance;
@ManyToOne(optional = false) @ManyToOne(optional = false)
@NotNull @NotNull
@JsonIgnoreProperties(value = { "similarControls", "securityControlCategory", "resources" }, allowSetters = true) @JsonIgnoreProperties(value = { "similarControls", "securityControlCategory", "resources" }, allowSetters = true)
...@@ -152,6 +158,19 @@ public class Tom implements Serializable { ...@@ -152,6 +158,19 @@ public class Tom implements Serializable {
this.type = type; this.type = type;
} }
public String getGuidance() {
return this.guidance;
}
public Tom guidance(String guidance) {
this.setGuidance(guidance);
return this;
}
public void setGuidance(String guidance) {
this.guidance = guidance;
}
public SecurityControl getSecurityControl() { public SecurityControl getSecurityControl() {
return this.securityControl; return this.securityControl;
} }
...@@ -207,6 +226,7 @@ public class Tom implements Serializable { ...@@ -207,6 +226,7 @@ public class Tom implements Serializable {
", description='" + getDescription() + "'" + ", description='" + getDescription() + "'" +
", assuranceLevel='" + getAssuranceLevel() + "'" + ", assuranceLevel='" + getAssuranceLevel() + "'" +
", type='" + getType() + "'" + ", type='" + getType() + "'" +
", guidance='" + getGuidance() + "'" +
"}"; "}";
} }
} }
...@@ -48,6 +48,10 @@ public class User extends AbstractAuditingEntity implements Serializable { ...@@ -48,6 +48,10 @@ public class User extends AbstractAuditingEntity implements Serializable {
@Column(length = 254, unique = true) @Column(length = 254, unique = true)
private String email; private String email;
@Size(min = 255)
@Column(length = 255)
private String company;
@NotNull @NotNull
@Column(nullable = false) @Column(nullable = false)
private boolean activated = false; private boolean activated = false;
...@@ -112,6 +116,14 @@ public class User extends AbstractAuditingEntity implements Serializable { ...@@ -112,6 +116,14 @@ public class User extends AbstractAuditingEntity implements Serializable {
this.email = email; this.email = email;
} }
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getImageUrl() { public String getImageUrl() {
return imageUrl; return imageUrl;
} }
...@@ -169,6 +181,7 @@ public class User extends AbstractAuditingEntity implements Serializable { ...@@ -169,6 +181,7 @@ public class User extends AbstractAuditingEntity implements Serializable {
", firstName='" + firstName + '\'' + ", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' + ", lastName='" + lastName + '\'' +
", email='" + email + '\'' + ", email='" + email + '\'' +
", company='" + company + '\'' +
", imageUrl='" + imageUrl + '\'' + ", imageUrl='" + imageUrl + '\'' +
", activated='" + activated + '\'' + ", activated='" + activated + '\'' +
", langKey='" + langKey + '\'' + ", langKey='" + langKey + '\'' +
......
...@@ -4,9 +4,9 @@ package com.medina.coc.backend.domain.enumeration; ...@@ -4,9 +4,9 @@ package com.medina.coc.backend.domain.enumeration;
* The AssuranceLevel enumeration. * The AssuranceLevel enumeration.
*/ */
public enum AssuranceLevel { public enum AssuranceLevel {
BASIC("Basic"), Basic("Basic"),
SUBSTANTIAL("Substantial"), Substantial("Substantial"),
HIGH("High"); High("High");
private final String value; private final String value;
......
package com.medina.coc.backend.domain.enumeration;
/**
* The AssuranceLevelId enumeration.
*/
public enum AssuranceLevelId {
Basic("1"),
Substantial("2"),
High("3");
private final String value;
AssuranceLevelId(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
package com.medina.coc.backend.domain.enumeration;
/**
* The AssuranceLevel enumeration.
*/
public enum AuditLogs {
FRAMEWORKS("Frameworks"),
CATEGORIES("Categories"),
CONTROLS("Controls"),
REQUIREMENTS("Requirements"),
SIMILAR_CONTROLS("Similar Controls"),
IMPLEMENTATION_GUIDELINES("Implementation Guidelines");
private final String value;
AuditLogs(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
package com.medina.coc.backend.domain.key;
import java.io.Serializable;
/**
* Primary Key for QuestionnaireNonConformityId entity.
*/
public class QuestionnaireNonConformityId implements Serializable {
private static final long serialVersionUID = 1L;
/**
* questionnaireName
*/
private String questionnaireName;
/**
* tomId
*/
private Long tomId;
public String getQuestionnaireName() {
return this.questionnaireName;
}
public void setQuestionnaireName(String questionnaireName) {
this.questionnaireName = questionnaireName;
}
public Long getTomId() {
return this.tomId;
}
public void setTomId(Long tomId) {
this.tomId = tomId;
}
@Override
public int hashCode() {
// see https://vladmihalcea.com/how-to-implement-equals-and-hashcode-using-the-jpa-entity-identifier/
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "QuestionnaireNonConformityId{" +
"questionnaireName=" + getQuestionnaireName() +
", tomId='" + getTomId() + "'" +
"}";
}
}
package com.medina.coc.backend.domain.request;
import java.io.Serializable;
/**
* QuestionnaireCloudService entity.
*/
public class QuestionnaireCloudService implements Serializable {
private static final long serialVersionUID = 1L;
private String id;
private String name;
public QuestionnaireCloudService() {}
public QuestionnaireCloudService(final String id, final String name) {
this.id = id;
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.id = name;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof QuestionnaireCloudService)) {
return false;
}
return id != null && id.equals(((QuestionnaireCloudService) o).id);
}
@Override
public int hashCode() {
return getClass().hashCode();
}
// prettier-ignore
@Override
public String toString() {
return "QuestionnaireCloudService{" +
"id=" + getId() +
", name='" + getName() + "'" +
"}";
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment