Skip to content

[TASK][Backend] Expand notifications and post-completion review workflows #12

@vugarsafarzada

Description

@vugarsafarzada

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

  1. Audit the current notification read/write flow before adding new event types.
  2. Introduce missing review/rating models and eligibility checks based on completed reservations.
  3. Add event emitters/hooks from reservation, moderation, invitation, and transfer flows.
  4. Add reminder scheduling integration behind a clean boundary.
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions