Surveys
The post-stay survey, when it is sent, what it stores and how a guest answers.
One short survey per guest after the stay: six questions at most, one minute on a phone.
Questions
- NPS, 0 to 10: "How likely are you to recommend the hotel to a friend?"
- Three optional ratings from 1 to 5: your room, cleanliness, staff and food
- One optional free comment (1000 characters)
When it is sent
The survey-invites job runs every minute (pg-boss, jobs module) and takes at most one batch (20 guests) per hotel, longest due first, so a large import is worked through gradually. A guest is due 24 hours after check-out (counted from noon hotel time). With no check-out date it is 8 days after the guest was captured, longer than a week's stay (a stay over a week with no date can still be asked early). A guest from a restaurant table code or a csv import is only surveyed once they have a check-out date. Staff type it in quick add or guest edit, or it comes with the import, so an imported departure in the last 14 days is surveyed. Only guests due in the last 14 days are picked up, so a new deploy never surveys old guests.
Where the check-out date comes from:
-
The guest, on the capture page: an optional "when do you leave?" (tomorrow, in 2, 3 or 7 nights, or a date up to 90 days away). It is only kept when the guest also switches on the toggle shown under it, which grants the whole
profileconsent; otherwise neither is stored. Scanning again does not change a check-out that is today or later, staff do that. -
Staff, on the guest's edit page, once the guest has the
profileconsent. -
Sent through
sendToGueston the channels the guest agreed to: thesurveyemail and theguest_surveyWhatsApp template (seewhatsapp-templates). -
Never in quiet hours, 21:00 to 08:00 hotel time. The first run after quiet hours sends it.
-
Once per guest:
survey_inviteshas one row per guest andautomation_sendsone claim per channel. A crash between the invite and the send is picked up by the next run.
Data
survey_invites:hotel_id,guest_id,sent_at,expires_at(14 days). Deleted with the guest.survey_responses:hotel_id,guest_id(set to null when the guest is deleted, so the answer stays as anonymous feedback),invite_id(unique, one response per invite),nps, three ratings,comment,language,submitted_at,review_link_clicked_at.
Every query is scoped by hotel id.
The page
/s/<token> in apps/web, branded with the hotel's logo and colors like the capture page, in the guest's language (en, fr, ar RTL). The token is signed (HMAC), so it cannot be guessed. It is a server component with a plain form and no client JavaScript. The NPS row wraps in two rows on a 390px phone. After sending, and on a second visit, the page shows the thank you state. After 14 days it says the survey has closed. The page is noindex and sends no referrer.
Seed data: about one guest in five of the four demo hotels has an invite, 70% of them answered, with scores from 3 to 10 and comments in fr, ar and en.
Low score alert
A response with nps at or below the hotel's hotel_settings.low_score_threshold (default 6, hotel.update takes lowScoreThreshold 0 to 10) does two things:
- opens a
feedback_casesrow for the response with statusnew(thencontacted,resolved),notesandhandled_by, so it shows in the feedback inbox - calls
notifyManager(hotelId, text), which emails the manager. The text has the guest's first name, the score, a comment excerpt (140 characters) and a link to/feedback/<case id>in the dashboard. Never a phone number or email.
A failed alert never fails the guest's answer. One case per response.
Feedback inbox
Unhappy guests are the second half of the dashboard Inbox: /feedback, also in the sidebar as "Unhappy guests". The alert email and the home page link straight to /feedback/<case id>.
- The list shows the guest, score, comment, status and date, newest first, filtered by status (
new,contacted,resolved) with a count on each. - A case shows the survey answer, the contact buttons and a guest profile button, the status and one shared staff note (2000 characters), with who saved it last.
- Each unhappy guest on the home page has the same contact buttons and "Mark contacted", which moves the case to
contactedand off the home page. Calling or writing does not change the status by itself. - A save sends the
updatedAtit read. If a colleague saved in between,feedbackCases.updateanswersCONFLICT, and the page says so and reloads the case. - The alert link opens the case in the active hotel only. For another hotel the page says to switch hotel and open the link again.
- The list loads more as you scroll (
feedbackCases.listtakescursor). - Every hotel role (owner, manager, staff) can read and update cases: it needs
guest: readandguest: update. - API:
feedbackCases.list,feedbackCases.get,feedbackCases.update, all scoped by the active hotel. Each update writes afeedback-case.updateaudit entry with the status, never the note text. - A deleted guest's case leaves the inbox and its note is erased. The survey answer stays, anonymous.
Contact by hand
The guest page, the case page and the home alerts open the staff member's own dialer (tel:), WhatsApp (wa.me) or mail app (mailto:). Nothing is sent or logged by Ritorno, and no text is prefilled.
- Call is always there: a phone call is not a message.
- WhatsApp shows only when the guest agreed to WhatsApp and the number can take it.
- Email shows only when the guest has an address and agreed to email.
The rule is contactChannels in @ritorno/common/contact. A withdrawal (STOP, unsubscribe, staff) hides the button. On the guest page, export and delete sit under the "more" button.
Share on Google
After the survey, whatever the score (never gated by score), the thank you state shows a secondary button "Share on Google" with a short line, in en, fr and ar. It only shows when the hotel has a hotel_settings.google_review_url.
The button points to /r/<token> in apps/web, a signed redirect (a review token, which cannot open the survey and the other way round). It stamps survey_responses.review_link_clicked_at on the first click and redirects to the hotel's page. A hotel without a link, or a bad token, gets a 404. Nothing else is sent after the survey, so the thank you page is the thank you message.