fix family card issue
Deploy to Shared Hosting / Shared hosting deploy (push) Failing after 48s
Tests / PHPUnit (push) Failing after 1m27s

This commit is contained in:
root
2026-09-12 03:16:10 -04:00
parent ce504c933e
commit 1787144f27
11 changed files with 382 additions and 11 deletions
@@ -10,6 +10,7 @@ use App\Models\StudentModel;
use App\Models\UserModel;
use App\Services\PhoneFormatterService;
use App\Services\SchoolIdService;
use App\Services\FamilyDataSyncService;
use CodeIgniter\Database\BaseConnection;
use CodeIgniter\Database\Exceptions\DatabaseException;
use DateTime;
@@ -296,6 +297,12 @@ class ParentRegistrationService
}
}
// Deleting a student cascades the normalized family_students row, but
// intentionally leaves the household and guardian records in place.
// Always restore that membership when a child is added again (and heal
// older registrations that pre-date the normalized family tables).
(new FamilyDataSyncService($this->db))->syncForParent($parentId);
$this->medicalConditionModel->where('student_id', $studentId)->delete();
foreach ((array) $conditions as $condition) {
$condition = trim((string) $condition);