feat: admin notification system with priority ordering, bell icon, and /notifications page

Two-tier notification system: new_booking (all public bookings) + pending_booking (notes/today).
Priority-sorted queue, unread count polling, enriched responses with user_name/booking_start_time.
Fix critical bug: edit_requested cleanup was broken (wrong reason string in 3 handlers).
Add 15 new tests covering priority ordering, enrichment, and notification creation flows.
Update Admin Manual, Technical Manual, and gap backlog docs.
This commit is contained in:
2026-05-16 23:41:18 +01:00
parent c3501ae89a
commit 7fc58f58d9
19 changed files with 1608 additions and 106 deletions
+9 -6
View File
@@ -36,17 +36,20 @@ func VerifyToken(tokenString string, ctx context.Context) (userID string, role s
return "", "", err
}
claims, err := token.AsMap(ctx)
if err != nil {
return "", "", err
var uidVal interface{}
if err := token.Get("user_id", &uidVal); err != nil {
return "", "", fmt.Errorf("invalid user_id claim")
}
userID, ok := claims["user_id"].(string)
userID, ok := uidVal.(string)
if !ok {
return "", "", fmt.Errorf("invalid user_id claim")
}
role, ok = claims["role"].(string)
var roleVal interface{}
if err := token.Get("role", &roleVal); err != nil {
return "", "", fmt.Errorf("invalid role claim")
}
role, ok = roleVal.(string)
if !ok {
return "", "", fmt.Errorf("invalid role claim")
}