@@ -3,7 +3,6 @@ import { 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" ;
6
- import DateUtil from "./DateUtil" ;
7
6
8
7
class LegacyMapper {
9
8
// To be used on challenge:update calls that change state from New -> Draft
@@ -184,13 +183,13 @@ class LegacyMapper {
184
183
public mapPhases ( subTrack : string , phases : Challenge_Phase [ ] ) {
185
184
return phases . map ( ( phase : Challenge_Phase , index : number ) => ( {
186
185
phaseTypeId : this . mapPhaseNameToPhaseTypeId ( phase . name ) ,
187
- phaseStatusId : phase . isOpen ? 2 : 1 , // Set Open if phase is open, otherwise mark it Scheduled [1: Scheduled, 2: Open, 3: Closed]
188
- fixedStartTime : phase . name === "Registration" ? DateUtil . formatDateForIfx ( phase . scheduledStartDate ! ) : undefined , // Registration Phase needs a fixedStartTime
189
- scheduledStartTime : DateUtil . formatDateForIfx ( phase . scheduledStartDate ! ) ,
190
- scheduledEndTime : DateUtil . formatDateForIfx ( phase . scheduledEndDate ! ) ,
191
- actualStartTime : ! phase . actualStartDate ? undefined : DateUtil . formatDateForIfx ( phase . actualStartDate ) ,
192
- actualEndTime : ! phase . actualEndDate ? undefined : DateUtil . formatDateForIfx ( phase . actualEndDate ) ,
193
- duration : phase . duration ,
186
+ phaseStatusId : phase . isOpen ? 2 : phase . actualEndDate ? 3 : 1 ,
187
+ fixedStartTime : ! phase . predecessor ? undefined : phase . scheduledStartDate ! ,
188
+ scheduledStartTime : phase . scheduledStartDate ! ,
189
+ scheduledEndTime : phase . scheduledEndDate ! ,
190
+ actualStartTime : ! phase . actualStartDate ? undefined : phase . actualStartDate ,
191
+ actualEndTime : ! phase . actualEndDate ? undefined : phase . actualEndDate ,
192
+ duration : phase . duration * 1000 ,
194
193
phaseCriteria : this . mapPhaseCriteria ( subTrack , phase ) ,
195
194
} ) ) ;
196
195
}
@@ -211,7 +210,7 @@ class LegacyMapper {
211
210
1 : this . mapScorecard ( subTrack , phase . name ) , // Scorecard ID
212
211
2 : phase . name === "Registration" ? '1' : undefined , // Registration Number
213
212
3 : phase . name === "Submission" ? submissionPhaseConstraint ?. value . toString ( ) ?? // if we have a submission phase constraint use it
214
- reviewPhaseConstraint ?. value != null ? '1' : undefined // otherwise if we have a review phase constraint use 1
213
+ reviewPhaseConstraint ?. value != null ? '1' : undefined // otherwise if we have a review phase constraint use 1
215
214
: undefined ,
216
215
4 : undefined , // View Response During Appeals
217
216
5 : undefined , // Manual Screening
@@ -279,7 +278,7 @@ class LegacyMapper {
279
278
}
280
279
281
280
// prettier-ignore
282
- private mapScorecard ( subTrack : string , phase : string ) : string | undefined {
281
+ private mapScorecard ( subTrack : string , phase : string ) : string | undefined {
283
282
const isNonProd = process . env . ENV != "prod" ;
284
283
285
284
// TODO: Update scorecard ids for all subtracks and check for dev environment
@@ -288,7 +287,7 @@ class LegacyMapper {
288
287
289
288
// F2F
290
289
if ( subTrack === V4_SUBTRACKS . FIRST_2_FINISH ) scorecard = isNonProd ? 30002160 : 30002160 ; // missing dev scorecard
291
- if ( subTrack === V4_SUBTRACKS . DESIGN_FIRST_2_FINISH ) scorecard = isNonProd ? 30001610 :30001101 ; // missing dev scorecard
290
+ if ( subTrack === V4_SUBTRACKS . DESIGN_FIRST_2_FINISH ) scorecard = isNonProd ? 30001610 : 30001101 ; // missing dev scorecard
292
291
293
292
// QA
294
293
if ( subTrack === V4_SUBTRACKS . BUG_HUNT ) {
@@ -297,7 +296,7 @@ class LegacyMapper {
297
296
}
298
297
299
298
// DS
300
- if ( subTrack === V4_SUBTRACKS . DEVELOP_MARATHON_MATCH ) scorecard = isNonProd ? 30001610 :30002133 ; // missing dev scorecard
299
+ if ( subTrack === V4_SUBTRACKS . DEVELOP_MARATHON_MATCH ) scorecard = isNonProd ? 30001610 : 30002133 ; // missing dev scorecard
301
300
if ( subTrack === V4_SUBTRACKS . MARATHON_MATCH ) scorecard = isNonProd ? 30001610 : 30002133 ; // missing dev scorecard
302
301
303
302
// DESIGN
0 commit comments