diff --git a/packages/chat_repository_interface/lib/src/interfaces/chat_repostory_interface.dart b/packages/chat_repository_interface/lib/src/interfaces/chat_repostory_interface.dart index becd6cb..b18c530 100644 --- a/packages/chat_repository_interface/lib/src/interfaces/chat_repostory_interface.dart +++ b/packages/chat_repository_interface/lib/src/interfaces/chat_repostory_interface.dart @@ -73,17 +73,27 @@ abstract class ChatRepositoryInterface { required MessageModel firstMessage, }); - /// Function that provides the next message id + /// Retrieve the next unused message id given a current chat. + /// + /// The resulting string should be at least unique per [chatId]. The userId + /// is provided in case the specific user has influence on the id. + /// + /// Imagine returning a UUID, the next integer in a counter or the document + /// id in firebase. Future getNextMessageId({ required String userId, required String chatId, }); /// Send a message with the given parameters. + /// /// [chatId] is the chat id. /// [senderId] is the sender id. + /// [messageId] is the identifier for this message /// [text] is the message text. /// [imageUrl] is the image url. + /// [messageType] is a way to identify a difference in messages + /// [timestamp] is the moment of sending. Future sendMessage({ required String chatId, required String senderId, diff --git a/packages/chat_repository_interface/lib/src/interfaces/pending_message_repository_interface.dart b/packages/chat_repository_interface/lib/src/interfaces/pending_message_repository_interface.dart index cddbd49..f10d18b 100644 --- a/packages/chat_repository_interface/lib/src/interfaces/pending_message_repository_interface.dart +++ b/packages/chat_repository_interface/lib/src/interfaces/pending_message_repository_interface.dart @@ -15,10 +15,14 @@ abstract class PendingMessageRepositoryInterface { }); /// Create a message in the pending messages and return the created message. + /// /// [chatId] is the chat id. /// [senderId] is the sender id. + /// [messageId] is the identifier for this message /// [text] is the message text. /// [imageUrl] is the image url. + /// [messageType] is a way to identify a difference in messages + /// [timestamp] is the moment of sending. Future createMessage({ required String chatId, required String senderId,