Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Report synchronization errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zdevaty committed May 14, 2024
1 parent 7e50dbc commit 1af7415
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion apiservices/api_booking_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (s *BookingAPIService) BookingsBookingIdDelete(ctx context.Context, booking
switch reason {
case "", "cancelled":
// Event cancelled by user, no need to notify
case "conflict", "no-show":
case "conflict", "no-show", "error":
if err := eliona.NotifyUser(ctx, booking, reason); err != nil {
log.Error("eliona", "notifying user %v: %v", booking.OrganizerID, err)
return apiserver.ImplResponse{Code: http.StatusInternalServerError}, err
Expand Down
11 changes: 11 additions & 0 deletions eliona/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ func NotifyUser(ctx context.Context, booking apiserver.Booking, reason string) e
assetName, bookingStart,
)),
}
case "error":
message = api.Translation{
De: api.PtrString(fmt.Sprintf(
"Ihre Buchung des Assets %s ab %s wurde aufgrund eines unbekannten Fehlers storniert. Bitte versuchen Sie es später erneut oder kontaktieren Sie den Support.",
assetName, bookingStart,
)),
En: api.PtrString(fmt.Sprintf(
"Your booking of asset %s starting at %s got cancelled due to an unknown error. Please try again later or contact support.",
assetName, bookingStart,
)),
}
default:
return fmt.Errorf("Unknown reason: %v", reason)
}
Expand Down

0 comments on commit 1af7415

Please sign in to comment.