diff --git a/server/src/main/java/com/objectcomputing/checkins/services/action_item/ActionItem.java b/server/src/main/java/com/objectcomputing/checkins/services/action_item/ActionItem.java index 4867a6e6f0..ef601288e6 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/action_item/ActionItem.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/action_item/ActionItem.java @@ -48,9 +48,10 @@ public class ActionItem { @Schema(description = "description of the action item") private String description; + @NotNull @Column(name = "priority") @Schema(description = "Allow for a user defined display order") - private double priority; + private Double priority; public ActionItem(UUID checkinid, UUID createdbyid, String description) { this(null, checkinid, createdbyid, description); @@ -60,11 +61,9 @@ public ActionItem(UUID id, UUID checkinid, UUID createdbyid, String description) this(id, checkinid, createdbyid, description, 1.0); } - public ActionItem(UUID checkinid, UUID createdbyid, String description, double priority) { - this(null, checkinid, createdbyid, description, priority); - } + public ActionItem() {} - public ActionItem(UUID id, UUID checkinid, UUID createdbyid, String description, double priority) { + public ActionItem(UUID id, UUID checkinid, UUID createdbyid, @Nullable String description, Double priority) { this.id = id; this.checkinid = checkinid; this.createdbyid = createdbyid; @@ -96,19 +95,21 @@ public void setCreatedbyid(UUID createdbyid) { this.createdbyid = createdbyid; } + @Nullable public String getDescription() { return description; } - public void setDescription(String description) { + public void setDescription(@Nullable String description) { this.description = description; } - public double getPriority() { + @SuppressWarnings("unused") + public Double getPriority() { return priority; } - public void setPriority(double priority) { + public void setPriority(Double priority) { this.priority = priority; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/agenda_item/AgendaItem.java b/server/src/main/java/com/objectcomputing/checkins/services/agenda_item/AgendaItem.java index 21bf159e29..ef62a650fb 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/agenda_item/AgendaItem.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/agenda_item/AgendaItem.java @@ -48,9 +48,10 @@ public class AgendaItem { @Schema(description = "description of the agenda item") private String description; + @NotNull @Column(name = "priority") @Schema(description = "Allow for a user defined display order") - private double priority; + private Double priority; public AgendaItem(UUID checkinid, UUID createdbyid, String description) { this(null, checkinid, createdbyid, description); @@ -60,11 +61,9 @@ public AgendaItem(UUID id, UUID checkinid, UUID createdbyid, String description) this(id, checkinid, createdbyid, description, 1.0); } - public AgendaItem(UUID checkinid, UUID createdbyid, String description, double priority) { - this(null, checkinid, createdbyid, description, priority); - } + public AgendaItem() {} - public AgendaItem(UUID id, UUID checkinid, UUID createdbyid, String description, double priority) { + public AgendaItem(UUID id, UUID checkinid, UUID createdbyid, @Nullable String description, Double priority) { this.id = id; this.checkinid = checkinid; this.createdbyid = createdbyid; @@ -96,19 +95,21 @@ public void setCreatedbyid(UUID createdbyid) { this.createdbyid = createdbyid; } + @Nullable public String getDescription() { return this.description; } - public void setDescription(String description) { + public void setDescription(@Nullable String description) { this.description = description; } - public double getPriority() { + @SuppressWarnings("unused") + public Double getPriority() { return priority; } - public void setPriority(double priority) { + public void setPriority(Double priority) { this.priority = priority; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHours.java b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHours.java index f82789205a..6cefafa8b3 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHours.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHours.java @@ -17,6 +17,7 @@ @Entity @Table(name = "employee_hours") public class EmployeeHours { + @Id @Column(name = "id") @AutoPopulated @@ -30,22 +31,23 @@ public class EmployeeHours { @Schema(description = "employee id", required = true) private String employeeId; - @NotNull @Column(name="contributionhours") @TypeDef(type = DataType.FLOAT) - @Schema(description ="contribution hours of employee", required=true) - private float contributionHours; + @Schema(description ="contribution hours of employee", required = true) + private Float contributionHours; + @NotNull @Column(name="billablehours") @TypeDef(type = DataType.FLOAT) @Schema(description ="billable hours of employee") - private float billableHours; + private Float billableHours; + @NotNull @Column(name="ptohours") @TypeDef(type = DataType.FLOAT) @Schema(description ="PTO hours of employee") - private float ptoHours; + private Float ptoHours; @Column(name="updateddate") @NotNull @@ -55,29 +57,28 @@ public class EmployeeHours { @Column(name="targethours") @NotNull @Schema(description = "Target hours for an employee", required = true) - private float targetHours; + private Float targetHours; @Column(name="asofdate") @Schema(description = "as of Date") private LocalDate asOfDate; - - - public EmployeeHours(UUID id, @NotNull String employeeId, @NotNull float contributionHours, float billableHours, float ptoHours,LocalDate updatedDate,float targetHours, LocalDate asOfDate) { + public EmployeeHours(UUID id, @NotNull String employeeId, @NotNull Float contributionHours, Float billableHours, Float ptoHours, LocalDate updatedDate, Float targetHours, LocalDate asOfDate) { this.id = id; this.employeeId = employeeId; this.contributionHours = contributionHours; this.billableHours = billableHours; this.ptoHours = ptoHours; - this.updatedDate=updatedDate; - this.targetHours= targetHours; - this.asOfDate= asOfDate; + this.updatedDate = updatedDate; + this.targetHours = targetHours; + this.asOfDate = asOfDate; } - public EmployeeHours(@NotNull String employeeId, @NotNull float contributionHours, float billableHours, float ptoHours,LocalDate updatedDate, float targetHours, LocalDate asOfDate) { - this(null,employeeId,contributionHours,billableHours,ptoHours,updatedDate,targetHours,asOfDate); + public EmployeeHours(@NotNull String employeeId, @NotNull Float contributionHours, @NotNull Float billableHours, @NotNull Float ptoHours, LocalDate updatedDate, @NotNull Float targetHours, LocalDate asOfDate) { + this(null, employeeId, contributionHours, billableHours, ptoHours, updatedDate, targetHours, asOfDate); } + public EmployeeHours() {} public UUID getId() { return id; @@ -95,27 +96,27 @@ public void setEmployeeId(String employeeId) { this.employeeId = employeeId; } - public float getContributionHours() { + public Float getContributionHours() { return contributionHours; } - public void setContributionHours(float contributionHours) { + public void setContributionHours(Float contributionHours) { this.contributionHours = contributionHours; } - public float getBillableHours() { + public Float getBillableHours() { return billableHours; } - public void setBillableHours(float billableHours) { + public void setBillableHours(Float billableHours) { this.billableHours = billableHours; } - public float getPtoHours() { + public Float getPtoHours() { return ptoHours; } - public void setPtoHours(float ptoHours) { + public void setPtoHours(Float ptoHours) { this.ptoHours = ptoHours; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursResponseDTO.java b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursResponseDTO.java index d565a55f5a..4b008aa891 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursResponseDTO.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursResponseDTO.java @@ -2,36 +2,41 @@ import io.micronaut.core.annotation.Introspected; +import javax.validation.constraints.NotNull; import java.util.Set; @Introspected public class EmployeeHoursResponseDTO { - private long recordCountDeleted; - private long recordCountInserted; - private Set employeehoursSet ; - public long getRecordCountDeleted() { - return recordCountDeleted; - } + @NotNull + private Long recordCountDeleted; - public Set getEmployeehoursSet() { - return employeehoursSet; - } + @NotNull + private Long recordCountInserted; - public void setEmployeehoursSet(Set employeehoursSet) { - this.employeehoursSet = employeehoursSet; + private Set employeehoursSet; + + public Long getRecordCountDeleted() { + return recordCountDeleted; } - public void setRecordCountDeleted(long recordCountDeleted) { + public void setRecordCountDeleted(Long recordCountDeleted) { this.recordCountDeleted = recordCountDeleted; } - public long getRecordCountInserted() { + public Long getRecordCountInserted() { return recordCountInserted; } - public void setRecordCountInserted(long recordCountInserted) { + public void setRecordCountInserted(Long recordCountInserted) { this.recordCountInserted = recordCountInserted; } + public Set getEmployeehoursSet() { + return employeehoursSet; + } + + public void setEmployeehoursSet(Set employeehoursSet) { + this.employeehoursSet = employeehoursSet; + } } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursServicesImpl.java b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursServicesImpl.java index f11c2126f9..bec75c82da 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursServicesImpl.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/employee_hours/EmployeeHoursServicesImpl.java @@ -10,7 +10,6 @@ import org.slf4j.LoggerFactory; import jakarta.inject.Singleton; -import javax.validation.constraints.NotNull; import java.io.IOException; import java.util.*; @@ -49,7 +48,7 @@ public EmployeeHoursResponseDTO save(CompletedFileUpload file) { for(EmployeeHours hours: employeeHoursList) { employeeHours.add(hours); } - responseDTO.setRecordCountInserted(employeeHours.size()); + responseDTO.setRecordCountInserted((long) employeeHours.size()); responseDTO.setEmployeehoursSet(employeeHours); } catch (IOException e) { LOG.error("Error occurred while retrieving files from Google Drive.", e); diff --git a/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/anniversaryreport/AnniversaryReportResponseDTO.java b/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/anniversaryreport/AnniversaryReportResponseDTO.java index a3f34db18b..95bfdfe6c5 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/anniversaryreport/AnniversaryReportResponseDTO.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/anniversaryreport/AnniversaryReportResponseDTO.java @@ -18,8 +18,9 @@ public class AnniversaryReportResponseDTO { @Schema(description = "anniversary date this entry is associated with", required = true) private String anniversary; + @NotNull @Schema(description = "years of service this entry is associated with") - private double yearsOfService; + private Double yearsOfService; @NotNull @Schema(description = "id of the member profile this entry is associated with", required = true) @@ -41,11 +42,11 @@ public void setAnniversary(String anniversary) { this.anniversary = anniversary; } - public double getYearsOfService() { + public Double getYearsOfService() { return yearsOfService; } - public void setYearsOfService(double yearsOfService) { + public void setYearsOfService(Double yearsOfService) { this.yearsOfService = yearsOfService; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/retentionreport/Interval.java b/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/retentionreport/Interval.java index 63274f7d47..d47cff08be 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/retentionreport/Interval.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/memberprofile/retentionreport/Interval.java @@ -2,6 +2,7 @@ import io.micronaut.core.annotation.Introspected; +import javax.validation.constraints.NotNull; import java.time.LocalDate; @Introspected @@ -9,9 +10,10 @@ public class Interval { private LocalDate date; - private float value; + @NotNull + private Float value; - public Interval(LocalDate date, float value) { + public Interval(LocalDate date, Float value) { this.date = date; this.value = value; } @@ -24,11 +26,11 @@ public void setDate(LocalDate date) { this.date = date; } - public float getValue() { + public Float getValue() { return value; } - public void setValue(float value) { + public void setValue(Float value) { this.value = value; } } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriod.java b/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriod.java index 12438da0d4..9ee5330a67 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriod.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriod.java @@ -33,9 +33,10 @@ public class ReviewPeriod { @Schema(description = "The name of the review period", required = true) private String name; + @NotNull @Column(name = "open") @Schema(description = "Whether or not the review period is open") - private boolean open = true; + private Boolean open = true; @Column(name = "review_template_id") @TypeDef(type = DataType.STRING) @@ -56,12 +57,12 @@ public ReviewPeriod(String name) { this(name, true, null, null); } - public ReviewPeriod(UUID id, String name, boolean open) { + public ReviewPeriod(UUID id, String name, Boolean open) { this(name, open, null, null); this.id = id; } - public ReviewPeriod(String name, boolean open, UUID reviewTemplateId, UUID selfReviewTemplateId) { + public ReviewPeriod(String name, Boolean open, @Nullable UUID reviewTemplateId, @Nullable UUID selfReviewTemplateId) { this.name = name; this.open = open; this.reviewTemplateId = reviewTemplateId; @@ -84,17 +85,19 @@ public void setName(String name) { this.name = name; } - public boolean isOpen() { return open; } + public Boolean isOpen() { return open; } - public void setOpen(boolean open) { this.open = open; } + public void setOpen(Boolean open) { this.open = open; } + @Nullable public UUID getReviewTemplateId() { return reviewTemplateId; } - public void setReviewTemplateId(UUID reviewTemplateId) { this.reviewTemplateId = reviewTemplateId; } + public void setReviewTemplateId(@Nullable UUID reviewTemplateId) { this.reviewTemplateId = reviewTemplateId; } + @Nullable public UUID getSelfReviewTemplateId() { return selfReviewTemplateId; } - public void setSelfReviewTemplateId(UUID selfReviewTemplateId) { this.selfReviewTemplateId = selfReviewTemplateId; } + public void setSelfReviewTemplateId(@Nullable UUID selfReviewTemplateId) { this.selfReviewTemplateId = selfReviewTemplateId; } @Override public boolean equals(Object o) { diff --git a/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodCreateDTO.java b/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodCreateDTO.java index 37a1c1a82d..c2b62a45a4 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodCreateDTO.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/reviews/ReviewPeriodCreateDTO.java @@ -13,8 +13,9 @@ public class ReviewPeriodCreateDTO { @Schema(required = true, description = "name of the review period") private String name; + @NotNull @Schema(required = true, description = "whether the review is open") - private boolean open; + private Boolean open; private UUID reviewTemplateId; @@ -28,11 +29,11 @@ public void setName(String name) { this.name = name; } - public boolean isOpen() { + public Boolean isOpen() { return open; } - public void setOpen(boolean open) { + public void setOpen(Boolean open) { this.open = open; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/skill_record/SkillRecord.java b/server/src/main/java/com/objectcomputing/checkins/services/skill_record/SkillRecord.java index 86ef4042ca..f6fa6087ec 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/skill_record/SkillRecord.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/skill_record/SkillRecord.java @@ -7,6 +7,7 @@ import javax.persistence.Column; import javax.persistence.EmbeddedId; import javax.persistence.Table; +import javax.validation.constraints.NotNull; @MappedEntity @Introspected @@ -23,11 +24,13 @@ public class SkillRecord { @Column(name = "description") private String description; + @NotNull @Column(name = "extraneous") - private boolean extraneous; + private Boolean extraneous; + @NotNull @Column(name = "pending") - private boolean pending; + private Boolean pending; @Column(name = "category_name") private String categoryName; @@ -58,19 +61,19 @@ public void setDescription(String description) { this.description = description; } - public boolean isExtraneous() { + public Boolean isExtraneous() { return extraneous; } - public void setExtraneous(boolean extraneous) { + public void setExtraneous(Boolean extraneous) { this.extraneous = extraneous; } - public boolean isPending() { + public Boolean isPending() { return pending; } - public void setPending(boolean pending) { + public void setPending(Boolean pending) { this.pending = pending; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/skills/Skill.java b/server/src/main/java/com/objectcomputing/checkins/services/skills/Skill.java index ac46e288f3..4790317413 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/skills/Skill.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/skills/Skill.java @@ -32,9 +32,10 @@ public class Skill { @Schema(description = "The name of the skill", required = true) private String name; + @NotNull @Column(name = "pending") @Schema(description = "The pending status (approved or not) of the skill") - private boolean pending = true; + private Boolean pending = true; @Column(name = "description") @Schema(description = "The description of the skill") @@ -43,7 +44,7 @@ public class Skill { @NotNull @Column(name = "extraneous") @Schema(description = "The skill is extraneous (or not)", required = true) - private boolean extraneous = false; + private Boolean extraneous = false; public Skill() { } @@ -56,14 +57,14 @@ public Skill(String name, String description) { this(name, true, description, false); } - public Skill(String name, boolean pending, String description, boolean extraneous) { + public Skill(String name, Boolean pending, String description, Boolean extraneous) { this.name = name; this.pending = pending; this.description = description; this.extraneous = extraneous; } - public Skill(UUID id, String name, boolean pending, String description, boolean extraneous) { + public Skill(UUID id, String name, Boolean pending, String description, Boolean extraneous) { this.id = id; this.name = name; this.pending = pending; @@ -87,11 +88,11 @@ public void setName(String name) { this.name = name; } - public boolean isPending() { + public Boolean isPending() { return pending; } - public void setPending(boolean pending) { + public void setPending(Boolean pending) { this.pending = pending; } @@ -103,11 +104,12 @@ public void setDescription(String description) { this.description = description; } - public boolean isExtraneous() { + public Boolean isExtraneous() { return extraneous; } - public void setExtraneous(boolean extraneous) { + @SuppressWarnings("unused") + public void setExtraneous(Boolean extraneous) { this.extraneous = extraneous; } diff --git a/server/src/main/java/com/objectcomputing/checkins/services/skills/SkillCreateDTO.java b/server/src/main/java/com/objectcomputing/checkins/services/skills/SkillCreateDTO.java index 18987084f4..b06817dfd0 100644 --- a/server/src/main/java/com/objectcomputing/checkins/services/skills/SkillCreateDTO.java +++ b/server/src/main/java/com/objectcomputing/checkins/services/skills/SkillCreateDTO.java @@ -12,15 +12,16 @@ public class SkillCreateDTO { @Schema(required = true, description = "name of the skill") private String name; + @NotNull @Schema(required = true, description = "whether the skill is accepted or not") - private boolean pending; + private Boolean pending; @Schema(description = "the description of the skill") private String description; @NotNull @Schema(description = "the skill is extraneous (or not)", required = true) - private boolean extraneous = false; + private Boolean extraneous = false; public String getName() { return name; @@ -30,11 +31,11 @@ public void setName(String name) { this.name = name; } - public boolean isPending() { + public Boolean isPending() { return pending; } - public void setPending(boolean pending) { + public void setPending(Boolean pending) { this.pending = pending; } @@ -46,11 +47,11 @@ public void setDescription(String description) { this.description = description; } - public boolean isExtraneous() { + public Boolean isExtraneous() { return extraneous; } - public void setExtraneous(boolean extraneous) { + public void setExtraneous(Boolean extraneous) { this.extraneous = extraneous; } } diff --git a/server/src/main/resources/application.yml b/server/src/main/resources/application.yml index 64d559ae4f..b77946ef0b 100755 --- a/server/src/main/resources/application.yml +++ b/server/src/main/resources/application.yml @@ -135,3 +135,6 @@ mail-jet: --- github-credentials: github_token: ${ GITHUB_TOKEN } +--- +jackson: + serialization-inclusion: ALWAYS