-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from Onlineberatung/feature/VIC-903_reschedule_…
…link feat: add booking link to booking object
- Loading branch information
Showing
5 changed files
with
66 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/vi/appointmentservice/helper/RescheduleHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.vi.appointmentservice.helper; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import com.vi.appointmentservice.api.model.CalcomBooking; | ||
import com.vi.appointmentservice.service.CalComEventTypeService; | ||
import com.vi.appointmentservice.service.CalComUserService; | ||
import lombok.AllArgsConstructor; | ||
import lombok.NonNull; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@AllArgsConstructor | ||
public class RescheduleHelper { | ||
|
||
private final @NonNull CalComEventTypeService eventTypeService; | ||
private final @NonNull CalComUserService calComUserService; | ||
|
||
public CalcomBooking attachRescheduleLink(CalcomBooking calcomBooking) | ||
throws JsonProcessingException { | ||
String userSlug = this.calComUserService.getUserById(Long.valueOf(calcomBooking.getUserId())).getUsername(); | ||
String eventTypeSlug = this.eventTypeService.getEventTypeById( | ||
Long.valueOf(calcomBooking.getEventTypeId())).getSlug(); | ||
calcomBooking.setRescheduleLink("/" + userSlug + "/" + eventTypeSlug + "?rescheduleUid=" + calcomBooking.getUid()); | ||
return calcomBooking; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters