Skip to content

Commit c6fe2db

Browse files
committed
style: Rename wordingCommitValue and wordingTargetValue #1570
1 parent 92c5146 commit c6fe2db

File tree

21 files changed

+138
-138
lines changed

21 files changed

+138
-138
lines changed

backend/src/main/java/ch/puzzle/okr/dto/keyresult/KeyResultMetricDto.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@JsonDeserialize(as = KeyResultMetricDto.class)
1010
public record KeyResultMetricDto(Long id, int version, String keyResultType, String title, String description,
11-
Double baseline, Double wordingCommitValue, Double wordingTargetValue, Double stretchGoal, UnitDto unit,
11+
Double baseline, Double commitValue, Double targetValue, Double stretchGoal, UnitDto unit,
1212
KeyResultUserDto owner, KeyResultObjectiveDto objective, KeyResultLastCheckInMetricDto lastCheckIn,
1313
LocalDateTime createdOn, LocalDateTime modifiedOn, boolean isWriteable,
1414
List<ActionDto> actionList) implements KeyResultDto {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ch.puzzle.okr.dto.overview;
22

33
public record OverviewKeyResultMetricDto(Long id, String title, String keyResultType, Double baseline,
4-
Double wordingCommitValue, Double wordingTargetValue, Double stretchGoal,
4+
Double commitValue, Double targetValue, Double stretchGoal,
55
OverviewLastCheckInMetricDto lastCheckIn) implements OverviewKeyResultDto {
66
}

backend/src/main/java/ch/puzzle/okr/mapper/OverviewMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ private OverviewKeyResultMetricDto createKeyResultMetricDto(Overview overview) {
104104
overview.getKeyResultTitle(),
105105
overview.getKeyResultType(),
106106
overview.getBaseline(),
107-
overview.getWordingCommitValue(),
108-
overview.getWordingTargetValue(),
107+
overview.getCommitValue(),
108+
overview.getTargetValue(),
109109
overview.getStretchGoal(),
110110
lastCheckIn);
111111
}

backend/src/main/java/ch/puzzle/okr/mapper/keyresult/KeyResultMetricMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public KeyResultDto toDto(KeyResultMetric keyResult, List<Action> actionList) {
6363
keyResult.getTitle(), //
6464
keyResult.getDescription(), //
6565
keyResult.getBaseline(), //
66-
keyResult.getWordingCommitValue(),
67-
keyResult.getWordingTargetValue(),
66+
keyResult.getCommitValue(),
67+
keyResult.getTargetValue(),
6868
keyResult.getStretchGoal(), //
6969
unitMapper.toDto(keyResult.getUnit()), //
7070
ownerDto,
@@ -81,8 +81,8 @@ public KeyResult toKeyResultMetric(KeyResultMetricDto keyResultMetricDto) {
8181
.builder() //
8282
.withBaseline(keyResultMetricDto.baseline()) //
8383
.withStretchGoal(keyResultMetricDto.stretchGoal()) //
84-
.withWordingCommitValue(keyResultMetricDto.wordingCommitValue()) //
85-
.withWordingTargetValue(keyResultMetricDto.wordingTargetValue()) //
84+
.withCommitValue(keyResultMetricDto.commitValue()) //
85+
.withTargetValue(keyResultMetricDto.targetValue()) //
8686
.withUnit(unitBusinessService.findUnitByName(keyResultMetricDto.unit().unitName()))
8787
.withId(keyResultMetricDto.id()) //
8888
.withVersion(keyResultMetricDto.version()) //

backend/src/main/java/ch/puzzle/okr/models/keyresult/KeyResultMetric.java

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class KeyResultMetric extends KeyResult {
1414
@NotNull(message = MessageKey.ATTRIBUTE_NOT_NULL)
1515
private Double baseline;
1616

17-
private Double wordingCommitValue;
17+
private Double commitValue;
1818

19-
private Double wordingTargetValue;
19+
private Double targetValue;
2020

2121
@NotNull(message = MessageKey.ATTRIBUTE_NOT_NULL)
2222
private Double stretchGoal;
@@ -37,20 +37,20 @@ public Double getStretchGoal() {
3737
return stretchGoal;
3838
}
3939

40-
public Double getWordingCommitValue() {
41-
return wordingCommitValue;
40+
public Double getCommitValue() {
41+
return commitValue;
4242
}
4343

44-
public void setWordingCommitValue(Double wordingCommitValue) {
45-
this.wordingCommitValue = wordingCommitValue;
44+
public void setCommitValue(Double commitValue) {
45+
this.commitValue = commitValue;
4646
}
4747

48-
public Double getWordingTargetValue() {
49-
return wordingTargetValue;
48+
public Double getTargetValue() {
49+
return targetValue;
5050
}
5151

52-
public void setWordingTargetValue(Double wordingTargetValue) {
53-
this.wordingTargetValue = wordingTargetValue;
52+
public void setTargetValue(Double targetValue) {
53+
this.targetValue = targetValue;
5454
}
5555

5656
public void setStretchGoal(Double stretchGoal) {
@@ -74,37 +74,37 @@ public boolean equals(Object o) {
7474
if (o instanceof KeyResultMetric keyResultMetric) {
7575
return super.equals(o) && Objects.equals(baseline, keyResultMetric.baseline)
7676
&& Objects.equals(stretchGoal, keyResultMetric.stretchGoal)
77-
&& Objects.equals(wordingCommitValue, keyResultMetric.wordingCommitValue)
78-
&& Objects.equals(wordingTargetValue, keyResultMetric.wordingTargetValue)
77+
&& Objects.equals(commitValue, keyResultMetric.commitValue)
78+
&& Objects.equals(targetValue, keyResultMetric.targetValue)
7979
&& Objects.equals(unit, keyResultMetric.unit);
8080
}
8181
return false;
8282
}
8383

8484
@Override
8585
public int hashCode() {
86-
return Objects.hash(super.hashCode(), baseline, wordingCommitValue, wordingTargetValue, stretchGoal, unit);
86+
return Objects.hash(super.hashCode(), baseline, commitValue, targetValue, stretchGoal, unit);
8787
}
8888

8989
@Override
9090
public String toString() {
91-
return "KeyResultMetric{" + "baseline=" + baseline + ", wordingCommitValue=" + wordingCommitValue
92-
+ ", wordingTargetValue=" + wordingTargetValue + ", stretchGoal=" + stretchGoal + ", unit=" + unit + '}';
91+
return "KeyResultMetric{" + "baseline=" + baseline + ", commitValue=" + commitValue
92+
+ ", targetValue=" + targetValue + ", stretchGoal=" + stretchGoal + ", unit=" + unit + '}';
9393
}
9494

9595
private KeyResultMetric(Builder builder) {
9696
super(builder);
9797
setBaseline(builder.baseline);
98-
setWordingCommitValue(builder.wordingCommitValue);
99-
setWordingTargetValue(builder.wordingTargetValue);
98+
setCommitValue(builder.commitValue);
99+
setTargetValue(builder.targetValue);
100100
setStretchGoal(builder.stretchGoal);
101101
setUnit(builder.unit);
102102
}
103103

104104
public static class Builder extends KeyResult.Builder<Builder> {
105105
private Double baseline;
106-
private Double wordingCommitValue;
107-
private Double wordingTargetValue;
106+
private Double commitValue;
107+
private Double targetValue;
108108
private Double stretchGoal;
109109
private Unit unit;
110110

@@ -131,13 +131,13 @@ public Builder withUnit(Unit unit) {
131131
return this;
132132
}
133133

134-
public Builder withWordingCommitValue(Double wordingCommitValue) {
135-
this.wordingCommitValue = wordingCommitValue;
134+
public Builder withCommitValue(Double commitValue) {
135+
this.commitValue = commitValue;
136136
return this;
137137
}
138138

139-
public Builder withWordingTargetValue(Double wordingTargetValue) {
140-
this.wordingTargetValue = wordingTargetValue;
139+
public Builder withTargetValue(Double targetValue) {
140+
this.targetValue = targetValue;
141141
return this;
142142
}
143143

backend/src/main/java/ch/puzzle/okr/models/overview/Overview.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public class Overview implements WriteableInterface {
2323
private String keyResultTitle;
2424
private String keyResultType;
2525
private Double baseline;
26-
private Double wordingCommitValue;
27-
private Double wordingTargetValue;
26+
private Double commitValue;
27+
private Double targetValue;
2828
private Double stretchGoal;
2929
private String commitZone;
3030
private String targetZone;
@@ -55,8 +55,8 @@ private Overview(Builder builder) {
5555
keyResultTitle = builder.keyResultTitle;
5656
keyResultType = builder.keyResultType;
5757
baseline = builder.baseline;
58-
wordingCommitValue = builder.wordingCommitValue;
59-
wordingTargetValue = builder.wordingTargetValue;
58+
commitValue = builder.commitValue;
59+
targetValue = builder.targetValue;
6060
stretchGoal = builder.stretchGoal;
6161
commitZone = builder.commitZone;
6262
targetZone = builder.targetZone;
@@ -143,12 +143,12 @@ public LocalDateTime getCheckInCreatedOn() {
143143
return checkInCreatedOn;
144144
}
145145

146-
public Double getWordingCommitValue() {
147-
return wordingCommitValue;
146+
public Double getCommitValue() {
147+
return commitValue;
148148
}
149149

150-
public Double getWordingTargetValue() {
151-
return wordingTargetValue;
150+
public Double getTargetValue() {
151+
return targetValue;
152152
}
153153

154154
@Override
@@ -175,8 +175,8 @@ public String toString() {
175175
+ teamVersion + ", objectiveTitle='" + objectiveTitle + '\'' + ", objectiveState=" + objectiveState
176176
+ ", objectiveCreatedOn=" + objectiveCreatedOn + ", quarterId=" + quarterId + ", quarterLabel='"
177177
+ quarterLabel + '\'' + ", keyResultTitle='" + keyResultTitle + '\'' + ", keyResultType='"
178-
+ keyResultType + '\'' + ", baseline=" + baseline + ", wordingCommitValue=" + wordingCommitValue
179-
+ ", wordingTargetValue=" + wordingTargetValue + ", stretchGoal=" + stretchGoal + ", commitZone='"
178+
+ keyResultType + '\'' + ", baseline=" + baseline + ", commitValue=" + commitValue
179+
+ ", targetValue=" + targetValue + ", stretchGoal=" + stretchGoal + ", commitZone='"
180180
+ commitZone + '\'' + ", targetZone='" + targetZone + '\'' + ", stretchZone='" + stretchZone + '\''
181181
+ ", checkInValue=" + checkInValue + ", checkInZone='" + checkInZone + '\'' + ", confidence="
182182
+ confidence + ", checkInCreatedOn=" + checkInCreatedOn + ", writeable=" + writeable
@@ -195,8 +195,8 @@ public static final class Builder {
195195
private String keyResultTitle;
196196
private String keyResultType;
197197
private Double baseline;
198-
private Double wordingCommitValue;
199-
private Double wordingTargetValue;
198+
private Double commitValue;
199+
private Double targetValue;
200200
private Double stretchGoal;
201201
private String commitZone;
202202
private String targetZone;
@@ -268,13 +268,13 @@ public Builder withBaseline(Double baseline) {
268268
return this;
269269
}
270270

271-
public Builder withWordingCommitValue(Double wordingCommitValue) {
272-
this.wordingCommitValue = wordingCommitValue;
271+
public Builder withCommitValue(Double commitValue) {
272+
this.commitValue = commitValue;
273273
return this;
274274
}
275275

276-
public Builder withWordingTargetValue(Double wordingTargetValue) {
277-
this.wordingTargetValue = wordingTargetValue;
276+
public Builder withTargetValue(Double targetValue) {
277+
this.targetValue = targetValue;
278278
return this;
279279
}
280280

backend/src/main/resources/db/h2-db/data-test-h2/V100_0_0__TestData.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ values (4, 1, '', '2023-07-25 08:17:51.309958', 66, 'Build a company culture tha
115115
1, 2, 6, 'ONGOING', null, '2023-07-25 08:39:28.175703');
116116

117117
INSERT INTO key_result (id, version, baseline, description, modified_on, stretch_goal, title, created_by_id,
118-
objective_id, owner_id, key_result_type, created_on, unit_id, commit_zone, target_zone, stretch_zone, wording_commit_value, wording_target_value)
118+
objective_id, owner_id, key_result_type, created_on, unit_id, commit_zone, target_zone, stretch_zone, commit_value, target_value)
119119
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),
120120
(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),
121121
(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),

backend/src/main/resources/db/h2-db/database-h2-schema/V1_0_0__current-db-schema-for-testing.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ create table if not exists key_result
107107
commit_zone varchar(1024),
108108
target_zone varchar(1024),
109109
stretch_zone varchar(1024),
110-
wording_commit_value DOUBLE PRECISION,
111-
wording_target_value DOUBLE PRECISION,
110+
commit_value DOUBLE PRECISION,
111+
target_value DOUBLE PRECISION,
112112
primary key (id),
113113
constraint fk4ba6rgbr8mrkc8vvyqd5il4v9
114114
foreign key (created_by_id) references person,
@@ -189,8 +189,8 @@ SELECT TQ.TEAM_ID AS "TEAM_ID",
189189
COALESCE(KR.ID, -1) AS "KEY_RESULT_ID",
190190
KR.TITLE AS "KEY_RESULT_TITLE",
191191
KR.KEY_RESULT_TYPE AS "KEY_RESULT_TYPE",
192-
KR.WORDING_COMMIT_VALUE,
193-
KR.WORDING_TARGET_VALUE,
192+
KR.COMMIT_VALUE,
193+
KR.TARGET_VALUE,
194194
KR.BASELINE,
195195
KR.STRETCH_GOAL,
196196
KR.COMMIT_ZONE,
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
ALTER TABLE key_result
2-
ADD COLUMN IF NOT EXISTS wording_commit_value DOUBLE PRECISION,
3-
ADD COLUMN IF NOT EXISTS wording_target_value DOUBLE PRECISION;
2+
ADD COLUMN IF NOT EXISTS commit_value DOUBLE PRECISION,
3+
ADD COLUMN IF NOT EXISTS target_value DOUBLE PRECISION;
44

55
UPDATE key_result
6-
SET wording_commit_value = ROUND(((COALESCE(stretch_goal, 0) - COALESCE(baseline, 0)) * 0.3 + COALESCE(baseline, 0))::numeric, 2),
7-
wording_target_value = ROUND(((COALESCE(stretch_goal, 0) - COALESCE(baseline, 0)) * 0.7 + COALESCE(baseline, 0))::numeric, 2)
8-
WHERE wording_commit_value IS NULL
9-
AND wording_target_value IS NULL;
6+
SET commit_value = ROUND(((COALESCE(stretch_goal, 0) - COALESCE(baseline, 0)) * 0.3 + COALESCE(baseline, 0))::numeric, 2),
7+
target_value = ROUND(((COALESCE(stretch_goal, 0) - COALESCE(baseline, 0)) * 0.7 + COALESCE(baseline, 0))::numeric, 2)
8+
WHERE commit_value IS NULL
9+
AND target_value IS NULL;

backend/src/main/resources/db/migration/V3_6_2__addMetricKeyResultGoalsToOverview.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ SELECT tq.team_id AS "team_id",
1313
kr.title AS "key_result_title",
1414
kr.key_result_type AS "key_result_type",
1515
kr.baseline,
16-
kr.wording_commit_value,
17-
kr.wording_target_value,
16+
kr.commit_value,
17+
kr.target_value,
1818
kr.stretch_goal,
1919
kr.commit_zone,
2020
kr.target_zone,

0 commit comments

Comments
 (0)