Last active
April 28, 2019 22:28
-
-
Save keithmancuso/3d308df705abfa3111c31b63879c6999 to your computer and use it in GitHub Desktop.
Nominator Status Logic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If (status.contains('Nominee') && status != 'Nominee-No') { | |
Application_Stage = 'nominee'; | |
switch on status { | |
when 'Nominee-No Show' { | |
status = 'Student did not attend Posse interview'; | |
} when 'Nominee - Declined Invite' { | |
status = 'Student declined Posse interview'; | |
} when else { | |
status = 'Student nominated'; | |
} | |
} | |
} else if ((status.contains('Semi-finalist') || status.contains('Semi-Finalist') || status == 'Nominee-No') && status != 'Semi-finalist-No') { | |
if (paramNom.Student__r.DAP1_Date__c != null && (paramNom.Student__r.DAP1_Date__c.addDays(Integer.valueOf(dap1.NumDelayedDays__c)) < Date.today()) ) { | |
Application_Stage = 'semi-finalist'; | |
switch on status { | |
when 'Nominee-No' { | |
status = 'Student not selected to move forward'; | |
} when 'Semi-finalist-No Show' { | |
status = 'Student did not attend 2nd interview'; | |
} when 'Semi-finalist-Declined invite' { | |
status = 'Student declined 2nd interview'; | |
} when 'Semi-Finalist - Pending Reschedule' { | |
status = '2nd interview pending reschedule'; | |
} when 'Semi-finalist-Declined after interview' { | |
status = 'Student declined Posse after 2nd interview'; | |
} when else { | |
status = 'Semi-finalist'; | |
} | |
} | |
} else { | |
Application_Stage = 'nominee'; | |
status = 'Student nominated'; | |
} | |
} else if ((status.contains('Finalist') || status == 'Semi-finalist-No') && status != 'Finalist-Prospect') { | |
if (paramNom.Student__r.DAP_2_Date__c != null && (paramNom.Student__r.DAP_2_Date__c.addDays(Integer.valueOf(dap2.NumDelayedDays__c)) < Date.today()) ) { | |
Application_Stage = 'finalist'; | |
switch on status { | |
when 'Semi-finalist-No' { | |
status = 'Student not selected to move forward'; | |
} when 'Finalist' { | |
status = 'Finalist for Posse Scholarship'; | |
} when 'Finalist Wait-list' { | |
status = 'Student will be notified'; | |
} when 'Finalist Declined Invite' { | |
status = 'Student declined final Posse interview'; | |
} when 'Finalist No Show' { | |
status = 'Student did not attend final Posse interview'; | |
} when 'Finalist declined after interview' { | |
status = 'Student withdrew from Posse after final interview'; | |
} when 'Finalist declined after offer' { | |
status = 'Student declined admission offer'; | |
} when 'Finalist opt out of Posse Access' { | |
status = 'Student not selected for Posse'; | |
} when else { | |
status = 'Finalist for Posse Scholarship'; | |
} | |
} | |
} else { | |
Application_Stage = 'semi-finalist'; | |
status = 'Semi-finalist'; | |
} | |
} else if (status.contains('Scholar') || status == 'Finalist-Prospect') { | |
if (paramNom.Student__r.DAP_3_Date__c != null && (paramNom.Student__r.DAP_3_Date__c.addDays(Integer.valueOf(dap3.NumDelayedDays__c)) < Date.today()) ) { | |
switch on status { | |
when 'Finalist-Prospect' { | |
status = 'Student not selected for Posse'; | |
} when else { | |
status = 'Student selected as Scholarship winner'; | |
} | |
} | |
} else { | |
Application_Stage = 'finalist'; | |
status = 'Finalist for Posse Scholarship'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment