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:
@@ -1720,7 +1720,7 @@ func TestAdminBookings_ApproveEditRequest(t *testing.T) {
|
||||
// Create admin notification
|
||||
_, err = db.DB.Exec(context.Background(),
|
||||
`INSERT INTO admin_notifications (reason, booking_id, user_id)
|
||||
VALUES ('edit_request', $1, $2)`,
|
||||
VALUES ('edit_requested', $1, $2)`,
|
||||
bookingID, userID)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to create admin notification: %v", err)
|
||||
@@ -1773,7 +1773,7 @@ func TestAdminBookings_ApproveEditRequest(t *testing.T) {
|
||||
var ackTime *time.Time
|
||||
err = db.DB.QueryRow(context.Background(),
|
||||
`SELECT acknowledged_at FROM admin_notifications
|
||||
WHERE booking_id = $1 AND reason = 'edit_request'`,
|
||||
WHERE booking_id = $1 AND reason = 'edit_requested'`,
|
||||
bookingID).Scan(&ackTime)
|
||||
if err != nil {
|
||||
t.Fatalf("failed to query notification: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user