Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,16 @@ class AuthRepositoryImpl @Inject constructor(
// Map to domain user
val user = mapToUser(userDto)

// Register FCM token if notifications are enabled
if (notificationPermissionManager.areNotificationsEnabled()) {
try {
val fcmToken = notificationRepository.getCurrentFcmToken()
fcmToken?.let { notificationRepository.registerDeviceToken(it) }
} catch (e: Exception) {
// Best effort - don't fail auth if FCM registration fails
}
}

// Update state
_authState.value = AuthState.Authenticated(
user = user,
Expand Down
2 changes: 2 additions & 0 deletions backend/apps/notifications/fcm.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def send(self, message: FCMMessage) -> FCMResult:
android=messaging.AndroidConfig(
priority="high",
notification=messaging.AndroidNotification(
icon="ic_notification",
color="#B52428",
click_action="OPEN_BOOKING",
channel_id="bookings",
),
Expand Down
28 changes: 28 additions & 0 deletions backend/apps/notifications/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,34 @@ class NotificationContent:
body="Ваша бронь в {restaurant_name} на {date} была отменена.",
),
},
"booking_completed": {
"en": NotificationContent(
title="Thanks for visiting! 🍽️",
body="How was your experience at {restaurant_name}? We'd love to hear your feedback!",
),
"uz": NotificationContent(
title="Tashrifingiz uchun rahmat! 🍽️",
body="{restaurant_name}da qanday bo'ldi? Fikringizni bilishni xohlaymiz!",
),
"ru": NotificationContent(
title="Спасибо за визит! 🍽️",
body="Как вам в {restaurant_name}? Поделитесь впечатлениями!",
Comment on lines +72 to +80
),
},
"booking_no_show": {
"en": NotificationContent(
title="We missed you!",
body="You missed your reservation at {restaurant_name}. Hope to see you next time!",
),
"uz": NotificationContent(
title="Sizni sog'indik!",
body="{restaurant_name}dagi buyurtmangizga kelmadingiz. Keyingi safar kutamiz!",
),
"ru": NotificationContent(
title="Мы вас не дождались!",
body="Вы пропустили бронь в {restaurant_name}. Ждём вас в следующий раз!",
),
},
"reminder_24h": {
"en": NotificationContent(
title="Reminder: Tomorrow's Reservation",
Expand Down
2 changes: 2 additions & 0 deletions backend/apps/notifications/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
Booking.Status.CONFIRMED: "booking_confirmed",
Booking.Status.REJECTED: "booking_rejected",
Booking.Status.CANCELLED: "booking_cancelled",
Booking.Status.COMPLETED: "booking_completed",
Booking.Status.NO_SHOW: "booking_no_show",
Comment on lines +16 to +17
}


Expand Down
Loading