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

DTS-38151: save createdBy updatedBy details #1160

Merged
merged 2 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -48,7 +48,9 @@ public class ProjectBasicConfig extends BasicModel {

private String projectName;
private String createdAt;
private String createdBy;
private String updatedAt;
private String updatedBy;
private boolean kanban;
private List<HierarchyValue> hierarchy;
private boolean saveAssigneeDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ public class ProjectBasicConfigDTO {
private ObjectId id;
private String projectName;
private String createdAt;
private String createdBy;
private String updatedAt;
private String updatedBy;

private String consumerCreatedOn;
private boolean kanban;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ public void testConstructor() {
@Test
public void testConstructor2() {
ObjectId id = ObjectId.get();
ProjectBasicConfigDTO actualProjectBasicConfigDTO = new ProjectBasicConfigDTO(id, "Project Name",
"Jan 1, 2020 8:00am GMT+0100", "2020-03-01", "Jan 1, 2020 8:00am GMT+0100", true, new ArrayList<>(),
true);
ProjectBasicConfigDTO actualProjectBasicConfigDTO = new ProjectBasicConfigDTO(id, "Project Name",
"Jan 1, 2020 8:00am GMT+0100", "", "2020-03-01", "", "Jan 1, 2020 8:00am GMT+0100", true,
new ArrayList<>(), true);
actualProjectBasicConfigDTO.setConsumerCreatedOn("Jan 1, 2020 8:00am GMT+0100");
actualProjectBasicConfigDTO.setCreatedAt("Jan 1, 2020 8:00am GMT+0100");
ArrayList<HierarchyValueDTO> hierarchyValueDTOList = new ArrayList<>();
Expand Down Expand Up @@ -214,7 +214,7 @@ public void testEquals3() {
public void testEquals4() {
ObjectId id = ObjectId.get();
ProjectBasicConfigDTO projectBasicConfigDTO = new ProjectBasicConfigDTO(id, "Project Name",
"Jan 1, 2020 8:00am GMT+0100", "2020-03-01", "Jan 1, 2020 8:00am GMT+0100", true, new ArrayList<>(),
"Jan 1, 2020 8:00am GMT+0100", "user1", "2020-03-01", "user1", "Jan 1, 2020 8:00am GMT+0100", true, new ArrayList<>(),
true);
assertNotEquals(projectBasicConfigDTO, new ProjectBasicConfigDTO());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public ServiceResponse addBasicConfig(ProjectBasicConfigDTO projectBasicConfigDT
ModelMapper mapper = new ModelMapper();
basicConfig = mapper.map(projectBasicConfigDTO, ProjectBasicConfig.class);
basicConfig.setCreatedAt(DateUtil.dateTimeFormatter(LocalDateTime.now(), DateUtil.TIME_FORMAT));
basicConfig.setCreatedBy(authenticationService.getLoggedInUser());
tokenAuthenticationService.updateExpiryDate(username, LocalDateTime.now().toString());
String accessRoleOfParent = projectAccessManager.getAccessRoleOfNearestParent(basicConfig, username);

Expand Down Expand Up @@ -242,6 +243,7 @@ public ServiceResponse updateBasicConfig(String basicConfigId, ProjectBasicConfi
}
basicConfig.setCreatedAt(savedConfig.getCreatedAt());
basicConfig.setUpdatedAt(DateUtil.dateTimeFormatter(LocalDateTime.now(), DateUtil.TIME_FORMAT));
basicConfig.setUpdatedBy(authenticationService.getLoggedInUser());
ProjectBasicConfig updatedBasicConfig = basicConfigRepository.save(basicConfig);
performFilterOperation(basicConfigDtoCreation(updatedBasicConfig, mapper), true);
response = new ServiceResponse(true, "Updated Successfully.", updatedBasicConfig);
Expand Down
Loading