Class GroupConversationServiceImpl
java.lang.Object
com.finconsgroup.itserr.marketplace.usercommunication.dm.service.impl.GroupConversationServiceImpl
- All Implemented Interfaces:
GroupConversationService
@Service
public class GroupConversationServiceImpl
extends Object
implements GroupConversationService
Service implementation for
GroupConversationService.
Contains business rules for participants, permissions, read receipts, and stats.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateGroupConversation(String name, String description, UUID createdBy) Create a new group conversation.booleanhasAdminPrivileges(UUID conversationId, UUID userId) Check if a user has admin privileges in the conversation.voidinviteUserToGroup(UUID conversationId, UUID userId, UUID invitedBy) Invite a user to a group conversation.booleanisUserParticipant(UUID conversationId, UUID userId) Check if a user is a participant in the conversation.voidpromoteUserToAdmin(UUID conversationId, UUID userId, UUID promotedBy) Promote a user to admin in a group conversation.booleanremoveUserFromGroup(UUID conversationId, UUID userId, UUID removedBy) Remove a user from a group conversation.
-
Constructor Details
-
GroupConversationServiceImpl
public GroupConversationServiceImpl()
-
-
Method Details
-
createGroupConversation
@Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public Conversation createGroupConversation(String name, String description, UUID createdBy) Description copied from interface:GroupConversationServiceCreate a new group conversation.- Specified by:
createGroupConversationin interfaceGroupConversationService- Parameters:
name- group namedescription- group description (optional)createdBy- creator user ID- Returns:
- the created Conversation entity
-
inviteUserToGroup
@Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public void inviteUserToGroup(UUID conversationId, UUID userId, UUID invitedBy) Description copied from interface:GroupConversationServiceInvite a user to a group conversation.- Specified by:
inviteUserToGroupin interfaceGroupConversationService- Parameters:
conversationId- the conversation IDuserId- user to be invitedinvitedBy- inviter user ID
-
removeUserFromGroup
@Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public boolean removeUserFromGroup(UUID conversationId, UUID userId, UUID removedBy) Description copied from interface:GroupConversationServiceRemove a user from a group conversation.- Specified by:
removeUserFromGroupin interfaceGroupConversationService- Parameters:
conversationId- the conversation IDuserId- user to removeremovedBy- actor performing the removal- Returns:
- true if removal succeeded
-
promoteUserToAdmin
@Transactional(propagation=REQUIRED, rollbackFor=java.lang.Exception.class) public void promoteUserToAdmin(UUID conversationId, UUID userId, UUID promotedBy) Description copied from interface:GroupConversationServicePromote a user to admin in a group conversation.- Specified by:
promoteUserToAdminin interfaceGroupConversationService- Parameters:
conversationId- the conversation IDuserId- user to promotepromotedBy- actor performing the promotion
-
isUserParticipant
@Transactional(propagation=REQUIRED, readOnly=true, noRollbackFor=java.lang.Exception.class) public boolean isUserParticipant(UUID conversationId, UUID userId) Description copied from interface:GroupConversationServiceCheck if a user is a participant in the conversation.- Specified by:
isUserParticipantin interfaceGroupConversationService- Parameters:
conversationId- the conversation IDuserId- the user ID- Returns:
- true if the user is an active participant
-
hasAdminPrivileges
@Transactional(propagation=REQUIRED, readOnly=true, noRollbackFor=java.lang.Exception.class) public boolean hasAdminPrivileges(UUID conversationId, UUID userId) Description copied from interface:GroupConversationServiceCheck if a user has admin privileges in the conversation.- Specified by:
hasAdminPrivilegesin interfaceGroupConversationService- Parameters:
conversationId- the conversation IDuserId- the user ID- Returns:
- true if the user is admin
-