Skip to content

Commit

Permalink
feat: :saprkles: group member invite feat
Browse files Browse the repository at this point in the history
  • Loading branch information
arunasd463 committed Feb 8, 2024
1 parent 6531ba7 commit bed0a1b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class UserGroupInvitationData {
private Long userGroupId;
private List<Long> founderIds;
private List<Long> moderatorsIds;
private List<Long> memberIds;
private List<String> founderEmail;
private List<String> moderatorsEmail;

Expand All @@ -29,15 +30,17 @@ public UserGroupInvitationData() {
* @param userGroupId
* @param founderIds
* @param moderatorsIds
* @param memberIds
* @param founderEmail
* @param moderatorsEmail
*/
public UserGroupInvitationData(Long userGroupId, List<Long> founderIds, List<Long> moderatorsIds,
List<String> founderEmail, List<String> moderatorsEmail) {
List<Long> memberIds, List<String> founderEmail, List<String> moderatorsEmail) {
super();
this.userGroupId = userGroupId;
this.founderIds = founderIds;
this.moderatorsIds = moderatorsIds;
this.memberIds = memberIds;
this.founderEmail = founderEmail;
this.moderatorsEmail = moderatorsEmail;
}
Expand Down Expand Up @@ -66,6 +69,14 @@ public void setModeratorsIds(List<Long> moderatorsIds) {
this.moderatorsIds = moderatorsIds;
}

public List<Long> getMemberIds() {
return memberIds;
}

public void setMemberIds(List<Long> memberIds) {
this.memberIds = memberIds;
}

public List<String> getFounderEmail() {
return founderEmail;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@ public Boolean addMemberRoleInvitaions(HttpServletRequest request, CommonProfile
String serverUrl = properties.getProperty("serverUrl");
Long founderId = Long.parseLong(properties.getProperty("userGroupFounder"));
Long moderatorId = Long.parseLong(properties.getProperty("userGroupExpert"));
Long memberId = Long.parseLong(properties.getProperty("userGroupMember"));
in.close();

Long inviterId = Long.parseLong(profile.getId());
Expand Down Expand Up @@ -814,6 +815,20 @@ public Boolean addMemberRoleInvitaions(HttpServletRequest request, CommonProfile

}
}
if (!userGroupInvitations.getMemberIds().isEmpty()) {
for (Long inviteeId : userGroupInvitations.getMemberIds()) {

InvitaionMailData mailData = getInvitationMailData(request, inviterId, inviteeId,
userGroupInvitations.getUserGroupId(), memberId, "Member", null, userGroupIbp, false);

if (mailData != null) {
validateMember(request, inviteeId, mailData.getToken());
inviteData.add(mailData);

}

}
}
if (!userGroupInvitations.getFounderEmail().isEmpty()) {
for (String email : userGroupInvitations.getFounderEmail()) {
InvitaionMailData mailData = getInvitationMailData(request, inviterId, null,
Expand Down

0 comments on commit bed0a1b

Please sign in to comment.