Skip to content

Commit

Permalink
Updated locations impl.
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanalicic committed Mar 2, 2023
1 parent c6bc134 commit 32ef8b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ public List<CalcomEventType> getEventTypes4Team(Number teamId) {
return result.stream().map(el -> CalcomEventType.asInstance(el)).collect(Collectors.toList());
}

//TODO: move out this repository from here
private UserToConsultantRepository userToConsultantRepository;

/**
* A = eventTypeId B = userId
*/
Expand Down Expand Up @@ -178,7 +175,6 @@ public void deleteAllEventTypesOfUser(Long calcomUserId) {
String QUERY = "DELETE FROM \"EventType\" WHERE \"userId\"= :userId";
SqlParameterSource parameters = new MapSqlParameterSource("userId", calcomUserId);
db.update(QUERY, parameters);

}

public void deleteEventType(Long eventTypeId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public class CalcomLocationsService {

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 VIDEO_CALL = "integrations:jitsi";

private static final String LINK = "https://app.suchtberatung.digital";
private static final String LINK = "suchtberatung.digital";

public String resolveLocationType(CalcomBooking booking) {
if (IN_PERSON_MEETING_MESSAGE.equals(booking.getLocation())) {
Expand All @@ -25,14 +25,14 @@ public String resolveLocationType(CalcomBooking booking) {
return LocationType.PHONE_CALL.name();
} else if (VIDEO_CALL.equals(booking.getLocation())) {
return LocationType.VIDEO_CALL.name();
} else if (LINK.equals(booking.getLocation())) {
} else if (booking.getLocation().contains(LINK)) {
return LocationType.CHAT.name();
}
throw new IllegalStateException("Unknown location type");
}

public String buildCalcomLocations() {
return "[{\"type\": \"integrations:daily\"},"
return "[{\"type\": \"integrations:jitsi\"},"
+ "{\"type\": \"inPerson\",\"address\": \"" + IN_PERSON_MEETING_MESSAGE + "\"},"
+ "{\"link\": \"" + LINK + "\",\"type\": \"link\"},"
+ "{\"type\": \"userPhone\",\"hostPhoneNumber\": \"" + PHONE_CALL_MEETING_MESSAGE + "\"}]";
Expand Down

0 comments on commit 32ef8b1

Please sign in to comment.