Skip to content

Commit b4f7266

Browse files
committed
fix: project category id
Signed-off-by: Rakib Ansary <rakibansary@gmail.com>
1 parent f601c8c commit b4f7266

File tree

2 files changed

+52
-11
lines changed

2 files changed

+52
-11
lines changed

src/common/ConversionMap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const V4_TRACKS = {
5858
DESIGN: "DESIGN",
5959
};
6060

61-
const V4_SUBTRACKS = {
61+
export const V4_SUBTRACKS = {
6262
MARATHON_MATCH: "MARATHON_MATCH",
6363
DESIGN_FIRST_2_FINISH: "DESIGN_FIRST_2_FINISH",
6464
APPLICATION_FRONT_END_DESIGN: "APPLICATION_FRONT_END_DESIGN",

src/util/LegacyMapper.ts

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _ from "lodash";
22
import { PrizeSetTypes } from "../common/Constants";
3-
import { V5_TO_V4 } from "../common/ConversionMap";
3+
import { V4_SUBTRACKS, V5_TO_V4 } from "../common/ConversionMap";
44
import { legacyChallengeStatusesMap } from "./constants";
55
import DateUtil from "./DateUtil";
66

@@ -61,16 +61,57 @@ class LegacyMapper {
6161
projectStudioSpecId: number | undefined;
6262
projectMmSpecId: number | undefined;
6363
} {
64-
subTrack = subTrack.replace(" ", "").toLowerCase();
64+
let projectCategoryId = 39; // V4_SUBTRACKS.CODE
6565

66-
let projectCategoryId = 39; // code
67-
if (subTrack === "first2finish") {
68-
projectCategoryId = 38;
69-
} else if (subTrack === "marathonmatch") {
70-
projectCategoryId = 37;
71-
} else if (subTrack === "bughunt") {
72-
projectCategoryId = 9;
73-
}
66+
if (subTrack === V4_SUBTRACKS.FIRST_2_FINISH) projectCategoryId = 38;
67+
if (subTrack === V4_SUBTRACKS.MARATHON_MATCH) projectCategoryId = 37;
68+
// prettier-ignore
69+
if (subTrack === V4_SUBTRACKS.DEVELOP_MARATHON_MATCH) projectCategoryId = 37;
70+
if (subTrack === V4_SUBTRACKS.BUG_HUNT) projectCategoryId = 9;
71+
if (subTrack === V4_SUBTRACKS.DESIGN_FIRST_2_FINISH) projectCategoryId = 40;
72+
if (subTrack === V4_SUBTRACKS.WEB_DESIGNS) projectCategoryId = 17;
73+
/*
74+
project_category_id,project_type_id,name
75+
1,1,Design
76+
2,1,Development
77+
3,1,Security
78+
4,1,Process
79+
5,1,Testing Competition
80+
6,2,Specification
81+
7,2,Architecture
82+
8,2,Component Production
83+
9,2,Bug Hunt
84+
10,2,Deployment
85+
11,2,Security
86+
12,2,Process
87+
13,2,Test Suites
88+
14,2,Assembly Competition
89+
15,2,Legacy
90+
16,3,Banners/Icons
91+
17,3,Web Design
92+
18,3,Wireframes
93+
19,2,UI Prototype Competition
94+
20,3,Logo Design
95+
21,3,Print/Presentation
96+
23,2,Conceptualization
97+
24,2,RIA Build Competition
98+
25,2,RIA Component Competition
99+
26,2,Test Scenarios
100+
27,2,Spec Review
101+
28,4,Generic Scorecards
102+
29,2,Copilot Posting
103+
35,2,Content Creation
104+
30,3,Widget or Mobile Screen Design
105+
31,3,Front-End Flash
106+
32,3,Application Front-End Design
107+
34,3,Studio Other
108+
22,3,Idea Generation
109+
36,2,Reporting
110+
37,2,Marathon Match
111+
38,2,First2Finish
112+
39,2,Code
113+
40,3,Design First2Finish
114+
*/
74115

75116
return {
76117
projectCategoryId,

0 commit comments

Comments
 (0)