class OrgExternalService {

  public String getOrgIdFromOrgExternalIdAndProvider(String externalId, String provider) {
    Map<String, Object> dbRequestMap = new HashMap<>();
    dbRequestMap.put(JsonKey.EXTERNAL_ID, externalId.toLowerCase());
    dbRequestMap.put(JsonKey.PROVIDER, provider.toLowerCase());
    Response response =
        getCassandraOperation().getRecordsByCompositeKey(
            KEYSPACE_NAME, ORG_EXTERNAL_IDENTITY, dbRequestMap);
    List<Map<String, Object>> orgList =
        (List<Map<String, Object>>) response.getResult().get(JsonKey.RESPONSE);
    if (CollectionUtils.isNotEmpty(orgList)) {
      Map<String, Object> orgExternalMap = orgList.get(0);
      if (MapUtils.isNotEmpty(orgExternalMap)) {
        return (String) orgExternalMap.get(JsonKey.ORG_ID);
      }
    }
    return null;
  }

}