// // SendMoneyReceiptWireframe.swift // GMERemittance // // Created by gme_2 on 04/09/2018. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved. // import UIKit class SendMoneyReceiptWireframe { weak var view: UIViewController! var transactionId: String? var controlNo: String? var isFromTransactionReport = false let mailboxwireFrame = MessageComposeWireframe() } extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput { var storyboardName: String {return "SendMoneyReceipt"} func getMainView() -> UIViewController { let service = SendMoneyReceiptService() let interactor = SendMoneyReceiptInteractor(service: service, transactionId: self.transactionId ?? "") let presenter = SendMoneyReceiptPresenter() let viewController = viewControllerFromStoryboard(of: SendMoneyReceiptViewController.self) viewController.controlNo = self.controlNo // todo: refractor later viewController.transactionId = self.transactionId // todo: refractor later viewController.shouldShowCancelAmmendButton = self.isFromTransactionReport viewController.presenter = presenter interactor.output = presenter presenter.interactor = interactor presenter.wireframe = self presenter.view = viewController self.view = viewController return viewController } func openReciept(transactionId: String, source: UINavigationController) { self.transactionId = transactionId self.pushMainView(in: source) } func openRecieptFromTransactionReport(controlNo: String, transactionId: String, shouldShowCancelAmmendButton: Bool, source: UINavigationController) { self.transactionId = transactionId self.controlNo = controlNo self.pushMainView(in: source) } func dismiss() { self.view.navigationController?.popViewController(animated: true) } func openMail(controlNO: String, transactionId: String, type: MailBoxType) { if let navigation = self.view.navigationController { mailboxwireFrame.openMail(controlNO: controlNO, transactionId: transactionId, type: type, source: navigation) } } }