You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
2.2 KiB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
  1. //
  2. // SendMoneyReceiptWireframe.swift
  3. // GMERemittance
  4. //
  5. // Created by gme_2 on 04/09/2018.
  6. //Copyright © 2018 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import UIKit
  9. class SendMoneyReceiptWireframe {
  10. weak var view: UIViewController!
  11. var transactionId: String?
  12. var controlNo: String?
  13. var isFromTransactionReport = false
  14. let mailboxwireFrame = MessageComposeWireframe()
  15. }
  16. extension SendMoneyReceiptWireframe: SendMoneyReceiptWireframeInput {
  17. var storyboardName: String {return "SendMoneyReceipt"}
  18. func getMainView() -> UIViewController {
  19. let service = SendMoneyReceiptService()
  20. let interactor = SendMoneyReceiptInteractor(service: service, transactionId: self.transactionId ?? "")
  21. let presenter = SendMoneyReceiptPresenter()
  22. let viewController = viewControllerFromStoryboard(of: SendMoneyReceiptViewController.self)
  23. viewController.controlNo = self.controlNo // todo: refractor later
  24. viewController.transactionId = self.transactionId // todo: refractor later
  25. viewController.shouldShowCancelAmmendButton = self.isFromTransactionReport
  26. viewController.presenter = presenter
  27. interactor.output = presenter
  28. presenter.interactor = interactor
  29. presenter.wireframe = self
  30. presenter.view = viewController
  31. self.view = viewController
  32. return viewController
  33. }
  34. func openReciept(transactionId: String, source: UINavigationController) {
  35. self.transactionId = transactionId
  36. self.pushMainView(in: source)
  37. }
  38. func openRecieptFromTransactionReport(controlNo: String, transactionId: String, shouldShowCancelAmmendButton: Bool, source: UINavigationController) {
  39. self.transactionId = transactionId
  40. self.controlNo = controlNo
  41. self.pushMainView(in: source)
  42. }
  43. func dismiss() {
  44. self.view.navigationController?.popViewController(animated: true)
  45. }
  46. func openMail(controlNO: String, transactionId: String, type: MailBoxType) {
  47. if let navigation = self.view.navigationController {
  48. mailboxwireFrame.openMail(controlNO: controlNO, transactionId: transactionId, type: type, source: navigation)
  49. }
  50. }
  51. }