Browse Source

transfer kyc response model to penny test wireframe

pull/1/head
ccr 6 years ago
parent
commit
3143b425bf
  1. 4
      GMERemittance/Model/KYCResponseModel.swift
  2. 1
      GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift
  3. 2
      GMERemittance/Module/New Group/Kyc/Module Interface/KycModuleInterface.swift
  4. 10
      GMERemittance/Module/New Group/Kyc/User Interface/Presenter/KycPresenter.swift
  5. 9
      GMERemittance/Module/New Group/Kyc/User Interface/View/KycViewController.swift
  6. 1
      GMERemittance/Module/New Group/Kyc/User Interface/View/KycViewInterface.swift
  7. 8
      GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframe.swift
  8. 1
      GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframeInput.swift
  9. 6
      GMERemittance/Module/PennyTest/User Interface/Wireframe/PennyTestWireframe.swift

4
GMERemittance/Model/KYCResponseModel.swift

@ -51,6 +51,10 @@ class KYCResponse: Mappable {
var passportUrl: String?
var selfieUrl: String?
init() {
}
required init?(map: Map) {
}

1
GMERemittance/Module/New Group/Kyc/Application Logic/Interactor/KycInteractor.swift

@ -266,6 +266,7 @@ extension KycInteractor: KycInteractorInput {
self.service.submit(param: params, images: images, success: { (response) in
// print(response?.firstName)
// Todo: After success what?
// show message from api
UserDefaults.standard.set(true, forKey: UserKeys.kyc)
self.output?.submitSuccess()

2
GMERemittance/Module/New Group/Kyc/Module Interface/KycModuleInterface.swift

@ -8,4 +8,6 @@
protocol KycModuleInterface: class {
func validate(model: KYCRequestModel)
func goHome()
func showPennyTest()
}

10
GMERemittance/Module/New Group/Kyc/User Interface/Presenter/KycPresenter.swift

@ -34,9 +34,19 @@ extension KycPresenter: KycModuleInterface {
extension KycPresenter: KycInteractorOutput {
func submitSuccess() {
self.view?.showOption()
}
func goHome() {
self.wireframe?.gotToHome()
}
func showPennyTest() {
// TODO: keycresponse is comming from interactor
self.wireframe?.showPennyTest(model: KYCResponse())
}
func show(result1: (isValid: Bool, errorsDick: [String : String])) {
self.view?.hideLoading()
self.view?.show(resultl: result1)

9
GMERemittance/Module/New Group/Kyc/User Interface/View/KycViewController.swift

@ -178,6 +178,15 @@ extension KycViewController: KycViewInterface {
}
}
func showOption() {
let message = "Would you like to apply for penny test now?"
self.alertWithOkCancel(message: message, title: "Info", okTitle: "Ok", style: UIAlertControllerStyle.alert, cancelTitle: "Cancel", OkStyle: UIAlertActionStyle.default, cancelStyle: UIAlertActionStyle.default, okAction: {
self.presenter?.showPennyTest()
}) {
self.presenter?.goHome()
}
}
func show(error: String) {
self.alert(message: error)
}

1
GMERemittance/Module/New Group/Kyc/User Interface/View/KycViewInterface.swift

@ -11,6 +11,7 @@ protocol KycViewInterface: class {
func show(result2: (isValid: Bool, errorsDick: [String : String]))
func show(result3: (isValid: Bool, errorsDick: [String : String]))
func show(error: String)
func showOption()
func showLoading()
func hideLoading()
}

8
GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframe.swift

@ -10,6 +10,7 @@ import UIKit
class KycWireframe {
weak var view: UIViewController!
lazy var pennytestWireFrame = PennyTestWireframe()
}
extension KycWireframe: KycWireframeInput {
@ -37,4 +38,11 @@ extension KycWireframe: KycWireframeInput {
navigation.popViewController(animated: true)
}
}
func showPennyTest(model: KYCResponse) {
if let navigation = self.view.navigationController {
pennytestWireFrame.openPennyTest(with: model, source: navigation)
}
}
}

1
GMERemittance/Module/New Group/Kyc/User Interface/Wireframe/KycWireframeInput.swift

@ -10,4 +10,5 @@ import Foundation
protocol KycWireframeInput: WireframeInput {
func gotToHome()
func showPennyTest(model: KYCResponse)
}

6
GMERemittance/Module/PennyTest/User Interface/Wireframe/PennyTestWireframe.swift

@ -10,6 +10,7 @@ import UIKit
class PennyTestWireframe {
weak var view: UIViewController!
var model: KYCResponse?
}
extension PennyTestWireframe: PennyTestWireframeInput {
@ -31,4 +32,9 @@ extension PennyTestWireframe: PennyTestWireframeInput {
self.view = viewController
return viewController
}
func openPennyTest(with model: KYCResponse, source: UINavigationController) {
self.model = model
self.pushMainView(in: source)
}
}
Loading…
Cancel
Save