fix is_active student flag logic and make moving with enrollment status
This commit is contained in:
@@ -285,12 +285,17 @@ final class EnrollmentTransitionService
|
||||
];
|
||||
|
||||
if ($original !== null) {
|
||||
$this->db->table('enrollments')->where('id', (int) $original['id'])->update($payload);
|
||||
$payload['id'] = (int) $original['id'];
|
||||
} else {
|
||||
$payload['created_at'] = date('Y-m-d H:i:s');
|
||||
$this->db->table('enrollments')->insert($payload);
|
||||
}
|
||||
|
||||
(new EnrollmentStatusService($this->db))->upsertStatus(
|
||||
$payload,
|
||||
$performedBy,
|
||||
'initial_transition_applied'
|
||||
);
|
||||
|
||||
if ((int) ($evaluation['assigned_class_section_id'] ?? 0) > 0) {
|
||||
$this->upsertStudentClass($studentId, (int) $evaluation['assigned_class_section_id'], $targetSchoolYear, $performedBy);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user