From 332b0d10073dc0e756db92285307fb223565a1d4 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 30 Aug 2026 21:10:35 -0400 Subject: [PATCH] fix invalid token --- app/Commands/DeleteInactiveUsers.php | 7 +- .../View/ParentAttendanceReportController.php | 2 +- app/Controllers/View/ParentController.php | 98 ++++--------------- app/Controllers/View/UserController.php | 31 +----- app/Filters/CleanupScheduler.php | 2 +- app/Models/UserModel.php | 4 +- app/Services/Parents/ParentAccountService.php | 43 ++++++++ .../ParentRegistrationNotificationService.php | 77 +++++++++++++++ ...entRegistrationNotificationServiceTest.php | 65 ++++++++++++ 9 files changed, 217 insertions(+), 112 deletions(-) create mode 100644 app/Services/Parents/ParentRegistrationNotificationService.php create mode 100644 tests/app/Services/ParentRegistrationNotificationServiceTest.php diff --git a/app/Commands/DeleteInactiveUsers.php b/app/Commands/DeleteInactiveUsers.php index b22812c..1fb02d2 100644 --- a/app/Commands/DeleteInactiveUsers.php +++ b/app/Commands/DeleteInactiveUsers.php @@ -11,7 +11,7 @@ class DeleteInactiveUsers extends BaseCommand { protected $group = 'Maintenance'; protected $name = 'users:delete-inactive-users'; - protected $description = 'Delete users that are inactive and created more than 15 minutes ago, along with their entries in the parents table and user_roles table if applicable.'; + protected $description = 'Delete unverified inactive registrations created more than 15 minutes ago, along with their entries in the parents table and user_roles table if applicable.'; public function run(array $params) { @@ -24,11 +24,12 @@ class DeleteInactiveUsers extends BaseCommand log_message('debug', 'Cutoff time for deletion: ' . $cutoffTime); // ───────────────────────────────────────────────────── - // 1 Fetch inactive users older than 15 min + // 1 Fetch unfinished registrations older than 15 min // ───────────────────────────────────────────────────── $users = $db->table('users') ->select('id, firstname, lastname, email, created_at') ->where('status', 'Inactive') + ->where('is_verified', 0) ->where('created_at <', $cutoffTime) ->get() ->getResultArray(); @@ -102,4 +103,4 @@ class DeleteInactiveUsers extends BaseCommand } -} \ No newline at end of file +} diff --git a/app/Controllers/View/ParentAttendanceReportController.php b/app/Controllers/View/ParentAttendanceReportController.php index fe78fe8..5713e88 100644 --- a/app/Controllers/View/ParentAttendanceReportController.php +++ b/app/Controllers/View/ParentAttendanceReportController.php @@ -442,7 +442,7 @@ class ParentAttendanceReportController extends BaseController } // ✅ Build formatted success message - $msg = '✅ Submission received successfully for ' . count($successNames) . ' item' . (count($successNames) > 1 ? 's' : '') . '.
'; + $msg = '✅ Submission received successfully for ' . count($successNames) . ' student' . (count($successNames) > 1 ? 's' : '') . '.
'; $msg .= '