//
//  MovieDetailConnector.swift
//  WallboxChallenge
//
//  Created by Miguel Perez on 21/4/21.
//

import UIKit

class MovieDetailConnector {
    
    private let gateway: MovieGateway
    private let movieId: Int
    
    init(gateway: MovieGateway, movieId: Int) {
        self.gateway = gateway
        self.movieId = movieId
    }
    
    func ensanbled(_ viewController: MovieDetailViewController) {
        let fetchMovieByIdUseCase = FetchMovieByIdUseCase(gateway: gateway)
        let presenter = MovieDetailPresenter(view: viewController, fetchMovieByIdUseCase: fetchMovieByIdUseCase, dispatchQueue: DispatchQueue.main, movieId: movieId)
        viewController.presenter = presenter
        viewController.connector = self
    }
}

