Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 8b94f48

Browse files
deedeeskyhit
authored andcommitted
Legacy MM phase name map to standard phase name and remove unrelated phase
1 parent 12f4d1a commit 8b94f48

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/main/java/com/appirio/service/challengefeeder/manager/ChallengeListingMMFeederManager.java

+13
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import java.io.IOException;
2727
import java.util.ArrayList;
28+
import java.util.HashMap;
2829
import java.util.List;
2930
import java.util.Map;
3031
import java.util.stream.Collectors;
@@ -65,6 +66,17 @@ public class ChallengeListingMMFeederManager {
6566
*/
6667
private final ChallengeListingMMFeederDAO challengeListingMmFeederDAO;
6768

69+
/**
70+
* Phase name map from MM segment
71+
*/
72+
private static final Map<Long, String> PHASE_NAME_MAP = new HashMap<>();
73+
74+
static {
75+
PHASE_NAME_MAP.put(1L, "Registration");
76+
PHASE_NAME_MAP.put(2L, "Submission");
77+
PHASE_NAME_MAP.put(5L, "Review");
78+
}
79+
6880
/**
6981
* The jestClient field
7082
*/
@@ -237,6 +249,7 @@ private static void associateAllPhases(List<ChallengeListingData> challenges, Li
237249
if (challenge.getPhases() == null) {
238250
challenge.setPhases(new ArrayList<>());
239251
}
252+
aPhase.setType(PHASE_NAME_MAP.get(aPhase.getPhaseId()));
240253
challenge.getPhases().add(aPhase);
241254
if (challenge.getCurrentPhases() == null) {
242255
challenge.setCurrentPhases(new ArrayList<>());

src/main/resources/sql/mm-feeder-into-challenges/get-phases.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ end_time as actualEndTime,
1515
end_time as scheduledEndTime
1616
from informixoltp\:round_segment rs
1717
left join informixoltp\:segment s on rs.segment_id = s.segment_id
18-
where {filter}
18+
where s.segment_id in (1,2,5) and {filter}

0 commit comments

Comments
 (0)