Source of Truth
Current Codebase Snapshot
prisma/schema.prisma already contains Notification, NotificationFeedDismissal, and NotificationFeedState.
BrandRating already exists, but service-level and USO-level review/rating flows are missing.
src/routes/v1/notification.route.ts exists, so the feed foundation is already present and should be extended rather than replaced.
Goal
Expand the existing feed/notification foundation so it can represent PRD-required events, and implement the completed-reservation review/rating workflow for Service, USO, and Brand.
In Scope
- Feed/notification emission for team invitations, brand transfers, moderation decisions, new reservation requests, reservation status changes, and upcoming reminders.
- Reminder scheduling contract for the PRD-required 1-hour-before notification.
- Review/rating models and endpoints for Service and USO, plus brand review eligibility tied to completed reservations.
- Rules for repeat reservations and how rating updates behave across repeated bookings.
- Compatibility with existing dismiss/clear feed semantics.
Suggested Implementation Order
- Audit the current notification read/write flow before adding new event types.
- Introduce missing review/rating models and eligibility checks based on completed reservations.
- Add event emitters/hooks from reservation, moderation, invitation, and transfer flows.
- Add reminder scheduling integration behind a clean boundary.
- Add tests for feed state compatibility, reminder creation, and review eligibility.
Important Constraints For Agents
- Do not break current dismissal/clear-all feed behavior.
- Keep event type naming explicit and stable because frontend rendering will branch on it.
- The PRD leaves some repeat-rating behavior flexible; choose one consistent rule, document it in code/comments/tests, and keep it easy to adjust later.
Deliverables
- Schema/migration updates for missing review/rating entities.
- Extended notification/feed event handling.
- Endpoints for eligible review/rating submission.
- Tests for event emission, feed compatibility, and reservation-gated review rules.
Acceptance Criteria
- Reservation, moderation, invitation, and transfer events can appear in the feed without breaking existing behavior.
- Confirmed reservations can trigger 1-hour reminder scheduling through the chosen infrastructure boundary.
- Service/USO/Brand reviews are blocked unless the user is eligible via completed reservation rules.
- Feed dismiss/clear semantics still work after new event types are added.
- The chosen repeat-review rule is implemented and covered by tests.
Out of Scope
- Full email/push provider implementation beyond the hooks/contracts needed here.
- Analytics/reporting dashboards for reviews or notifications.
Source of Truth
Reziphay/nodejs-app#10for reservation events and#11for moderation eventsnextjs-app#12Current Codebase Snapshot
prisma/schema.prismaalready containsNotification,NotificationFeedDismissal, andNotificationFeedState.BrandRatingalready exists, but service-level and USO-level review/rating flows are missing.src/routes/v1/notification.route.tsexists, so the feed foundation is already present and should be extended rather than replaced.Goal
Expand the existing feed/notification foundation so it can represent PRD-required events, and implement the completed-reservation review/rating workflow for Service, USO, and Brand.
In Scope
Suggested Implementation Order
Important Constraints For Agents
Deliverables
Acceptance Criteria
Out of Scope