add cron jobs and notification api#8
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughNotification storage and endpoints are added, the dashboard now lists and deletes notifications, reminder emails are sent through Resend with notification records, expired subscriptions are marked in a job, a separate job syncs EUR exchange rates, and a VS Code setting hides Postman dotenv notifications. ChangesNotifications and subscription messaging
Exchange rate synchronization
Sequence Diagram(s)Notification dashboard flow sequenceDiagram
participant NotificationPage
participant fetchWithAuth
participant notificationRouter
participant getNotification
participant deleteNotification
participant ReactQuery as React Query
participant prismaNotification as prisma.notification
NotificationPage->>fetchWithAuth: GET /api/notification
fetchWithAuth->>notificationRouter: authenticated request
notificationRouter->>getNotification: GET /
getNotification->>prismaNotification: findMany(userId)
prismaNotification-->>getNotification: notifications
getNotification-->>NotificationPage: data, count, message
NotificationPage->>fetchWithAuth: DELETE /api/notification/delete/:id
fetchWithAuth->>notificationRouter: authenticated request
notificationRouter->>deleteNotification: DELETE /delete/:id
deleteNotification->>prismaNotification: findFirst(userId, id)
deleteNotification->>prismaNotification: delete(id)
deleteNotification-->>NotificationPage: success
NotificationPage->>ReactQuery: invalidate ["notifications"]
Reminder email flow sequenceDiagram
participant sendReminder
participant prismaUser as prisma.user
participant sendReminderEmail
participant Resend
participant prismaNotification as prisma.notification
sendReminder->>prismaUser: find users with ACTIVE subscriptions
prismaUser-->>sendReminder: users
sendReminder->>sendReminderEmail: due subscriptions
sendReminderEmail->>Resend: emails.send(...)
Resend-->>sendReminderEmail: email sent
sendReminder->>prismaNotification: create due-count notification
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary by CodeRabbit
New Features
Bug Fixes