feat: review form logo/header image customizer, fix unread msg job startup
Some checks failed
Deploy to Production / deploy (push) Has been cancelled

- ReviewsPage: logo upload (circle/square), header bg image, show-email toggle
- GuestReviewQrPage/GuestReviewPage: render logo image, header bg image, logo shape
- Backend: return review_logo_url, review_logo_shape, review_header_image_url, show_email from both public review endpoints
- jobs.ts: run unread messages job 20s after startup (was only on interval)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-21 23:09:43 +03:00
parent 9bda48c020
commit 31de5be873
6 changed files with 171 additions and 21 deletions

View File

@@ -399,6 +399,10 @@ export function startJobs(): void {
runPaymentExpiryJob().catch(console.error)
}, PAYMENT_EXPIRY_INTERVAL)
setTimeout(() => {
runUnreadMessagesJob().catch(console.error)
}, 20_000)
setInterval(() => {
runUnreadMessagesJob().catch(console.error)
}, UNREAD_MSG_INTERVAL)

View File

@@ -170,7 +170,9 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
'review_redirect_threshold','review_platforms',
'review_show_text_field','review_welcome_text',
'review_brand_color','review_redirect_source',
'review_source_map'
'review_source_map','review_logo_url',
'review_logo_shape','review_header_image_url',
'review_show_email'
)`,
[row.hotel_id],
)
@@ -204,10 +206,14 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
return {
hotelName: row.hotel_name,
logoLetter: (row.hotel_name as string)[0] ?? 'О',
logoUrl: (s.review_logo_url as string | undefined) ?? null,
logoShape: (s.review_logo_shape as string | undefined) ?? 'circle',
headerImageUrl: (s.review_header_image_url as string | undefined) ?? null,
welcomeText: (s.review_welcome_text as string | undefined) ?? 'Как вам у нас?',
color: (s.review_brand_color as string | undefined) ?? '#2563eb',
redirectThreshold: Number(s.review_redirect_threshold ?? 4),
showTextField: s.review_show_text_field !== false,
showEmail: s.review_show_email !== false,
platforms,
guestName: row.guest_name ?? '',
bookingSource: bookingSrc,
@@ -302,7 +308,9 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
AND key IN (
'review_redirect_threshold','review_platforms',
'review_show_text_field','review_welcome_text',
'review_brand_color'
'review_brand_color','review_logo_url',
'review_logo_shape','review_header_image_url',
'review_show_email'
)`,
[hotel.id],
)
@@ -318,10 +326,14 @@ const reviewsRoutes: FastifyPluginAsync = async (fastify) => {
return {
hotelName: hotel.name,
logoLetter: hotel.name[0] ?? 'О',
logoUrl: (s.review_logo_url as string | undefined) ?? null,
logoShape: (s.review_logo_shape as string | undefined) ?? 'circle',
headerImageUrl: (s.review_header_image_url as string | undefined) ?? null,
welcomeText: (s.review_welcome_text as string | undefined) ?? 'Как вам у нас?',
color: (s.review_brand_color as string | undefined) ?? '#2563eb',
redirectThreshold: Number(s.review_redirect_threshold ?? 4),
showTextField: s.review_show_text_field !== false,
showEmail: s.review_show_email !== false,
platforms: allPlatforms,
roomNumber: room,
}