Browse Source

terms receiverid issue

v0.17
Dibya 1 year ago
parent
commit
68536d97f8
  1. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift
  2. 7
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift
  3. 18
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift
  4. 21
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Wireframe/TermsAndConditionWireframe.swift
  5. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Wireframe/TermsAndConditionWireframeInput.swift

2
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift

@ -15,6 +15,8 @@ protocol TermsAndConditionModuleInterface: class {
func success()
func checkOtp(otp: String, userId: String, receiverID: String)
func requestOtp(userId: String, receiverID: String)
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?)
}
protocol TermsAndConditionModuleDelegate: class {
func setupRecieient(_ viewController: TermsAndConditionViewController, didSelectRecipientID: String?)

7
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift

@ -36,6 +36,13 @@ extension TermsAndConditionPresenter: TermsAndConditionModuleInterface {
}
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?) {
wireframe?.gotoSendMoney(reciptent,
paymentMethod)
}
func validateAccount(with validateAccountModel: ValidateAccountRequest, recipient: Recipient) {
}

18
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift

@ -147,8 +147,8 @@ class TermsAndConditionViewController: UIViewController {
extension TermsAndConditionViewController: OtpDelegate {
func getOtp(otp: String, tappedButton: String) {
guard let userId = GMEDB.shared.user.string(.userId) else {return}
if tappedButton == "ok_text".localized() {
self.presenter?.checkOtp(otp: otp, userId: userId, receiverID: self.reciepient?.receiverID ?? "")
if tappedButton == "ok_text".localized(), let receiverID = self.paymentModel?.receiverId ?? self.reciepient?.paymentMethod?.receiverId {
self.presenter?.checkOtp(otp: otp, userId: userId, receiverID: receiverID)
}
}
@ -164,11 +164,17 @@ extension TermsAndConditionViewController: TermsAndConditionViewInterface {
cancelTitle: "no_text".localized(),
okAction: { [weak self] in guard let `self` = self else { return }
self.dismiss(animated: true) { [weak self] in guard let `self` = self else { return }
self.delegate?.setupRecieientForTermsVC(
self,
didSelectRecipientID: self.reciepient?.receiverID ?? ""
)
// self.delegate?.setupRecieientForTermsVC(
// self,
// didSelectRecipientID: self.reciepient?.receiverID ?? ""
// )
if let nav = self.navigationController, let recipient = self.reciepient, var paymentMethod = self.reciepient?.paymentMethod {
if paymentMethod.receiverId == "" {
paymentMethod.receiverId = recipient.receiverID
}
self.presenter?.gotoSendMoney(recipient, paymentMethod)
}
}
},

21
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Wireframe/TermsAndConditionWireframe.swift

@ -12,6 +12,8 @@ class TermsAndConditionWireframe {
weak var view: UIViewController!
var reciepient: Recipient?
var model: SendMoneyRequestModel?
var presenter: RecipientsPresenter?
var viewModel: RecipientsViewModel?
private lazy var reciptWireframe = SendMoneyReceiptWireframe()
}
@ -41,4 +43,23 @@ extension TermsAndConditionWireframe: TermsAndConditionWireframeInput {
reciptWireframe.openReciept(transactionId: transactionId, source: navigation)
}
}
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?) {
guard let navigationVC = view.navigationController else {
return
}
guard let recipientData = reciptent else {
return
}
let wireframe = SendMoneyParentWireframe()
wireframe.output = self.presenter
wireframe.viewModel = self.viewModel
wireframe.paymentMethod = paymentMethod
wireframe.open(for: recipientData, in: navigationVC)
}
}

2
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Wireframe/TermsAndConditionWireframeInput.swift

@ -10,4 +10,6 @@ import Foundation
protocol TermsAndConditionWireframeInput: WireframeInput {
func openReciept(transactionId: String)
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?)
}
Loading…
Cancel
Save