-
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 remote-tracking branch 'origin/refactor_calcom_usage' into refa…
…ctor_calcom_usage
- Loading branch information
Showing
8 changed files
with
98 additions
and
87 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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/vi/appointmentservice/api/calcom/model/LocationType.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,8 @@ | ||
package com.vi.appointmentservice.api.calcom.model; | ||
|
||
public enum LocationType { | ||
VIDEO_CALL, | ||
IN_PERSON, | ||
PHONE_CALL, | ||
CHAT | ||
} |
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
40 changes: 40 additions & 0 deletions
40
src/main/java/com/vi/appointmentservice/api/calcom/service/CalcomLocationsService.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,40 @@ | ||
package com.vi.appointmentservice.api.calcom.service; | ||
|
||
import com.vi.appointmentservice.api.model.CalcomBooking; | ||
import com.vi.appointmentservice.api.calcom.model.LocationType; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class CalcomLocationsService { | ||
|
||
private static final String IN_PERSON_MEETING_MESSAGE = "Die Adresse der Beratungsstelle teilt Ihnen ihr:e Berater:in im Chat mit"; | ||
|
||
private static final String PHONE_CALL_MEETING_MESSAGE = "Die Telefonnummer teilt Ihnen ihr:e Berater:in im Chat mit"; | ||
|
||
private static final String VIDEO_CALL = "integrations:daily"; | ||
|
||
private static final String LINK = "https://app.suchtberatung.digital"; | ||
|
||
public String resolveLocationType(CalcomBooking booking) { | ||
if (IN_PERSON_MEETING_MESSAGE.equals(booking.getLocation())) { | ||
return LocationType.IN_PERSON.name(); | ||
} else if (PHONE_CALL_MEETING_MESSAGE.equals(booking.getLocation())) { | ||
return LocationType.PHONE_CALL.name(); | ||
} else if (VIDEO_CALL.equals(booking.getLocation())) { | ||
return LocationType.VIDEO_CALL.name(); | ||
} else if (LINK.equals(booking.getLocation())) { | ||
return LocationType.CHAT.name(); | ||
} | ||
throw new IllegalStateException("Unknown location type"); | ||
} | ||
|
||
public String buildCalcomLocations() { | ||
return "[{\"type\": \"integrations:daily\"}," | ||
+ "{\"type\": \"inPerson\",\"address\": \"" + IN_PERSON_MEETING_MESSAGE + "\"}," | ||
+ "{\"link\": \"" + LINK + "\",\"type\": \"link\"}," | ||
+ "{\"type\": \"userPhone\",\"hostPhoneNumber\": \"" + PHONE_CALL_MEETING_MESSAGE + "\"}]"; | ||
} | ||
} |
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