Browse Source

kyc done

pull/1/head
Amrit 4 years ago
parent
commit
3e4b66216f
  1. 8
      GME Remit/APIs/UrlManager.swift
  2. 14
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift
  3. 17
      GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift

8
GME Remit/APIs/UrlManager.swift

@ -39,8 +39,8 @@ class UrlManager {
case .ngrok:
self.baseURL = justinServer
case .testLive:
// self.baseURL = "http://103.139.152.11:5555/api/"
self.baseURL = "http://203.223.132.110:9093/api/"
self.baseURL = "http://103.139.152.11:5555/api/"
// self.baseURL = "http://203.223.132.110:9093/api/"
}
}
@ -59,8 +59,8 @@ class UrlManager {
case .ngrok:
self.baseURL = justinServer
case .testLive:
// self.baseURL = "http://103.139.152.11:5555/api/"
self.baseURL = "http://203.223.132.110:9093/api/"
self.baseURL = "http://103.139.152.11:5555/api/"
// self.baseURL = "http://203.223.132.110:9093/api/"
}
}
}

14
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/Presenter/NewRegisterStep1Presenter.swift

@ -74,7 +74,7 @@ class NewRegisterStep1Presenter: ViewModelType {
let isSetPersonalInformation: Driver<Bool>
let isSetPrimaryInformation: Driver<Bool>
let isSetPictureInformation: Driver<Bool>
let storePrimarySuccess: Driver<Bool>
let storedSuccess: Driver<String>
}
@ -88,6 +88,7 @@ class NewRegisterStep1Presenter: ViewModelType {
private var storedPersonalInfo = PublishSubject<PersonalInformation?>()
private var storedPrimaryInfo = PublishSubject<PrimaryInformation?>()
private var storedPictureInformation = PublishSubject<PictureInformation?>()
private let storedPrimarySuccess = PublishSubject<String?>()
private let storedSuccess = PublishSubject<String>()
func transform(input: Input) -> Output {
@ -183,6 +184,10 @@ class NewRegisterStep1Presenter: ViewModelType {
.combineLatest(input.isValidPictures, storedPictureInformation.asDriverOnErrorJustComplete())
.map {$0 && $1 != nil}
let storePrimarySuccess = Driver
.combineLatest(input.isValidPrimaryInfo, storedPrimarySuccess.asDriverOnErrorJustComplete())
.map {$0 && $1 != nil}
input.viewWillAppear.drive(onNext: { [weak self] in
self?.progressLinker.onNext(true)
self?.interactor?.fetchInformation()
@ -298,6 +303,7 @@ class NewRegisterStep1Presenter: ViewModelType {
isSetPersonalInformation: isSetPersonalInformation,
isSetPrimaryInformation: isSetPrimaryInformation,
isSetPictureInformation: isSetPictureInformation,
storePrimarySuccess: storePrimarySuccess,
storedSuccess: storedSuccess.asDriverOnErrorJustComplete()
)
}
@ -308,7 +314,6 @@ extension NewRegisterStep1Presenter: NewRegisterStep1InteractorOutput {
func setModel(with model: KYCInformation) {
progressLinker.onNext(false)
self.model.onNext(model)
guard let personalInformation = model.personalInformation, !personalInformation.isHasEmptyValue() else {
storedPersonalInfo.onNext(nil)
return
@ -334,12 +339,15 @@ extension NewRegisterStep1Presenter: NewRegisterStep1InteractorOutput {
progressLinker.onNext(false)
guard let storedModel = storedModel, let type = Step(rawValue: storedModel.type) else { return }
switch type {
case .innerStep1:
storedPersonalInfo.onNext(storedModel.personalInformation)
case .innerStep2:
storedPrimaryInfo.onNext(storedModel.primaryInformation)
storedPrimarySuccess.onNext(message)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
self.storedPrimarySuccess.onNext(nil)
}
case .innerStep3:
storedPictureInformation.onNext(storedModel.pictures)
storedSuccess.onNext(message)

17
GME Remit/Modules/RegisterModules/UserAuthentication/NewRegisterStep1/User Interface/View/NewRegisterStep1ViewController.swift

@ -19,6 +19,7 @@ class NewRegisterStep1ViewController: UIViewController {
case anotherID
}
var step: NewRegisterViewController.Step = .first
var isFirst: Bool = true
// MARK: Properties
var presenter: NewRegisterStep1Presenter!
weak var delegate: NewRegisterDelegate?
@ -113,15 +114,14 @@ class NewRegisterStep1ViewController: UIViewController {
// MARK: VC's Life cycle
override func viewDidLoad() {
super.viewDidLoad()
self.isFirst = (self.step == .first)
setup()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
if self.step != .first{
self.personalInformationStack.isHidden = true
self.primaryInformationContainerView.isHidden = true
}
self.personalInformationStack.isHidden = self.step != .first
uploadPicturesContainerView.isHidden = self.step == .first
}
@ -228,7 +228,6 @@ extension NewRegisterStep1ViewController {
anotherIDImageButton.layer.borderWidth = 1
anotherIDImageButton.layer.borderColor = UIColor.themeText.cgColor
primaryInformationContainerView.isHidden = true
idIssueDateTextField.isHidden = true
idExpiryDateTextField.isHidden = true
@ -684,6 +683,16 @@ extension NewRegisterStep1ViewController {
}).disposed(by: disposeBag)
output.isSetPrimaryInformation
.distinctUntilChanged()
.drive(onNext: {[weak self] isHidden in
guard let self = self else {return}
if self.isFirst{
self.isFirst = false
self.delegate?.newRegister(self, currentStep: .first, nextStep: .upload)
}
}).disposed(by: disposeBag)
output.storePrimarySuccess
.distinctUntilChanged()
.drive(onNext: {[weak self] isHidden in
guard let self = self else {return}

Loading…
Cancel
Save