You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no systematic way to measure member satisfaction. NPS (Net Promoter Score) surveys sent automatically after a completed booking provide quantifiable feedback and identify members to retain or win back.
Context
CompleteBookingProvider: backend/src/bookings/providers/complete-booking.provider.ts — trigger survey here
EmailModule: backend/src/email/ — deliver the NPS survey email
@nestjs/schedule: schedule the delayed email send (2 hours after completion)
Overview
There is no systematic way to measure member satisfaction. NPS (Net Promoter Score) surveys sent automatically after a completed booking provide quantifiable feedback and identify members to retain or win back.
Context
CompleteBookingProvider:backend/src/bookings/providers/complete-booking.provider.ts— trigger survey hereEmailModule:backend/src/email/— deliver the NPS survey email@nestjs/schedule: schedule the delayed email send (2 hours after completion)Tasks
NpsSurveyResponseentity:id,userId(FK),bookingId(FK, unique — one response per booking),score(int, 0–10),comment(text, nullable),submittedAt(timestamptz),createdAtCompleteBookingProvider: after booking status →COMPLETED, schedule a delayed job (via Bull, 2-hour delay) to send NPS survey email/nps/[bookingId]with the booking ID; pre-fill context (workspace name, booking date)POST /nps/respond— authenticated member submits{ bookingId, score, comment }; reject if already respondedGET /nps/summary— admin endpoint:{ averageScore, promoters, passives, detractors, npsScore, totalResponses, recentComments }GET /nps/responses— paginated raw responses (admin only)Files to Modify / Create
backend/src/nps/(module, entity, controller, service, bull processor)backend/src/bookings/providers/complete-booking.provider.tsbackend/src/app.module.ts