diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWallet/Application Logic/Service/WithdrawFromWalletService.swift b/GME Remit/Modules/Withdraw/WithdrawFromWallet/Application Logic/Service/WithdrawFromWalletService.swift index cf3143f6..25d091eb 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWallet/Application Logic/Service/WithdrawFromWalletService.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWallet/Application Logic/Service/WithdrawFromWalletService.swift @@ -24,7 +24,10 @@ class WithdrawFromWalletService: WithdrawFromWalletServiceType { failure(error) } else { if let model = response.data{ - success(model) + var neModel = WithdrawInformation() + neModel = model + neModel.amount = amount + success(neModel) } } }, diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWallet/User Interface/View/ViewModels/WithdrawInformation.swift b/GME Remit/Modules/Withdraw/WithdrawFromWallet/User Interface/View/ViewModels/WithdrawInformation.swift index 829253f2..4ebc3c43 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWallet/User Interface/View/ViewModels/WithdrawInformation.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWallet/User Interface/View/ViewModels/WithdrawInformation.swift @@ -10,21 +10,23 @@ import Foundation import ObjectMapper struct WithdrawInformation: Mappable { - var bankName: String? - var accountNo: String? - var amount: String? - var serviceCharge: String? - var noticeMessage: String? - init?(map: Map) { - - } - - mutating func mapping(map: Map) { - bankName <- map["bankName"] - accountNo <- map["accountNo"] - amount <- map["amount"] - serviceCharge <- map["serviceCharge"] - noticeMessage <- map["noticeMessage"] - } + var bankName: String? + var accountNo: String? + var amount: String? + var serviceCharge: String? + var noticeMessage: String? + init?(map: Map) { + + } + init() { + + } + mutating func mapping(map: Map) { + bankName <- map["bankName"] + accountNo <- map["accountNo"] + amount <- map["amount"] + serviceCharge <- map["serviceCharge"] + noticeMessage <- map["noticeMessage"] + } } diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractor.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractor.swift index 9a45a6b7..9350d32e 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractor.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractor.swift @@ -29,6 +29,10 @@ class WithdrawFromWalletDetailInteractor { // MARK: WithdrawFromWalletDetail interactor input interface extension WithdrawFromWalletDetailInteractor: WithdrawFromWalletDetailInteractorInput { + func fetchModel(){ + guard let withdrawInfo = self.withdrawInfo else {return} + self.output?.setModel(model: withdrawInfo) + } func makeApiRequest(password: String) { guard let withdrawInfo = self.withdrawInfo else {return} self.service.makeApiRequest(amount: withdrawInfo.amount ?? "", password: password,success: { (message) in diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractorIO.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractorIO.swift index 5184d525..b03cf556 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractorIO.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractorIO.swift @@ -8,9 +8,11 @@ protocol WithdrawFromWalletDetailInteractorInput: class { func makeApiRequest(password: String) + func fetchModel() } protocol WithdrawFromWalletDetailInteractorOutput: class { func show(error: Error) func success(message: String) + func setModel(model: WithdrawInformation) } diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift index 72edbd8d..a3ba30f2 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift @@ -8,4 +8,5 @@ protocol WithdrawFromWalletDetailModuleInterface: class { func makeApiRequest(password: String) + func fetchModel() } diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/Presenter/WithdrawFromWalletDetailPresenter.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/Presenter/WithdrawFromWalletDetailPresenter.swift index 1fc9f657..2f576c86 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/Presenter/WithdrawFromWalletDetailPresenter.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/Presenter/WithdrawFromWalletDetailPresenter.swift @@ -26,6 +26,9 @@ extension WithdrawFromWalletDetailPresenter: WithdrawFromWalletDetailModuleInter self.view?.showLoading() self.interactor?.makeApiRequest(password: password) } + func fetchModel(){ + self.interactor?.fetchModel() + } } // MARK: WithdrawFromWalletDetail interactor output interface @@ -40,4 +43,7 @@ extension WithdrawFromWalletDetailPresenter: WithdrawFromWalletDetailInteractorO self.view?.hideLoading() self.view?.show(message: message) } + func setModel(model: WithdrawInformation){ + self.view?.setModel(model: model) + } } diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard index 5411de8c..c2e6f999 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard @@ -45,7 +45,7 @@ diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewController.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewController.swift index 181c091c..3cefd867 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewController.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewController.swift @@ -10,8 +10,8 @@ import UIKit class WithdrawFromWalletDetailViewController: UIViewController { struct StringConstants { - let titleText = "withdraw_text".localized() - let descText = "withdraw_detail_text".localized() + let titleText = "bank_deposit_text".localized() + let descText = "bank_deposit_detail_text".localized() let bankText = "bank_text".localized() let accountNumberText = "account_number_text".localized() let amountText = "amount_text".localized() @@ -52,6 +52,7 @@ class WithdrawFromWalletDetailViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() self.setup() + self.presenter?.fetchModel() } override func viewWillAppear(_ animated: Bool) { @@ -117,6 +118,13 @@ extension WithdrawFromWalletDetailViewController: WithdrawFromWalletDetailViewIn self.navigationController?.popToRootViewController(animated: true) } } + + func setModel(model: WithdrawInformation){ + self.bankContentLabel.text = model.bankName ?? "" + self.acNumberContentLabel.text = model.accountNo ?? "" + self.amountContentLabel.text = (model.amount ?? "") + " MNT" + self.serviceChargeContentLabel.text = (model.serviceCharge ?? "") + " MNT" + } } diff --git a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewInterface.swift b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewInterface.swift index 2bbda325..8eadced8 100644 --- a/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewInterface.swift +++ b/GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewInterface.swift @@ -11,4 +11,5 @@ protocol WithdrawFromWalletDetailViewInterface: class { func hideLoading() func show(error: String) func show(message: String) + func setModel(model: WithdrawInformation) } diff --git a/GME Remit/MultiLanguages/en.lproj/Localizable.strings b/GME Remit/MultiLanguages/en.lproj/Localizable.strings index 0900d5e7..480d6d6c 100644 --- a/GME Remit/MultiLanguages/en.lproj/Localizable.strings +++ b/GME Remit/MultiLanguages/en.lproj/Localizable.strings @@ -835,10 +835,10 @@ "transfer_pending_text" = "Transfer Pending"; -//Withdraw +//Withdraw/Bank Deposit "withdraw_description" = "Please enter the required amount to withdraw from your wallet to your bank"; -"enter_amount_text" = "Enter Amount"; -"withdraw_detail_text" = "Withdraw Detail"; +"enter_amount_text" = "Enter Amount(MNT)"; +"bank_deposit_detail_text" = "Bank Deposit Detail"; "bank_text" = "Bank"; "amount_text" = "Amount"; "account_number_text" = "Account Number";