Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/alignment poc #1174

Draft
wants to merge 127 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
8043711
Finish backend implementation
lkleisa Feb 12, 2024
07e2db7
Finish frontend implementation
lkleisa Feb 12, 2024
cf19358
Delete alignment on kr or ob delete
lkleisa Feb 12, 2024
c5bef30
Write objectivecontroller tests
lkleisa Feb 12, 2024
1923850
Write ObjectiveAuthorizationService tests
lkleisa Feb 12, 2024
b1a2d95
Write AlignmentBusinessService tests
lkleisa Feb 12, 2024
1af132b
Write AlignmentPersistenceService tests
lkleisa Feb 12, 2024
e74760c
Fix AlignmentPersistenceService tests
lkleisa Feb 12, 2024
b91dbaa
Fix frontend model error
lkleisa Feb 12, 2024
8e87033
Write AlignmentValidationService tests
lkleisa Feb 15, 2024
428c28b
Write test for objective form component
lkleisa Feb 15, 2024
12763cc
Fix backend test
lkleisa Feb 15, 2024
a2ef67d
Fix backend tests
lkleisa Feb 15, 2024
f1db1b5
Write e2e tests
lkleisa Feb 15, 2024
1bf81f3
Fix e2e tests
lkleisa Feb 15, 2024
4e951e5
Adjust dropdown width
lkleisa Feb 15, 2024
988590c
Add null check for possibility length
lkleisa Feb 28, 2024
53640fa
Fix frontend test
lkleisa Feb 28, 2024
c865fbd
Fix e2e test
lkleisa Feb 28, 2024
f16244c
Remove alignment when objective quarter change
lkleisa Mar 14, 2024
026e62b
Add missing quarter in testdata and fix bug when editing alignment mu…
lkleisa Apr 25, 2024
6ca46c7
Add Kein Alignment for removing existing alignment
lkleisa Apr 25, 2024
f78d389
Fix backend tests
lkleisa Apr 25, 2024
abf2dff
Fix e2e tests because of new quarter
lkleisa Apr 25, 2024
082853a
Implement typeahead
lkleisa Apr 29, 2024
1a85d42
Sort alignment possibilities alphabetically
lkleisa May 23, 2024
ccc3327
Use bold font for optgroup label
lkleisa May 24, 2024
de88efc
Implement correct filter method for typeahead
lkleisa May 24, 2024
0f31d07
Fix bug with wrong quarter without queryParams
lkleisa May 24, 2024
64ca378
Add scrollLeft on input leave and adjust padding
lkleisa May 24, 2024
692b16e
Remove unused files
lkleisa May 24, 2024
8a0355e
Write backend tests
lkleisa May 27, 2024
427c57c
Clean up frontend
lkleisa May 27, 2024
33c6bf7
Adjust frontend tests
lkleisa May 27, 2024
a85272d
Adjust e2e tests
lkleisa May 27, 2024
436baa3
Fix frontend tests
lkleisa May 29, 2024
bb95ddd
Adjust filter function
lkleisa May 30, 2024
d6c192c
Fix bug with duplicated alignment possibilities
lkleisa Jun 3, 2024
c3be1ad
Simplify backend function
lkleisa Jun 3, 2024
b1cfa43
Add check for alignment in same team
lkleisa Jun 3, 2024
f54a884
Fix sonar code smells
lkleisa Jun 6, 2024
5c43a59
Clean up code
lkleisa Jun 6, 2024
719f14c
Remove AlignmentSelection
lkleisa Jun 7, 2024
cb2b1c4
Refactor code
lkleisa Jun 12, 2024
3d1deb3
[FM] Automated formating frontend
actions-user Jun 12, 2024
89b6967
Remove bug with duplicated alignment possibilities
lkleisa Jun 13, 2024
25de1a0
Use object for alignedEntity
lkleisa Jun 13, 2024
8b14f29
Rename alignmentObjects
lkleisa Jun 13, 2024
da14837
Add new migration with AlignmentView
lkleisa Apr 4, 2024
886befd
Add new model AlignmentView
lkleisa Apr 4, 2024
e40a56d
Add Repository and PersistenceService for AlignmentView
lkleisa Apr 4, 2024
0f22dbb
Add validateOnAlignmentGet Method in AlignmentValidationService
lkleisa Apr 4, 2024
77b618c
Use validation in AlignmentBusinessService
lkleisa Apr 4, 2024
1e75adc
Filter AlignmentViews which are not matching filter
lkleisa Apr 4, 2024
3657e6f
Add alignment data for local development
lkleisa Apr 4, 2024
77c6180
Add new DTOs to return compact data
lkleisa Apr 4, 2024
f571257
Add equals and hashCode for AlignmentView
lkleisa Apr 4, 2024
2e7cf72
Add alignment_view to db schema for testing
lkleisa Apr 4, 2024
12061d9
Implement function for getting Alignments by filters
lkleisa Apr 5, 2024
7ef5075
Add cytoscape.js and @types/cytoscape
lkleisa Apr 5, 2024
5fd014f
Implement tab-switch
lkleisa Apr 5, 2024
c6df3e4
Adjust uniqueId on AlignmentView for full uniqueness
lkleisa Apr 5, 2024
7bf2f11
Add AlignmentService in and get alignment data from filters
lkleisa Apr 5, 2024
74eea1b
Load alignment data on filter change
lkleisa Apr 5, 2024
b8eca02
Add new DiagramComponent and draw draft diagram with real data
lkleisa Apr 5, 2024
1b48731
Split up method in AlignmentBusinessService and adjust uniqueId for f…
lkleisa Apr 5, 2024
f10a5cc
Remove unused check in wrongAlignments filter
lkleisa Apr 5, 2024
50995e3
Add check for right counterpart
lkleisa Apr 8, 2024
d2edd03
Add SVG Styling for Diagram Nodes
lkleisa Apr 8, 2024
f0df281
Add user information when no alignments
lkleisa Apr 8, 2024
fc92b9c
Add diagram click handler
lkleisa Apr 8, 2024
2515eb0
Add missing quarter and move testdata to current quarter
lkleisa Apr 9, 2024
2ebf8db
Fix bug when no KeyResult in AlignmentData
lkleisa Apr 9, 2024
fd4c5ee
Write unit test for AlignmentBusinessService
lkleisa Apr 9, 2024
8b29edf
Write unit test for AlignmentValidationService
lkleisa Apr 9, 2024
8868e19
Write integration tests for AlignmentBusinessService
lkleisa Apr 9, 2024
6e68398
Adjust foreign key in testdata
lkleisa Apr 9, 2024
eac2b56
Write integration tests for AlignmentViewPersistenceService
lkleisa Apr 9, 2024
4eddd6d
Fix failing backend tests
lkleisa Apr 9, 2024
c714e5d
Add current quarter id to url on application launch
lkleisa Apr 9, 2024
50492f7
Fix frontend e2e tests
lkleisa Apr 9, 2024
967c969
Fix frontend unit tests for quarter-filter
lkleisa Apr 10, 2024
39a0e6c
Add frontend e2e tests for diagram
lkleisa Apr 10, 2024
73d7932
Rename function for replacing non ascii characters
lkleisa Apr 10, 2024
dec1ade
Write unit tests for DiagramComponent
lkleisa Apr 10, 2024
5045a7f
Add validation check for final AlignmentViewList on same amout of sou…
lkleisa Apr 10, 2024
fdfd82f
Write unit tests for new validation check
lkleisa Apr 10, 2024
1a07f52
Add translation for new backend error ALIGNMENT_DATA_FAIL
lkleisa Apr 10, 2024
3d56251
Add unit tests for AlignmentService
lkleisa Apr 11, 2024
e196b9f
Adjust height of commit icon in node
lkleisa Apr 11, 2024
fdfb206
Escape html tags in object title
lkleisa Apr 12, 2024
9d1a0e8
Return empty list when empty teamfilter is set
lkleisa Apr 22, 2024
8ce4ecb
Do not reload diagram when closing dialog with cancel
lkleisa Apr 22, 2024
edb59cc
Do not change data when click already active diagram tab
lkleisa Apr 22, 2024
506a8c5
Fix backend unit tests and e2e tests
lkleisa Apr 24, 2024
d10a05f
Remove reload of diagram when closing dialog
lkleisa Apr 24, 2024
562e1de
[FM] Automated formating frontend
actions-user Apr 29, 2024
d55a521
Use current quarter for alignments when no quarterFilter is set
lkleisa Apr 29, 2024
b7f7b62
Rename diagramm to network and k to kr
lkleisa May 6, 2024
eadc720
Add wheel sensitivity for diagram
lkleisa May 6, 2024
87636e5
Keep diagram on tab switch alive
lkleisa May 23, 2024
e4f4886
Remove icon on kr bubble
lkleisa May 23, 2024
eb30230
Adjust quarter fk in newquarterdata
lkleisa May 23, 2024
2e022b1
Adjust testdata after rebase
lkleisa May 30, 2024
9d3d3db
Adjust testdata after rebase
lkleisa May 31, 2024
17b6dc9
Change KR state on checkin edit
lkleisa May 31, 2024
3e223a3
Use another method to convert svg
lkleisa Jun 3, 2024
b557d9d
Fix failing tests
lkleisa Jun 3, 2024
36af8c0
[FM] Automated formating backend
actions-user Jun 3, 2024
9a729d4
Add hyphens to svg bubble on word break
lkleisa Jun 5, 2024
a2b0151
Clean up code
lkleisa Jun 5, 2024
111590c
Fix sonar code smells
lkleisa Jun 6, 2024
d87911f
Refactor code
lkleisa Jun 6, 2024
2ed1a3f
Adjust height of diagram
lkleisa Jun 6, 2024
5fd7ba6
[FM] Automated formating backend
actions-user Jun 13, 2024
9092638
Rename variable
lkleisa Jun 13, 2024
eab42af
Refactor frontend code
Jun 14, 2024
a8795f8
Use second refresh subject
lkleisa Jun 19, 2024
d15b26e
[FM] Automated formating backend
actions-user Nov 19, 2024
ed475a8
fix rebase errors
kcinay055679 Nov 19, 2024
08dde3e
fix backend tests by resolving import errors
kcinay055679 Nov 19, 2024
3271e2f
fix invalid quarters inside h2 test data
nevio18324 Nov 19, 2024
5a0973b
use proper quarterids for h2
kcinay055679 Nov 21, 2024
a40496a
add correct tenant in failing backend tests
kcinay055679 Nov 21, 2024
d745700
remove unused line in shared.module.ts
kcinay055679 Nov 21, 2024
0fcc86b
fix frontend tests
kcinay055679 Nov 21, 2024
4a8f6f2
add check for get last checkin ordinal
kcinay055679 Nov 21, 2024
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
3 changes: 3 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ private Constants() {
public static final String KEY_RESULT_TYPE_METRIC = "metric";
public static final String KEY_RESULT_TYPE_ORDINAL = "ordinal";
public static final String OBJECTIVE = "Objective";
public static final String OBJECTIVE_LOWERCASE = "objective";
public static final String STATE_DRAFT = "Draft";
public static final String KEY_RESULT = "KeyResult";
public static final String CHECK_IN = "Check-in";
public static final String ACTION = "Action";
public static final String ALIGNMENT = "Alignment";
public static final String ALIGNMENT_VIEW = "AlignmentView";
public static final String ALIGNED_OBJECTIVE_ID = "alignedObjectiveId";
public static final String COMPLETED = "Completed";
public static final String QUARTER = "Quarter";
public static final String TEAM = "Team";
Expand Down
3 changes: 2 additions & 1 deletion backend/src/main/java/ch/puzzle/okr/ErrorKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ public enum ErrorKey {
ATTRIBUTE_NULL, ATTRIBUTE_CHANGED, ATTRIBUTE_SET_FORBIDDEN, ATTRIBUTE_NOT_SET, ATTRIBUTE_CANNOT_CHANGE,
ATTRIBUTE_MUST_BE_DRAFT, KEY_RESULT_CONVERSION, ALREADY_EXISTS_SAME_NAME, CONVERT_TOKEN, DATA_HAS_BEEN_UPDATED,
MODEL_NULL, MODEL_WITH_ID_NOT_FOUND, NOT_AUTHORIZED_TO_READ, NOT_AUTHORIZED_TO_WRITE, NOT_AUTHORIZED_TO_DELETE,
TOKEN_NULL, TRIED_TO_DELETE_LAST_ADMIN, TRIED_TO_REMOVE_LAST_OKR_CHAMPION
TOKEN_NULL, NOT_LINK_YOURSELF, NOT_LINK_IN_SAME_TEAM, ALIGNMENT_ALREADY_EXISTS, TRIED_TO_DELETE_LAST_ADMIN,
TRIED_TO_REMOVE_LAST_OKR_CHAMPION, ALIGNMENT_DATA_FAIL
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.alignment.AlignmentObjectiveDto;
import ch.puzzle.okr.mapper.AlignmentSelectionMapper;
import ch.puzzle.okr.service.business.AlignmentSelectionBusinessService;
import ch.puzzle.okr.dto.alignment.AlignmentLists;
import ch.puzzle.okr.service.business.AlignmentBusinessService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -20,26 +19,23 @@
@RestController
@RequestMapping("api/v2/alignments")
public class AlignmentController {
private final AlignmentSelectionMapper alignmentSelectionMapper;
private final AlignmentSelectionBusinessService alignmentSelectionBusinessService;
private final AlignmentBusinessService alignmentBusinessService;

public AlignmentController(AlignmentSelectionMapper alignmentSelectionMapper,
AlignmentSelectionBusinessService alignmentSelectionBusinessService) {
this.alignmentSelectionMapper = alignmentSelectionMapper;
this.alignmentSelectionBusinessService = alignmentSelectionBusinessService;
public AlignmentController(AlignmentBusinessService alignmentBusinessService) {
this.alignmentBusinessService = alignmentBusinessService;
}

@Operation(summary = "Get all objectives and their key results to select the alignment", description = "Get a list of objectives with their key results to select the alignment")
@Operation(summary = "Get AlignmentLists from filter", description = "Get a list of AlignmentObjects with all AlignmentConnections, which match current quarter, team and objective filter")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Returned a list of objectives with their key results to select the alignment", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = AlignmentObjectiveDto.class)) }),
@ApiResponse(responseCode = "400", description = "Can't return list of objectives with their key results to select the alignment", content = @Content) })
@GetMapping("/selections")
public ResponseEntity<List<AlignmentObjectiveDto>> getAlignmentSelections(
@RequestParam(required = false, defaultValue = "", name = "quarter") Long quarterFilter,
@RequestParam(required = false, defaultValue = "", name = "team") Long teamFilter) {
@ApiResponse(responseCode = "200", description = "Returned AlignmentLists, which match current filters", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = AlignmentLists.class)) }),
@ApiResponse(responseCode = "400", description = "Can't generate AlignmentLists from current filters", content = @Content) })
@GetMapping("/alignmentLists")
public ResponseEntity<AlignmentLists> getAlignments(
@RequestParam(required = false, defaultValue = "", name = "teamFilter") List<Long> teamFilter,
@RequestParam(required = false, defaultValue = "", name = "quarterFilter") Long quarterFilter,
@RequestParam(required = false, defaultValue = "", name = "objectiveQuery") String objectiveQuery) {
return ResponseEntity.status(HttpStatus.OK)
.body(alignmentSelectionMapper.toDto(alignmentSelectionBusinessService
.getAlignmentSelectionByQuarterIdAndTeamIdNot(quarterFilter, teamFilter)));
.body(alignmentBusinessService.getAlignmentListsByFilters(quarterFilter, teamFilter, objectiveQuery));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ch.puzzle.okr.controller;

import ch.puzzle.okr.dto.AlignmentDto;
import ch.puzzle.okr.dto.ObjectiveDto;
import ch.puzzle.okr.mapper.ObjectiveMapper;
import ch.puzzle.okr.models.Objective;
Expand All @@ -14,6 +15,8 @@
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static org.springframework.http.HttpStatus.IM_USED;
import static org.springframework.http.HttpStatus.OK;

Expand Down Expand Up @@ -42,6 +45,19 @@ public ResponseEntity<ObjectiveDto> getObjective(
.body(objectiveMapper.toDto(objectiveAuthorizationService.getEntityById(id)));
}

@Operation(summary = "Get Alignment possibilities", description = "Get all possibilities to create an Alignment")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "Returned all Alignment possibilities for an Objective", content = {
@Content(mediaType = "application/json", schema = @Schema(implementation = AlignmentDto.class)) }),
@ApiResponse(responseCode = "401", description = "Not authorized to get Alignment possibilities", content = @Content),
@ApiResponse(responseCode = "404", description = "Did not find any possibilities to create an Alignment", content = @Content) })
@GetMapping("/alignmentPossibilities/{quarterId}")
public ResponseEntity<List<AlignmentDto>> getAlignmentPossibilities(
@Parameter(description = "The Quarter ID for getting Alignment possibilities.", required = true) @PathVariable Long quarterId) {
return ResponseEntity.status(HttpStatus.OK)
.body(objectiveAuthorizationService.getAlignmentPossibilities(quarterId));
}

@Operation(summary = "Delete Objective by ID", description = "Delete Objective by ID")
@ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Deleted Objective by ID"),
@ApiResponse(responseCode = "401", description = "Not authorized to delete an Objective", content = @Content),
Expand Down
6 changes: 6 additions & 0 deletions backend/src/main/java/ch/puzzle/okr/dto/AlignmentDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package ch.puzzle.okr.dto;

import java.util.List;

public record AlignmentDto(Long teamId, String teamName, List<AlignmentObjectDto> alignmentObjects) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ch.puzzle.okr.dto;

public record AlignmentObjectDto(Long objectId, String objectTitle, String objectType) {
}
4 changes: 3 additions & 1 deletion backend/src/main/java/ch/puzzle/okr/dto/ObjectiveDto.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package ch.puzzle.okr.dto;

import ch.puzzle.okr.dto.alignment.AlignedEntityDto;
import ch.puzzle.okr.models.State;

import java.time.LocalDateTime;

public record ObjectiveDto(Long id, int version, String title, Long teamId, Long quarterId, String quarterLabel,
String description, State state, LocalDateTime createdOn, LocalDateTime modifiedOn, boolean writeable) {
String description, State state, LocalDateTime createdOn, LocalDateTime modifiedOn, boolean writeable,
AlignedEntityDto alignedEntity) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package ch.puzzle.okr.dto.alignment;

public record AlignedEntityDto(Long id, String type) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

package ch.puzzle.okr.dto.alignment;

public record AlignmentConnectionDto(Long alignedObjectiveId, Long targetObjectiveId, Long targetKeyResultId) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ch.puzzle.okr.dto.alignment;

import java.util.List;

public record AlignmentLists(List<AlignmentObjectDto> alignmentObjectDtoList,
List<AlignmentConnectionDto> alignmentConnectionDtoList) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package ch.puzzle.okr.dto.alignment;

public record AlignmentObjectDto(Long objectId, String objectTitle, String objectTeamName, String objectState,
String objectType) {
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ public ObjectiveMapper(TeamBusinessService teamBusinessService, QuarterBusinessS
this.quarterBusinessService = quarterBusinessService;
}

// TODO: Adjust Unit Tests of ObjectiveMapper after merge of multitenancy-main

public ObjectiveDto toDto(Objective objective) {
return new ObjectiveDto(objective.getId(), objective.getVersion(), objective.getTitle(),
objective.getTeam().getId(), objective.getQuarter().getId(), objective.getQuarter().getLabel(),
objective.getDescription(), objective.getState(), objective.getCreatedOn(), objective.getModifiedOn(),
objective.isWriteable());
objective.isWriteable(), objective.getAlignedEntity());
}

public Objective toObjective(ObjectiveDto objectiveDto) {
return Objective.Builder.builder().withId(objectiveDto.id()).withVersion(objectiveDto.version())
.withTitle(objectiveDto.title()).withTeam(teamBusinessService.getTeamById(objectiveDto.teamId()))
.withDescription(objectiveDto.description()).withModifiedOn(LocalDateTime.now())
.withState(objectiveDto.state()).withCreatedOn(objectiveDto.createdOn())
.withQuarter(quarterBusinessService.getQuarterById(objectiveDto.quarterId())).build();
.withQuarter(quarterBusinessService.getQuarterById(objectiveDto.quarterId()))
.withAlignedEntity(objectiveDto.alignedEntity()).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
import ch.puzzle.okr.dto.keyresult.*;
import ch.puzzle.okr.mapper.ActionMapper;
import ch.puzzle.okr.models.Action;
import ch.puzzle.okr.models.checkin.CheckIn;
import ch.puzzle.okr.models.checkin.CheckInMetric;
import ch.puzzle.okr.models.checkin.*;
import ch.puzzle.okr.models.keyresult.KeyResult;
import ch.puzzle.okr.models.keyresult.KeyResultMetric;
import ch.puzzle.okr.service.business.CheckInBusinessService;
Expand Down Expand Up @@ -85,7 +84,7 @@ public KeyResult toKeyResultMetric(KeyResultMetricDto keyResultMetricDto) {

public KeyResultLastCheckInMetricDto getLastCheckInDto(Long keyResultId) {
CheckIn lastCheckIn = checkInBusinessService.getLastCheckInByKeyResultId(keyResultId);
if (lastCheckIn == null) {
if (!(lastCheckIn instanceof CheckInMetric)) {
return null;
}
return new KeyResultLastCheckInMetricDto(lastCheckIn.getId(), lastCheckIn.getVersion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public KeyResult toKeyResultOrdinal(KeyResultOrdinalDto keyResultOrdinalDto) {

public KeyResultLastCheckInOrdinalDto getLastCheckInDto(Long keyResultId) {
CheckIn lastCheckIn = checkInBusinessService.getLastCheckInByKeyResultId(keyResultId);
if (lastCheckIn == null) {
if (!(lastCheckIn instanceof CheckInOrdinal)) {
return null;
}
return new KeyResultLastCheckInOrdinalDto(lastCheckIn.getId(), lastCheckIn.getVersion(),
Expand Down
19 changes: 18 additions & 1 deletion backend/src/main/java/ch/puzzle/okr/models/Objective.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ch.puzzle.okr.models;

import ch.puzzle.okr.dto.alignment.AlignedEntityDto;
import jakarta.persistence.*;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
Expand Down Expand Up @@ -52,6 +53,7 @@ public class Objective implements WriteableInterface {
private User modifiedBy;

private transient boolean writeable;
private transient AlignedEntityDto alignedEntity;

public Objective() {
}
Expand All @@ -68,6 +70,7 @@ private Objective(Builder builder) {
setState(builder.state);
setCreatedOn(builder.createdOn);
setModifiedBy(builder.modifiedBy);
setAlignedEntity(builder.alignedEntity);
}

public Long getId() {
Expand Down Expand Up @@ -160,12 +163,20 @@ public void setWriteable(boolean writeable) {
this.writeable = writeable;
}

public AlignedEntityDto getAlignedEntity() {
return alignedEntity;
}

public void setAlignedEntity(AlignedEntityDto alignedEntity) {
this.alignedEntity = alignedEntity;
}

@Override
public String toString() {
return "Objective{" + "id=" + id + ", version=" + version + ", title='" + title + '\'' + ", createdBy="
+ createdBy + ", team=" + team + ", quarter=" + quarter + ", description='" + description + '\''
+ ", modifiedOn=" + modifiedOn + ", state=" + state + ", createdOn=" + createdOn + ", modifiedBy="
+ modifiedBy + ", writeable=" + writeable + '\'' + '}';
+ modifiedBy + ", writeable=" + writeable + ", alignedEntity=" + alignedEntity + '\'' + '}';
}

@Override
Expand Down Expand Up @@ -201,6 +212,7 @@ public static final class Builder {
private State state;
private LocalDateTime createdOn;
private User modifiedBy;
private AlignedEntityDto alignedEntity;

private Builder() {
}
Expand Down Expand Up @@ -264,6 +276,11 @@ public Builder withModifiedBy(User modifiedBy) {
return this;
}

public Builder withAlignedEntity(AlignedEntityDto alignedEntity) {
this.alignedEntity = alignedEntity;
return this;
}

public Objective build() {
return new Objective(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public int getVersion() {
return version;
}
Expand Down
Loading
Loading