Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

@JsonDeserialize(as = KeyResultMetricDto.class)
public record KeyResultMetricDto(Long id, int version, String keyResultType, String title, String description,
Double baseline, Double stretchGoal, UnitDto unit, KeyResultUserDto owner, KeyResultObjectiveDto objective,
KeyResultLastCheckInMetricDto lastCheckIn, LocalDateTime createdOn, LocalDateTime modifiedOn,
boolean isWriteable, List<ActionDto> actionList) implements KeyResultDto {
Double baseline, Double commitValue, Double targetValue, Double stretchGoal, UnitDto unit,
KeyResultUserDto owner, KeyResultObjectiveDto objective, KeyResultLastCheckInMetricDto lastCheckIn,
LocalDateTime createdOn, LocalDateTime modifiedOn, boolean isWriteable,
List<ActionDto> actionList) implements KeyResultDto {
@Override
public List<ActionDto> getActionList() {
return actionList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ch.puzzle.okr.dto.overview;

public record OverviewKeyResultMetricDto(Long id, String title, String keyResultType, String unit, Double baseline,
Double stretchGoal, OverviewLastCheckInMetricDto lastCheckIn) implements OverviewKeyResultDto {
public record OverviewKeyResultMetricDto(Long id, String title, String keyResultType, Double baseline,
Double commitValue, Double targetValue, Double stretchGoal,
OverviewLastCheckInMetricDto lastCheckIn) implements OverviewKeyResultDto {
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@ private OverviewKeyResultMetricDto createKeyResultMetricDto(Overview overview) {
return new OverviewKeyResultMetricDto(overview.getOverviewId().getKeyResultId(),
overview.getKeyResultTitle(),
overview.getKeyResultType(),
overview.getUnit(),
overview.getBaseline(),
overview.getCommitValue(),
overview.getTargetValue(),
overview.getStretchGoal(),
lastCheckIn);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public KeyResultDto toDto(KeyResultMetric keyResult, List<Action> actionList) {
keyResult.getTitle(), //
keyResult.getDescription(), //
keyResult.getBaseline(), //
keyResult.getCommitValue(),
keyResult.getTargetValue(),
keyResult.getStretchGoal(), //
unitMapper.toDto(keyResult.getUnit()), //
ownerDto,
Expand All @@ -79,6 +81,8 @@ public KeyResult toKeyResultMetric(KeyResultMetricDto keyResultMetricDto) {
.builder() //
.withBaseline(keyResultMetricDto.baseline()) //
.withStretchGoal(keyResultMetricDto.stretchGoal()) //
.withCommitValue(keyResultMetricDto.commitValue()) //
.withTargetValue(keyResultMetricDto.targetValue()) //
.withUnit(unitBusinessService.findUnitByName(keyResultMetricDto.unit().unitName()))
.withId(keyResultMetricDto.id()) //
.withVersion(keyResultMetricDto.version()) //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public class KeyResultMetric extends KeyResult {
@NotNull(message = MessageKey.ATTRIBUTE_NOT_NULL)
private Double baseline;

private Double commitValue;

private Double targetValue;

@NotNull(message = MessageKey.ATTRIBUTE_NOT_NULL)
private Double stretchGoal;

Expand All @@ -33,6 +37,22 @@ public Double getStretchGoal() {
return stretchGoal;
}

public Double getCommitValue() {
return commitValue;
}

public void setCommitValue(Double commitValue) {
this.commitValue = commitValue;
}

public Double getTargetValue() {
return targetValue;
}

public void setTargetValue(Double targetValue) {
this.targetValue = targetValue;
}

public void setStretchGoal(Double stretchGoal) {
this.stretchGoal = stretchGoal;
}
Expand All @@ -54,31 +74,37 @@ public boolean equals(Object o) {
if (o instanceof KeyResultMetric keyResultMetric) {
return super.equals(o) && Objects.equals(baseline, keyResultMetric.baseline)
&& Objects.equals(stretchGoal, keyResultMetric.stretchGoal)
&& Objects.equals(commitValue, keyResultMetric.commitValue)
&& Objects.equals(targetValue, keyResultMetric.targetValue)
&& Objects.equals(unit, keyResultMetric.unit);
}
return false;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), baseline, stretchGoal, unit);
return Objects.hash(super.hashCode(), baseline, commitValue, targetValue, stretchGoal, unit);
}

@Override
public String toString() {
return super.toString() + "KeyResultMetric{" + "baseline=" + baseline + ", stretchGoal=" + stretchGoal
+ ", unit='" + unit + '\'' + '}';
return "KeyResultMetric{" + "baseline=" + baseline + ", commitValue=" + commitValue + ", targetValue="
+ targetValue + ", stretchGoal=" + stretchGoal + ", unit=" + unit + '}';
}

private KeyResultMetric(Builder builder) {
super(builder);
setBaseline(builder.baseline);
setCommitValue(builder.commitValue);
setTargetValue(builder.targetValue);
setStretchGoal(builder.stretchGoal);
setUnit(builder.unit);
}

public static class Builder extends KeyResult.Builder<Builder> {
private Double baseline;
private Double commitValue;
private Double targetValue;
private Double stretchGoal;
private Unit unit;

Expand All @@ -105,6 +131,16 @@ public Builder withUnit(Unit unit) {
return this;
}

public Builder withCommitValue(Double commitValue) {
this.commitValue = commitValue;
return this;
}

public Builder withTargetValue(Double targetValue) {
this.targetValue = targetValue;
return this;
}

@Override
public KeyResult build() {
return new KeyResultMetric(this);
Expand Down
48 changes: 30 additions & 18 deletions backend/src/main/java/ch/puzzle/okr/models/overview/Overview.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ public class Overview implements WriteableInterface {
private String keyResultTitle;
private String keyResultType;
private Double baseline;
private Double commitValue;
private Double targetValue;
private Double stretchGoal;
private String unit;
private String commitZone;
private String targetZone;
private String stretchZone;
Expand Down Expand Up @@ -54,8 +55,9 @@ private Overview(Builder builder) {
keyResultTitle = builder.keyResultTitle;
keyResultType = builder.keyResultType;
baseline = builder.baseline;
commitValue = builder.commitValue;
targetValue = builder.targetValue;
stretchGoal = builder.stretchGoal;
unit = builder.unit;
commitZone = builder.commitZone;
targetZone = builder.targetZone;
stretchZone = builder.stretchZone;
Expand Down Expand Up @@ -113,10 +115,6 @@ public Double getStretchGoal() {
return stretchGoal;
}

public String getUnit() {
return unit;
}

public String getCommitZone() {
return commitZone;
}
Expand Down Expand Up @@ -145,6 +143,14 @@ public LocalDateTime getCheckInCreatedOn() {
return checkInCreatedOn;
}

public Double getCommitValue() {
return commitValue;
}

public Double getTargetValue() {
return targetValue;
}

@Override
public boolean isWriteable() {
return writeable;
Expand All @@ -165,15 +171,15 @@ public void setBacklogQuarter(boolean backlogQuarter) {

@Override
public String toString() {
return "Overview{" + "overviewId=" + overviewId + ", teamVersion='" + teamVersion + ", teamName='" + teamName
+ '\'' + ", objectiveTitle='" + objectiveTitle + '\'' + ", objectiveState=" + objectiveState
return "Overview{" + "overviewId=" + overviewId + ", teamName='" + teamName + '\'' + ", teamVersion="
+ teamVersion + ", objectiveTitle='" + objectiveTitle + '\'' + ", objectiveState=" + objectiveState
+ ", objectiveCreatedOn=" + objectiveCreatedOn + ", quarterId=" + quarterId + ", quarterLabel='"
+ quarterLabel + '\'' + ", keyResultTitle='" + keyResultTitle + '\'' + ", keyResultType='"
+ keyResultType + '\'' + ", baseline=" + baseline + ", stretchGoal=" + stretchGoal + ", unit='" + unit
+ '\'' + ", commitZone='" + commitZone + '\'' + ", targetZone='" + targetZone + '\'' + ", stretchZone='"
+ stretchZone + '\'' + ", checkInValue=" + checkInValue + ", checkInZone='" + checkInZone + '\''
+ ", confidence=" + confidence + ", createdOn=" + checkInCreatedOn + ", writeable=" + writeable + '\''
+ '}';
+ keyResultType + '\'' + ", baseline=" + baseline + ", commitValue=" + commitValue + ", targetValue="
+ targetValue + ", stretchGoal=" + stretchGoal + ", commitZone='" + commitZone + '\'' + ", targetZone='"
+ targetZone + '\'' + ", stretchZone='" + stretchZone + '\'' + ", checkInValue=" + checkInValue
+ ", checkInZone='" + checkInZone + '\'' + ", confidence=" + confidence + ", checkInCreatedOn="
+ checkInCreatedOn + ", writeable=" + writeable + ", backlogQuarter=" + backlogQuarter + '}';
}

public static final class Builder {
Expand All @@ -188,8 +194,9 @@ public static final class Builder {
private String keyResultTitle;
private String keyResultType;
private Double baseline;
private Double commitValue;
private Double targetValue;
private Double stretchGoal;
private String unit;
private String commitZone;
private String targetZone;
private String stretchZone;
Expand Down Expand Up @@ -260,13 +267,18 @@ public Builder withBaseline(Double baseline) {
return this;
}

public Builder withStretchGoal(Double stretchGoal) {
this.stretchGoal = stretchGoal;
public Builder withCommitValue(Double commitValue) {
this.commitValue = commitValue;
return this;
}

public Builder withTargetValue(Double targetValue) {
this.targetValue = targetValue;
return this;
}

public Builder withUnit(String unit) {
this.unit = unit;
public Builder withStretchGoal(Double stretchGoal) {
this.stretchGoal = stretchGoal;
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,23 +115,23 @@ values (4, 1, '', '2023-07-25 08:17:51.309958', 66, 'Build a company culture tha
1, 2, 6, 'ONGOING', null, '2023-07-25 08:39:28.175703');

INSERT INTO key_result (id, version, baseline, description, modified_on, stretch_goal, title, created_by_id,
objective_id, owner_id, key_result_type, created_on, unit_id, commit_zone, target_zone, stretch_zone)
VALUES (10,1, 465, '', '2023-07-25 08:23:02.273028', 60, 'Im Durchschnitt soll die Lautstärke 60dB nicht überschreiten', 1, 5, 1, 'metric', '2023-07-25 08:23:02.273028', 1, null, null, null),
(8,1, 213425, '', '2023-07-25 08:19:44.351252', 80, 'High employee satisfaction scores (80%+) throughout the year.', 1, 4, 1, 'metric', '2023-07-25 08:19:44.351252', 1, null, null, null),
(7,1, 84, '', '2023-07-25 08:19:13.569300', 4, 'Monthly town halls between our people and leadership teams over the next four months.', 1, 4, 1, 'metric', '2023-07-25 08:19:13.569300', 1, null, null, null),
(6,1, 5, '', '2023-07-25 08:18:44.087674', 1, 'New structure that rewards funny guys and innovation before the end of Q1.', 1, 4, 1, 'metric', '2023-07-25 08:18:44.087674', 1, null, null, null),
(15,1, 0, 'asf', '2023-07-25 08:40:49.412684', 1, ' Lorem ipsum dolor sit amet', 1, 9, 1, 'metric', '2023-07-25 08:40:49.412684', 1, null, null, null),
(5,1, null, '', '2023-07-25 08:16:24.466383', null, 'Kundenzufriedenheitsumfrage soll mindestens einmal pro 2 Wochen durchgeführt werden. ', 1, 3, 1, 'ordinal', '2023-07-25 08:16:24.466383', 1, 'Fisch', 'Hai', 'MEG'),
(12,1, 0, '', '2023-07-25 08:28:45.110759', 80, 'Wir wollen bereits nach Q1 rund 80% des Redesigns vom OKR-Tool abgeschlossen haben. ', 1, 6, 1, 'metric', '2023-07-25 08:28:45.110759', 1, null, null, null),
(4,1, null, '', '2023-07-25 08:15:18.244565', null, 'Antwortzeit für Supportanfragen um 33% verkürzen.', 1, 3, 1, 'ordinal', '2023-07-25 08:15:18.244565', 1, 'Pflanze', 'Baum', 'Wald'),
(13,1, 43, '', '2023-07-25 08:29:57.709926', 15, 'Jedes Woche wird ein Kuchen vom BBT für Puzzle Organisiert', 1, 6, 1, 'metric', '2023-07-25 08:29:57.709926', 1, null, null, null),
(3,1, 0, '', '2023-07-25 08:14:31.964115', 25, 'Steigern der URS um 25%', 1, 3, 1, 'metric', '2023-07-25 08:14:31.964115', 1, null, null, null),
(14,1, 0, '', '2023-07-25 08:31:39.249943', 20, 'Das BBT hilft den Membern 20% mehr beim Töggelen', 1, 6, 1, 'metric', '2023-07-25 08:31:39.249943', 1, null, null, null),
(16,1, 200, '', '2023-07-25 08:41:24.592007', 1, 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', 1, 9, 1, 'metric', '2023-07-25 08:41:24.592007', 1, null, null, null),
(19,1, 50, 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', '2023-07-25 08:42:56.407125', 1, 'nsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At ', 1, 8, 1, 'metric', '2023-07-25 08:42:56.407125', 1, null, null, null),
(17,1, 525, 'asdf', '2023-07-25 08:41:52.844903', 20000000, 'vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', 1, 9, 1, 'metric', '2023-07-25 08:41:52.844903', 1, null, null, null),
(9,1, 100, '', '2023-07-25 08:48:45.825328', 80, 'Die Member des BBT reduzieren Ihre Lautstärke um 20%', 1, 5, 1, 'metric', '2023-07-25 08:48:45.825328', 1, null, null, null),
(18,1, 0, 'consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', '2023-07-25 08:42:24.779721', 1, 'Lorem', 1, 8, 1, 'metric', '2023-07-25 08:42:24.779721', 1, null, null, null);
objective_id, owner_id, key_result_type, created_on, unit_id, commit_zone, target_zone, stretch_zone, commit_value, target_value)
VALUES (10,1, 465, '', '2023-07-25 08:23:02.273028', 60, 'Im Durchschnitt soll die Lautstärke 60dB nicht überschreiten', 1, 5, 1, 'metric', '2023-07-25 08:23:02.273028', 1, null, null, null, 321, 186),
(8,1, 213425, '', '2023-07-25 08:19:44.351252', 80, 'High employee satisfaction scores (80%+) throughout the year.', 1, 4, 1, 'metric', '2023-07-25 08:19:44.351252', 1, null, null, null, 149303.5, 71550.5),
(7,1, 84, '', '2023-07-25 08:19:13.569300', 4, 'Monthly town halls between our people and leadership teams over the next four months.', 1, 4, 1, 'metric', '2023-07-25 08:19:13.569300', 1, null, null, null, 60.0, 28.0),
(6,1, 5, '', '2023-07-25 08:18:44.087674', 1, 'New structure that rewards funny guys and innovation before the end of Q1.', 1, 4, 1, 'metric', '2023-07-25 08:18:44.087674', 1, null, null, null, 3.8, 2.2),
(15,1, 0, 'asf', '2023-07-25 08:40:49.412684', 1, ' Lorem ipsum dolor sit amet', 1, 9, 1, 'metric', '2023-07-25 08:40:49.412684', 1, null, null, null, 0.3, 0.7),
(5,1, null, '', '2023-07-25 08:16:24.466383', null, 'Kundenzufriedenheitsumfrage soll mindestens einmal pro 2 Wochen durchgeführt werden. ', 1, 3, 1, 'ordinal', '2023-07-25 08:16:24.466383', 1, 'Fisch', 'Hai', 'MEG',null,null),
(12,1, 0, '', '2023-07-25 08:28:45.110759', 80, 'Wir wollen bereits nach Q1 rund 80% des Redesigns vom OKR-Tool abgeschlossen haben. ', 1, 6, 1, 'metric', '2023-07-25 08:28:45.110759', 1, null, null, null, 24.0, 56.0),
(4,1, null, '', '2023-07-25 08:15:18.244565', null, 'Antwortzeit für Supportanfragen um 33% verkürzen.', 1, 3, 1, 'ordinal', '2023-07-25 08:15:18.244565', 1, 'Pflanze', 'Baum', 'Wald',null,null),
(13,1, 43, '', '2023-07-25 08:29:57.709926', 15, 'Jedes Woche wird ein Kuchen vom BBT für Puzzle Organisiert', 1, 6, 1, 'metric', '2023-07-25 08:29:57.709926', 1, null, null, null, 35.6, 22.4),
(3,1, 0, '', '2023-07-25 08:14:31.964115', 25, 'Steigern der URS um 25%', 1, 3, 1, 'metric', '2023-07-25 08:14:31.964115', 1, null, null, null, 7.5, 17.5),
(14,1, 0, '', '2023-07-25 08:31:39.249943', 20, 'Das BBT hilft den Membern 20% mehr beim Töggelen', 1, 6, 1, 'metric', '2023-07-25 08:31:39.249943', 1, null, null, null, 6.0, 14.0),
(16,1, 200, '', '2023-07-25 08:41:24.592007', 1, 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.', 1, 9, 1, 'metric', '2023-07-25 08:41:24.592007', 1, null, null, null, 140.3, 80.7),
(19,1, 50, 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', '2023-07-25 08:42:56.407125', 1, 'nsetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At ', 1, 8, 1, 'metric', '2023-07-25 08:42:56.407125', 1, null, null, null, 35.3, 15.7),
(17,1, 525, 'asdf', '2023-07-25 08:41:52.844903', 20000000, 'vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', 1, 9, 1, 'metric', '2023-07-25 08:41:52.844903', 1, null, null, null, 6000000.08, 14000000.08),
(9,1, 100, '', '2023-07-25 08:48:45.825328', 80, 'Die Member des BBT reduzieren Ihre Lautstärke um 20%', 1, 5, 1, 'metric', '2023-07-25 08:48:45.825328', 1, null, null, null, 94.0, 86.0),
(18,1, 0, 'consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lore', '2023-07-25 08:42:24.779721', 1, 'Lorem', 1, 8, 1, 'metric', '2023-07-25 08:42:24.779721', 1, null, null, null, 0.3, 0.7);



Expand Down
Loading
Loading