Browse Source

Bank deposit success

pull/1/head
Amrit Giri 4 years ago
parent
commit
1ee226d529
  1. 5
      GME Remit/Modules/Withdraw/WithdrawFromWallet/Application Logic/Service/WithdrawFromWalletService.swift
  2. 34
      GME Remit/Modules/Withdraw/WithdrawFromWallet/User Interface/View/ViewModels/WithdrawInformation.swift
  3. 4
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractor.swift
  4. 2
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Application Logic/Interactor/WithdrawFromWalletDetailInteractorIO.swift
  5. 1
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift
  6. 6
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/Presenter/WithdrawFromWalletDetailPresenter.swift
  7. 2
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard
  8. 12
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewController.swift
  9. 1
      GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetailViewInterface.swift
  10. 6
      GME Remit/MultiLanguages/en.lproj/Localizable.strings

5
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)
}
}
},

34
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"]
}
}

4
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

2
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)
}

1
GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/Module Interface/WithdrawFromWalletDetailModuleInterface.swift

@ -8,4 +8,5 @@
protocol WithdrawFromWalletDetailModuleInterface: class {
func makeApiRequest(password: String)
func fetchModel()
}

6
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)
}
}

2
GME Remit/Modules/Withdraw/WithdrawFromWalletDetail/User Interface/View/WithdrawFromWalletDetail.storyboard

@ -45,7 +45,7 @@
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="9uq-dp-ZlF" userLabel="Agent">
<rect key="frame" x="0.0" y="0.0" width="0.0" height="50"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="14"/>
<fontDescription key="fontDescription" name="SanFranciscoText-Bold" family="San Francisco Text" pointSize="16"/>
<color key="textColor" name="ThemeRed"/>
<nil key="highlightedColor"/>
</label>

12
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"
}
}

1
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)
}

6
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";

Loading…
Cancel
Save