/// Use case: Envoyer un message v4
library send_message;

import 'package:injectable/injectable.dart';

import '../entities/message.dart';
import '../repositories/messaging_repository.dart';

@lazySingleton
class SendMessage {
  final MessagingRepository repository;

  SendMessage(this.repository);

  Future<Message> call({
    required String conversationId,
    required String contenu,
    String typeMessage = 'TEXTE',
  }) async {
    return await repository.envoyerMessage(
      conversationId,
      typeMessage: typeMessage,
      contenu: contenu,
    );
  }
}
