studyright cancellation in case status CANCELLED_BY_ADMINISTRATION

This commit is contained in:
Matti Luukkainen
2021-03-11 20:25:09 +02:00
parent 1564819cba
commit f020f969a1
2 changed files with 3 additions and 2 deletions
@@ -137,7 +137,7 @@ const main = async () => {
console.log('starting')
//await bsc()
//await msc()
await programmeDiff('KH57_002')
await programmeDiff('KH20_001')
process.exit()
}
@@ -15,7 +15,8 @@ const updateStudyRights = async (studyRights, personIdToStudentNumber, personIdT
const parseCancelDate = (studyright, phase_number = 1, isBaMa = false) => {
if (isBaMa && phase_number === 1 && get(studyright, 'study_right_graduation.phase1GraduationDate')) return null
if (studyright.state === 'RESCINDED') return studyright.study_right_cancellation.cancellationDate
if (['RESCINDED','CANCELLED_BY_ADMINISTRATION'].includes(studyright.state)) return studyright.study_right_cancellation.cancellationDate
if (studyright.state === 'PASSIVE') return studyright.snapshot_date_time
return null
}