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.

52 lines
1.8 KiB

6 years ago
6 years ago
  1. //
  2. // ResendExchangePresenter.swift
  3. // GME Remit
  4. //
  5. // Created by gme_2 on 18/03/2019.
  6. //Copyright © 2019 Gobal Money Express Co. Ltd. All rights reserved.
  7. //
  8. import Foundation
  9. class ResendExchangePresenter {
  10. // MARK: Properties
  11. weak var view: ResendExchangeViewInterface?
  12. var interactor: ResendExchangeInteractorInput?
  13. var wireframe: ResendExchangeWireframeInput?
  14. // MARK: Converting entities
  15. }
  16. // MARK: ResendExchange module interface
  17. extension ResendExchangePresenter: ResendExchangeModuleInterface {
  18. func viewIsReady() {
  19. interactor?.viewIsReady()
  20. }
  21. func calculate(senderAmt: String, senderCurrency: String, recieverAmt: String, recieverCurrency: String, recieverCountryName: String, recieverCountryId: String, paymentMethod: String, paymentMethodId: String, calcBy: String, senderCountryId: String, payoutPartner: String, userId: String, bankId: String) {
  22. self.view?.showLoading()
  23. interactor?.calculate(senderAmt: senderAmt, senderCurrency: senderCurrency, recieverAmt: recieverAmt, recieverCurrency: recieverCurrency, recieverCountryName: recieverCountryName, recieverCountryId: recieverCountryId, paymentMethod: paymentMethod, paymentMethodId: paymentMethodId, calcBy: calcBy, senderCountryId: senderCountryId, payoutPartner: payoutPartner, userId: userId, bankId: bankId)
  24. }
  25. }
  26. // MARK: ResendExchange interactor output interface
  27. extension ResendExchangePresenter: ResendExchangeInteractorOutput {
  28. func show(model: ResendDetail) {
  29. self.view?.hideLoading()
  30. self.view?.show(model: model)
  31. }
  32. func show(model: SendMoneyExchangeRateModel) {
  33. self.view?.hideLoading()
  34. self.view?.show(model: model)
  35. }
  36. func show(error: Error) {
  37. self.view?.hideLoading()
  38. self.view?.show(error: error.localizedDescription)
  39. }
  40. }