This document provides a comprehensive overview of all jobs, commands, and scheduled tasks in the Africa CDC Approvals Management System.
system@africacdc.orgdefaultNotificationService, PendingApprovalsServicedefaultsystem@africacdc.orgdefaultdefaultdefaultdefaultphp artisan jobs:test-daily-notificationsphp artisan jobs:dispatch-daily-notificationsphp artisan jobs:process-queuephp artisan jobs:monitor-queuephp artisan reminders:schedule [--test] [--force] - --test: Run in test mode (dry run)
- --force: Force run even if not scheduled time
SendDailyPendingApprovalsNotificationJob to create individual notification jobsphp artisan notifications:send-test 558system@africacdc.org - php artisan reminders:send-instant --staff-id=558 (specific staff by ID)
- php artisan reminders:send-instant --email=user@example.com (specific staff by email)
- php artisan reminders:send-instant --all (all approvers with pending items)
- php artisan reminders:send-instant --test (dry run mode)
- php artisan reminders:send-instant --force (force send even if no pending items)
system@africacdc.orgphp artisan notifications:test-emailphp artisan notifications:test-allphp artisan assign:document-numbersphp artisan assign:missing-document-numbersphp artisan document:reset-countersphp artisan fix:document-conflictsphp artisan monitor:document-jobsphp artisan monitor:document-numbersphp artisan directorates:syncphp artisan divisions:syncphp artisan staff:syncphp artisan approval:archive-trailsphp artisan approval:manage-trailsapproval_trails (morph Activity) with the source activity_approval_trails after promotion.passed, convert_to_single_memo, converted_to_single_memo) instead of single-memo workflow actions (approved, returned), or where created_at / updated_at were lost on copy.is_single_memo activity, pairing the first N rows by id order, N = min(activity trails, approval trails)): - Sets approval_trails.action using the same mapping as live conversion: passed → approved; convert_to_single_memo / converted_to_single_memo → returned; other actions unchanged.
- Copies created_at and updated_at from the paired activity_approval_trails row.
- Ensures the returned row (from convert-to-single-memo) has a timestamp strictly after every other paired row so it appears first when sorting trails by created_at descending (last action on top).
approval_trails were inserted before any later single-memo workflow rows, in the same order as activity_approval_trails. If counts differ, only the first N pairs are updated; review with --dry-run.apm/ directory): - php artisan apm:fix-single-memo-promoted-approval-trails --dry-run — report changes only
- php artisan apm:fix-single-memo-promoted-approval-trails — apply fixes
- php artisan apm:fix-single-memo-promoted-approval-trails --activity-id=118 — limit to one activity (optional with --dry-run)
- --dry-run — no database writes
- --activity-id= — process only that activity ID
ActivityApprovalTrail::mapActionForPromotionToApprovalTrail(), ActivityApprovalTrail::createPromotedApprovalTrail() (new conversions preserve source timestamps automatically).php artisan system:health-check- Database connectivity
- Queue tables status
- Storage permissions
- Log file availability
php artisan queue:clear-failedphp artisan queue:retry-failedapp/Providers/ScheduleServiceProvider.phpphp artisan schedule:work (continuous) or php artisan schedule:run (one-time)laravel-scheduler.service systemd servicedirectorates:syncdivisions:syncstaff:syncdirectorates:syncdivisions:syncstaff:syncreminders:schedule (Morning reminders)reminders:schedule (Evening reminders)Note: Scheduled tasks are configured in app/Providers/ScheduleServiceProvider.php and run automatically via php artisan schedule:work.
The manage-jobs.sh script provides easy management of all jobs and services:
# System Status
./manage-jobs.sh status # Show system and queue status
./manage-jobs.sh health # Run comprehensive health check
# Notification Management
./manage-jobs.sh test-notifications # Test notification system (dry run)
./manage-jobs.sh send-test <staff_id> # Send test notification to specific staff
./manage-jobs.sh send-reminder <staff_id> # Send instant reminder to specific staff
./manage-jobs.sh send-reminder-email <email> # Send instant reminder to specific email
./manage-jobs.sh send-reminder-all # Send instant reminders to all approvers
./manage-jobs.sh schedule-reminders # Schedule instant reminders for all approvers
./manage-jobs.sh dispatch-daily # Dispatch daily pending approvals job
# Queue Management
./manage-jobs.sh process-queue # Process one job from the queue
./manage-jobs.sh monitor-queue # Monitor and process queue jobs
./manage-jobs.sh clear-failed # Clear all failed jobs
./manage-jobs.sh retry-failed # Retry all failed jobs
# Service Management
./manage-jobs.sh start-worker # Start queue worker (background)
./manage-jobs.sh stop-worker # Stop queue worker
./manage-jobs.sh restart-worker # Restart queue worker
./manage-jobs.sh start-scheduler # Start scheduler (background)
./manage-jobs.sh stop-scheduler # Stop scheduler
./manage-jobs.sh restart-scheduler # Restart scheduler
# Logs and Monitoring
./manage-jobs.sh logs # Show recent job logs
The system:health-check command verifies:
- Connection to MySQL database
- Query execution capability
- jobs table existence and accessibility
- failed_jobs table existence and accessibility
- Current queue status (pending/failed jobs count)
- Storage directory writability
- Log file accessibility
- Laravel log file existence
- Log file readability
# Quick status check
./manage-jobs.sh status
# Comprehensive health check
./manage-jobs.sh health
# Queue monitoring
./manage-jobs.sh monitor-queue
# View logs
./manage-jobs.sh logs
# Check queue status
./manage-jobs.sh monitor-queue
# Restart queue worker
./manage-jobs.sh restart-worker
# Check failed jobs
php artisan queue:failed
# Test notification system
./manage-jobs.sh test-notifications
# Send test to specific user
./manage-jobs.sh send-test 558
# Check Exchange configuration
php artisan system:health-check
# Monitor document jobs
php artisan monitor:document-jobs
# Assign missing document numbers
php artisan assign:missing-document-numbers
# Fix document conflicts
php artisan fix:document-conflicts
# Check scheduler status
./manage-jobs.sh status
# Restart scheduler
./manage-jobs.sh restart-scheduler
# Test scheduled commands manually
php artisan reminders:schedule --test
storage/logs/laravel.logstorage/logs/job-management.logstorage/logs/laravel-YYYY-MM-DD.loglaravel-queue-apm.servicesystemctl status laravel-queue-apmsystemctl start laravel-queue-apmsystemctl stop laravel-queue-apmlaravel-scheduler.servicesystemctl status laravel-schedulersystemctl start laravel-schedulersystemctl stop laravel-schedulerphp artisan queue:monitorphp artisan queue:failed./manage-jobs.sh start-scheduler
./manage-jobs.sh start-worker
./manage-jobs.sh health
./manage-jobs.sh test-notifications
./manage-jobs.sh send-test 558
./manage-jobs.sh status
./manage-jobs.sh logs
For issues or questions regarding jobs and commands:
./manage-jobs.sh health./manage-jobs.sh logsLast updated: March 30, 2026
Version: 1.1