Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/2515 full application submitted #2602

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ const lookup = (value) => {
lookup[APPLICATION_STATUS.QUALIFYING_TEST_FAILED] = 'Failed qualifying test';
lookup[APPLICATION_STATUS.QUALIFYING_TEST_PASSED] = 'Passed qualifying test';
lookup[APPLICATION_STATUS.QUALIFYING_TEST_NOT_SUBMITTED] = 'Qualifying Test Not Started';
lookup[APPLICATION_STATUS.FULL_APPLICATION_NOT_SUBMITTED] = 'Full application not submitted';
lookup[APPLICATION_STATUS.FULL_APPLICATION_NOT_SUBMITTED] = 'Full Application Not Submitted';
lookup[APPLICATION_STATUS.FULL_APPLICATION_SUBMITTED] = 'Full Application Submitted';
lookup[APPLICATION_STATUS.RECOMMENDED_FUTURE] = 'Recommended Future';
lookup[APPLICATION_STATUS.RECOMMENDED_IMMEDIATE] = 'Recommended Immediate';
lookup[APPLICATION_STATUS.APPROVED_FUTURE] = 'Approved Future';
Expand Down
1 change: 1 addition & 0 deletions src/helpers/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ const APPLICATION_STATUS = {
SHORTLISTING_PASSED: 'shortlistingOutcomePassed',
SHORTLISTING_FAILED: 'shortlistingOutcomeFailed',
FULL_APPLICATION_NOT_SUBMITTED: 'fullApplicationNotSubmitted',
FULL_APPLICATION_SUBMITTED: 'fullApplicationSubmitted',
ELIGIBILITY_SCC_PASSED: 'eligibilitySCCPassed',
ELIGIBILITY_SCC_FAILED: 'eligibilitySCCFailed',
CHARACTER_AND_SELECTION_SCC_PASSED: 'characterAndSelectionSCCPassed',
Expand Down
20 changes: 20 additions & 0 deletions src/helpers/exerciseHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,10 @@ function getStageMoveBackStatuses(exercise, stage) {
switch (stage) {
case EXERCISE_STAGE.RECOMMENDATION:
return [APPLICATION_STATUS.RECONSIDER];
case EXERCISE_STAGE.SELECTION:
return [APPLICATION_STATUS.FULL_APPLICATION_NOT_SUBMITTED];
}

}
return [];
}
Expand Down Expand Up @@ -1244,9 +1247,13 @@ function availableStatuses(exercise, stage) {
statuses = [
APPLICATION_STATUS.SELECTION_DAY_PASSED,
APPLICATION_STATUS.SELECTION_DAY_FAILED,
APPLICATION_STATUS.FULL_APPLICATION_NOT_SUBMITTED,
APPLICATION_STATUS.PASSED_RECOMMENDED,
APPLICATION_STATUS.WITHDRAWN,
];
if (canApplyFullApplicationSubmitted(exercise)) {
statuses.push(APPLICATION_STATUS.FULL_APPLICATION_SUBMITTED);
}
return statuses;
case EXERCISE_STAGE.SCC:
statuses = [
Expand Down Expand Up @@ -1290,6 +1297,9 @@ function availableStatuses(exercise, stage) {
APPLICATION_STATUS.RECONSIDER,
APPLICATION_STATUS.WITHDRAWN,
];
if (canApplyFullApplicationSubmitted(exercise)) {
statuses.push(APPLICATION_STATUS.FULL_APPLICATION_SUBMITTED);
}
return statuses;
}
} else {
Expand Down Expand Up @@ -1525,3 +1535,13 @@ function isJAC00187(env, referenceNumber) {
(env === 'STAGING' && referenceNumber === 'JAC00695') ||
(env === 'PRODUCTION' && referenceNumber === 'JAC00187');
}

function canApplyFullApplicationSubmitted(exercise) {
if (!exercise) return false;

const selectionProcess = exercise?._applicationContent?.selection || {};
const isStagedExercise = Object.values(selectionProcess).includes(true);
const applyFullApplicationSubmitted = isStagedExercise && exercise.applicationOpenDate >= new Date(2024, 7, 18);

return applyFullApplicationSubmitted;
}
Loading