Implement verified curriculum, video review, watch sessions, ledger safeguards, and remove demo data

This commit is contained in:
Hamza-Ayed
2026-09-09 17:04:08 +03:00
parent 0dc5df7b5e
commit 5af684a892
49 changed files with 1809 additions and 3005 deletions
+2 -25
View File
@@ -99,31 +99,8 @@ if ($task === 'all' || $task === 'grades') {
// 3. تسوية ومطابقة مدفوعات كليك المعلقة (Reconcile Pending CliQ Slips)
// ─────────────────────────────────────────────────────────────────────────────
if ($task === 'all' || $task === 'reconcile') {
echo "\n[3/5] Reconciling Pending CliQ Slips (Timeouts > 24 Hours)...\n";
try {
CliqPaymentService::ensureSchema();
$staleCount = (int)Database::selectOne(
"SELECT COUNT(*) as cnt FROM cliq_payments
WHERE verification_status = 'pending'
AND created_at < DATE_SUB(NOW(), INTERVAL 24 HOUR)"
)['cnt'];
if (!$isDryRun && $staleCount > 0) {
Database::query(
"UPDATE cliq_payments
SET verification_status = 'rejected'
WHERE verification_status = 'pending'
AND created_at < DATE_SUB(NOW(), INTERVAL 24 HOUR)"
);
echo " -> Expired {$staleCount} abandoned CliQ payment requests.\n";
} else {
echo " -> Abandoned pending requests found: {$staleCount}.\n";
}
$results['reconcile'] = "Expired: {$staleCount}";
} catch (\Throwable $e) {
echo " -> ERROR: " . $e->getMessage() . "\n";
$results['reconcile'] = 'Error: ' . $e->getMessage();
}
echo "\n[3/5] CliQ reconciliation is disabled until provider integration is verified.\n";
$results['reconcile'] = 'Unavailable: provider-backed reconciliation is not configured';
}
// ─────────────────────────────────────────────────────────────────────────────