/// Use case: Récupérer les conversations
library get_conversations;

import 'package:dartz/dartz.dart';
import 'package:injectable/injectable.dart';
import '../../../../core/error/failures.dart';
import '../entities/conversation.dart';
import '../repositories/messaging_repository.dart';

@lazySingleton
class GetConversations {
  final MessagingRepository repository;

  GetConversations(this.repository);

  Future<Either<Failure, List<Conversation>>> call({
    String? organizationId,
    bool includeArchived = false,
  }) async {
    return await repository.getConversations(
      organizationId: organizationId,
      includeArchived: includeArchived,
    );
  }
}
