-
Notifications
You must be signed in to change notification settings - Fork 2
feat(companies): Add email notification preferences management for company settings #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…mpany settings - Create new API endpoint for fetching and updating company notification preferences - Add GET /api/companies/[slug]/notifications route to retrieve current notification settings - Add PUT /api/companies/[slug]/notifications route to update notification preferences with role-based access control - Implement notification preference types in company type definitions - Add notification preferences service for managing company email notification logic - Integrate notification preferences UI in company settings dashboard page - Add loading and saving states for notification preference updates - Implement role-based authorization (owner/admin only) for notification preference management - Allows company owners and admins to control email notifications for registrations, event approvals/rejections, team member joins, and subscription expiration alerts
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces a notification preferences system for companies with a new API route (GET/PUT) for managing preferences, a service layer for querying and sending notifications based on preferences, frontend UI updates to display and persist settings, and type definitions for notification preference fields. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UI as Settings Page
participant API as /api/.../notifications
participant DB as Database
participant Service as Service Layer
rect rgba(100, 200, 150, 0.2)
note over User,Service: Get Notification Preferences
User->>UI: Navigate to Notifications
UI->>API: GET /api/companies/[slug]/notifications
API->>API: Verify Auth & Permissions
API->>DB: Fetch company notification prefs
DB-->>API: Return preferences (or nulls)
API-->>UI: Return with defaults
UI->>UI: Set loading state, render toggles
end
rect rgba(150, 150, 200, 0.2)
note over User,Service: Save Notification Preferences
User->>UI: Toggle preference & click Save
UI->>UI: Show "Saving…" state
UI->>API: PUT /api/companies/[slug]/notifications
API->>API: Verify Auth & Permissions
API->>API: Validate & sanitize input
API->>DB: Update notification preferences
DB-->>API: Return updated record
API-->>UI: Return updated preferences
UI->>UI: Show success toast, clear loading
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Authored by: @akshay0611
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.