Skip to content

Commit 33a909d

Browse files
committed
chore(601): removed user actions
1 parent b251d06 commit 33a909d

File tree

5 files changed

+3
-194
lines changed

5 files changed

+3
-194
lines changed

backend/src/main/java/ca/bc/gov/restapi/results/oracle/endpoint/UserActionsEndpoint.java

+3-21
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package ca.bc.gov.restapi.results.oracle.endpoint;
22

33
import ca.bc.gov.restapi.results.oracle.service.OpeningTrendsService;
4-
import ca.bc.gov.restapi.results.oracle.service.UserActionsService;
5-
import ca.bc.gov.restapi.results.postgres.dto.MyRecentActionsRequestsDto;
64
import ca.bc.gov.restapi.results.postgres.dto.OpeningsPerYearDto;
75
import java.time.LocalDate;
86
import java.util.List;
@@ -20,23 +18,8 @@
2018
@Slf4j
2119
public class UserActionsEndpoint {
2220

23-
private final UserActionsService userActionsService;
2421
private final OpeningTrendsService openingTrendsService;
2522

26-
@GetMapping("/recent-actions")
27-
public ResponseEntity<List<MyRecentActionsRequestsDto>> getUserRecentOpeningsActions() {
28-
List<MyRecentActionsRequestsDto> actionsDto =
29-
userActionsService.getResultsAuditActivity();
30-
31-
log.info("Returning {} recent actions", actionsDto.size());
32-
33-
if (actionsDto.isEmpty()) {
34-
return ResponseEntity.noContent().build();
35-
}
36-
37-
return ResponseEntity.ok(actionsDto);
38-
}
39-
4023
/**
4124
* Gets data for the Opening submission trends Chart (Openings per year) on the Dashboard SILVA
4225
* page.
@@ -59,12 +42,11 @@ public ResponseEntity<List<OpeningsPerYearDto>> getOpeningsSubmissionTrends(
5942
LocalDate entryDateEnd
6043
) {
6144

62-
LocalDate endDate = getDateOrDefault(entryDateEnd,LocalDate.now());
63-
LocalDate startDate = getDateOrDefault(entryDateStart,endDate.minusYears(1));
64-
45+
LocalDate endDate = getDateOrDefault(entryDateEnd, LocalDate.now());
46+
LocalDate startDate = getDateOrDefault(entryDateStart, endDate.minusYears(1));
6547

6648
List<OpeningsPerYearDto> resultList =
67-
openingTrendsService.getOpeningSubmissionTrends(startDate, endDate,orgUnits,statusCodes);
49+
openingTrendsService.getOpeningSubmissionTrends(startDate, endDate, orgUnits, statusCodes);
6850

6951
if (resultList.isEmpty()) {
7052
return ResponseEntity.noContent().build();

backend/src/main/java/ca/bc/gov/restapi/results/oracle/repository/ResultsAuditActivityRepository.java

-32
This file was deleted.

backend/src/main/java/ca/bc/gov/restapi/results/oracle/service/UserActionsService.java

-42
This file was deleted.

backend/src/test/java/ca/bc/gov/restapi/results/oracle/endpoint/UserActionsEndpointIntegrationTest.java

-36
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package ca.bc.gov.restapi.results.oracle.endpoint;
22

3-
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
43
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
54
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
65
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
@@ -45,41 +44,6 @@ public void setTup(){
4544
.map(openingRepository::save);
4645
}
4746

48-
49-
@Test
50-
@DisplayName("User recent actions requests test with data should succeed")
51-
void getUserRecentOpeningsActions_withData_shouldSucceed() throws Exception {
52-
53-
mockMvc
54-
.perform(
55-
get("/api/users/recent-actions")
56-
.with(csrf().asHeader())
57-
.header("Content-Type", MediaType.APPLICATION_JSON_VALUE)
58-
.accept(MediaType.APPLICATION_JSON))
59-
.andExpect(status().isOk())
60-
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
61-
.andExpect(jsonPath("$[0].activityType").value("Submitted"))
62-
.andExpect(jsonPath("$[0].openingId").value("102"))
63-
.andExpect(jsonPath("$[0].statusCode").value("FTML"))
64-
.andExpect(jsonPath("$[0].statusDescription").value("Forest Tenure - Major Licensee"))
65-
.andReturn();
66-
}
67-
68-
@Test
69-
@DisplayName("User recent actions requests test no data should succeed")
70-
@WithMockJwt(value = "no-data")
71-
void getUserRecentOpeningsActions_noData_shouldSucceed() throws Exception {
72-
73-
mockMvc
74-
.perform(
75-
get("/api/users/recent-actions")
76-
.with(csrf().asHeader())
77-
.header("Content-Type", MediaType.APPLICATION_JSON_VALUE)
78-
.accept(MediaType.APPLICATION_JSON))
79-
.andExpect(status().isNoContent())
80-
.andReturn();
81-
}
82-
8347
@Test
8448
@DisplayName("Openings submission trends happy path should succeed")
8549
void getOpeningsSubmissionTrends_happyPath_shouldSucceed() throws Exception {

backend/src/test/java/ca/bc/gov/restapi/results/postgres/endpoint/UserActionsEndpointIntegrationTest.java

-63
This file was deleted.

0 commit comments

Comments
 (0)