Dibya 1 year ago
parent
commit
5ae796f6e2
  1. 3
      GME Remit/Modules/RecipientModules/SetupRecipient/Module Interface/SetupRecipientModuleInterface.swift
  2. 11
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift
  3. 18
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift
  4. 22
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift
  5. 2
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframeInputOutput.swift

3
GME Remit/Modules/RecipientModules/SetupRecipient/Module Interface/SetupRecipientModuleInterface.swift

@ -10,7 +10,8 @@ protocol SetupRecipientModuleInterface: class {
func fetchCountriesAndServiceTypes()
func openSelectMode(with model: [TablePresenterProtocol], type: SetupOpenType)
func openBranches(countryCode: String, bankID: String)
func gotoSendMoney(_ reciptent: Recipient?,_ paymentMethod: PaymentMethodModel?)
func fetchDynamicRecipientFields(country: CountryAndServiceModel?, paymentMode: PaymentServiceType?)
func saveRecipient(at recipient: Recipient, parentType: RecipientParentType, viewcontroller: SetupRecipientViewController)

11
GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift

@ -71,11 +71,18 @@ extension SetupRecipientPresenter: SetupRecipientModuleInterface {
} else {
self.recipient = recipient
let userId = GMEDB.shared.user.string(.userId) ?? ""
interactor?.requestOTP(viewController: viewcontroller, userId: userId, receiverID: recipient.receiverID ?? "")
//interactor?.editRecipient(at: recipient)
// interactor?.requestOTP(viewController: viewcontroller, userId: userId, receiverID: recipient.receiverID ?? "")
interactor?.editRecipient(at: recipient)
}
}
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?) {
wireframe?.gotoSendMoney(reciptent,
paymentMethod)
}
func validateAccount(with validateAccountModel: ValidateAccountRequest, recipient: Recipient) {
viewModel?.progress(isShow: true)
interactor?.validateAccount(with: validateAccountModel, recipient: recipient)

18
GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift

@ -387,12 +387,20 @@ extension SetupRecipientViewController {
cancelTitle: "no_text".localized(),
okAction: { [weak self] in guard let `self` = self else { return }
self.sendReciptent?(successObject.data)
self.dismiss(animated: true) { [weak self] in guard let `self` = self else { return }
self.delegate?.setupRecieient(
self,
didSelectRecipientID: successObject.data?.receiverID ?? ""
)
if let nav = self.navigationController, let recipient = successObject.data, var paymentMethod = successObject.data?.paymentMethod {
if paymentMethod.receiverId == "" {
paymentMethod.receiverId = recipient.receiverID
}
self.viewModel?.presenter?.gotoSendMoney(recipient, paymentMethod)
}
// self.dismiss(animated: true) { [weak self] in guard let `self` = self else { return }
//// self.delegate?.setupRecieient(
//// self,
//// didSelectRecipientID: successObject.data?.receiverID ?? ""
//// )
// }
},
cancelAction: { [weak self] in guard let `self` = self else { return }
self.dismiss(animated: true) { [weak self] in guard let `self` = self else { return }

22
GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframe.swift

@ -14,6 +14,8 @@ class SetupRecipientWireframe {
private var recipient: Recipient?
var sendReciptent: ((Recipient?) -> Void)?
private weak var delegate: SetupRecipientDelegate?
var presenter: RecipientsPresenter?
var viewModel: RecipientsViewModel?
var parentType: RecipientParentType = .sendmoney
}
@ -175,4 +177,24 @@ extension SetupRecipientWireframe: TablePresenterDelegate {
output?.setSelectedData(with: model, type: type)
}
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/RecipientModules/SetupRecipient/User Interface/Wireframe/SetupRecipientWireframeInputOutput.swift

@ -24,6 +24,8 @@ enum SetupOpenType: Int {
protocol SetupRecipientWireframeInput: WireframeInput {
func openSelectMode(with model: [TablePresenterProtocol], type: SetupOpenType)
func openBranches(countryCode: String, bankID: String)
func gotoSendMoney(_ reciptent: Recipient?,
_ paymentMethod: PaymentMethodModel?)
}
protocol SetupRecipientWireframeOutput: class {

Loading…
Cancel
Save