Update: 2026-07-12 18:53:59

This commit is contained in:
Hamza-Ayed
2026-07-12 18:53:59 +03:00
parent 8cd4a4b57e
commit 653d73422f
54 changed files with 2078 additions and 436 deletions
+23
View File
@@ -196,6 +196,29 @@ function transitClearTripOwner(int $tripId): void
$redisLocation->del("transit:trip:{$tripId}:owner");
}
// ── عضوية الراكب في Redis (location Redis — بدون بادئة siro:) ──────
// يستخدمها passenger_socket.php للتحقق قبل قبول subscribe_transit_route.
// تُكتب عند: تفعيل عضوية برقم الكشف، أو موافقة المشرف على الطلب اليدوي.
// تُحذف عند: رفض أو تعليق العضوية.
function transitCacheEnrollment(int $orgId, string $passengerId): void
{
global $redisLocation;
if (!$redisLocation || !$passengerId) return;
$key = "transit:org_members:{$orgId}";
$redisLocation->sAdd($key, $passengerId);
$redisLocation->expire($key, 7 * 86400); // تجديد TTL سبعة أيام
}
function transitDropEnrollment(int $orgId, string $passengerId): void
{
global $redisLocation;
if (!$redisLocation || !$passengerId) return;
$redisLocation->sRem("transit:org_members:{$orgId}", $passengerId);
}
// ── days_mask helpers ────────────────────────────────────────
// bit0=Sun … bit6=Sat | 62 = 0b0111110 = الأحد–الخميس