|
1 | 1 | import _ from "lodash";
|
2 |
| -import { PrizeSetTypes } from "../common/Constants"; |
| 2 | +import { PhaseTypeIds, PrizeSetTypes } from "../common/Constants"; |
3 | 3 | import { V4_SUBTRACKS, V5_TO_V4 } from "../common/ConversionMap";
|
4 | 4 | import { Challenge_Phase } from "../models/domain-layer/challenge/challenge";
|
5 | 5 | import { legacyChallengeStatusesMap } from "./constants";
|
@@ -207,7 +207,7 @@ class LegacyMapper {
|
207 | 207 |
|
208 | 208 |
|
209 | 209 | return {
|
210 |
| - 1: this.mapScorecard(subTrack, phase.name), // Scorecard ID |
| 210 | + 1: this.mapScorecard(subTrack, this.mapPhaseNameToPhaseTypeId(phase.name)), // Scorecard ID |
211 | 211 | 2: phase.name === "Registration" ? '1' : undefined, // Registration Number
|
212 | 212 | 3: phase.name === "Submission" ? submissionPhaseConstraint?.value.toString() ?? // if we have a submission phase constraint use it
|
213 | 213 | reviewPhaseConstraint?.value != null ? '1' : undefined // otherwise if we have a review phase constraint use 1
|
@@ -278,39 +278,60 @@ class LegacyMapper {
|
278 | 278 | }
|
279 | 279 |
|
280 | 280 | // prettier-ignore
|
281 |
| - private mapScorecard(subTrack: string, phase: string): string | undefined { |
| 281 | + private mapScorecard(subTrack: string, phaseTypeId: number | undefined): string | undefined { |
282 | 282 | const isNonProd = process.env.ENV != "prod";
|
283 | 283 |
|
284 | 284 | // TODO: Update scorecard ids for all subtracks and check for dev environment
|
285 | 285 |
|
286 | 286 | let scorecard = undefined;
|
287 | 287 |
|
288 |
| - // F2F |
289 |
| - if (subTrack === V4_SUBTRACKS.FIRST_2_FINISH) scorecard = isNonProd ? 30002160 : 30002160; // missing dev scorecard |
290 |
| - if (subTrack === V4_SUBTRACKS.DESIGN_FIRST_2_FINISH) scorecard = isNonProd ? 30001610 : 30001101; // missing dev scorecard |
291 |
| - |
292 |
| - // QA |
293 |
| - if (subTrack === V4_SUBTRACKS.BUG_HUNT) { |
294 |
| - if (phase === "Review") scorecard = isNonProd ? 30001610 : 30001220; // missing dev scorecard |
295 |
| - if (phase === "Specification Review") scorecard = isNonProd ? 30001610 : 30001120; // missing dev scorecard |
| 288 | + if ( |
| 289 | + subTrack === V4_SUBTRACKS.FIRST_2_FINISH && |
| 290 | + phaseTypeId === PhaseTypeIds.IterativeReview |
| 291 | + ) { |
| 292 | + scorecard = isNonProd ? 30002160 : 30002160; |
| 293 | + } else if ( |
| 294 | + subTrack === V4_SUBTRACKS.DESIGN_FIRST_2_FINISH && |
| 295 | + phaseTypeId === PhaseTypeIds.Review |
| 296 | + ) { |
| 297 | + scorecard = isNonProd ? 30001610 : 30001101; |
| 298 | + } else if (subTrack === V4_SUBTRACKS.BUG_HUNT) { |
| 299 | + if (phaseTypeId === PhaseTypeIds.Review) { |
| 300 | + scorecard = isNonProd ? 30001610 : 30001220; |
| 301 | + } else if (phaseTypeId === PhaseTypeIds.SpecificationReview) { |
| 302 | + scorecard = isNonProd ? 30001610 : 30001120; |
| 303 | + } |
| 304 | + } else if ( |
| 305 | + subTrack === V4_SUBTRACKS.DEVELOP_MARATHON_MATCH && |
| 306 | + phaseTypeId === PhaseTypeIds.Review |
| 307 | + ) { |
| 308 | + scorecard = isNonProd ? 30001610 : 30002133; |
| 309 | + } else if ( |
| 310 | + subTrack === V4_SUBTRACKS.MARATHON_MATCH && |
| 311 | + phaseTypeId === PhaseTypeIds.Review |
| 312 | + ) { |
| 313 | + scorecard = isNonProd ? 30001610 : 30002133; |
| 314 | + } else if (subTrack === V4_SUBTRACKS.WEB_DESIGNS) { |
| 315 | + if (phaseTypeId === PhaseTypeIds.SpecificationReview) { |
| 316 | + scorecard = isNonProd ? 30001610 : 30001040; |
| 317 | + } else if (phaseTypeId === PhaseTypeIds.CheckpointScreening) { |
| 318 | + scorecard = isNonProd ? 30001610 : 30001364; |
| 319 | + } else if (phaseTypeId === PhaseTypeIds.CheckpointReview) { |
| 320 | + scorecard = isNonProd ? 30001610 : 30001004; |
| 321 | + } else if (phaseTypeId === PhaseTypeIds.Screening) { |
| 322 | + scorecard = isNonProd ? 30001610 : 30001363; |
| 323 | + } else if (phaseTypeId === PhaseTypeIds.Review) { |
| 324 | + scorecard = isNonProd ? 30001610 : 30001031; |
| 325 | + } else if (phaseTypeId === PhaseTypeIds.Approval) { |
| 326 | + scorecard = isNonProd ? 30001610 : 30000720; |
| 327 | + } |
| 328 | + } else if ( |
| 329 | + subTrack === V4_SUBTRACKS.CODE && |
| 330 | + phaseTypeId === PhaseTypeIds.Review |
| 331 | + ) { |
| 332 | + scorecard = isNonProd ? 30002133 : 30002133; |
296 | 333 | }
|
297 | 334 |
|
298 |
| - // DS |
299 |
| - if (subTrack === V4_SUBTRACKS.DEVELOP_MARATHON_MATCH) scorecard = isNonProd ? 30001610 : 30002133; // missing dev scorecard |
300 |
| - if (subTrack === V4_SUBTRACKS.MARATHON_MATCH) scorecard = isNonProd ? 30001610 : 30002133; // missing dev scorecard |
301 |
| - |
302 |
| - // DESIGN |
303 |
| - if (subTrack === V4_SUBTRACKS.WEB_DESIGNS) { |
304 |
| - if (phase === "Specification Review") scorecard = isNonProd ? 30001610 : 30001040; // missing dev scorecard |
305 |
| - if (phase === "Checkpoint Screening") scorecard = isNonProd ? 30001610 : 30001364; // missing dev scorecard |
306 |
| - if (phase === "Checkpoint Review") scorecard = isNonProd ? 30001610 : 30001004; // missing dev scorecard |
307 |
| - if (phase === "Screening") scorecard = isNonProd ? 30001610 : 30001363; // missing dev scorecard |
308 |
| - if (phase === "Review") scorecard = isNonProd ? 30001610 : 30001031; // missing dev scorecard |
309 |
| - if (phase === "Approval") scorecard = isNonProd ? 30001610 : 30000720; // missing dev scorecard |
310 |
| - } |
311 |
| - |
312 |
| - if (subTrack === V4_SUBTRACKS.CODE) scorecard = isNonProd ? 30002133 : 30002133; // missing dev scorecard |
313 |
| - |
314 | 335 | return scorecard ? scorecard.toString() : undefined;
|
315 | 336 | }
|
316 | 337 | }
|
|
0 commit comments