Browse Source

Account Validation Bug Fixes

v0.17
Aashish karn 1 year ago
parent
commit
c486678b33
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 2
      GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme
  3. 6
      GME Remit/APIs/Router/APIRouter.swift
  4. 12
      GME Remit/AppDelegate.swift
  5. 2
      GME Remit/Extensions/UITextField+Ext.swift
  6. 4
      GME Remit/Models/Response/ReferralModel.swift
  7. 3
      GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift
  8. 6
      GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift
  9. 2
      GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift
  10. 2
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/Presenter/SetupRecipientPresenter.swift
  11. 2
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/SetupRecipientViewController.swift
  12. 5
      GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift
  13. 4
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift
  14. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift
  15. 6
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift
  16. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift
  17. 4
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift
  18. 22
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift
  19. 5
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift
  20. 5
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift

4
GME Remit.xcodeproj/project.pbxproj

@ -8303,7 +8303,7 @@
"$(inherited)",
"$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module",
);
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 1.4.7;
"OTHER_CODE_SIGN_FLAGS[sdk=*]" = "--generate-entitlement-der";
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
@ -8348,7 +8348,7 @@
"$(inherited)",
"$(PROJECT_DIR)/GME\\ Remit/ThirdParty/virtualKeyboard/mtk_module",
);
MARKETING_VERSION = 1.4.5;
MARKETING_VERSION = 1.4.7;
OTHER_LDFLAGS = (
"$(OTHER_LDFLAGS)",
"-ObjC",

2
GME Remit.xcodeproj/xcshareddata/xcschemes/GME Remit.xcscheme

@ -61,7 +61,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"

6
GME Remit/APIs/Router/APIRouter.swift

@ -116,7 +116,7 @@ enum APIRouter {
case getReferralList
// MARK: RewardPoint
case getRewardPoint
case getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String)
}
// MARK: - Request
@ -660,9 +660,9 @@ extension APIRouter {
let userID = GMEDB.shared.user.string(.senderId) ?? ""
return "\(baseUrlWithoutVersion)/v3/mobile/\(userID)/GetFieldsByProduct?type=4"
case .getRewardPoint:
case .getRewardPoint(let receiverID, let isAccountValidationRrquired, let payoutPartner):
let userID = GMEDB.shared.user.string(.senderId) ?? ""
return "\(baseUrlWithoutVersion)/v3/mobile/\(userID)/GetFieldsByProduct?type=5"
return "\(baseUrlWithoutVersion)/v3/mobile/\(userID)/GetFieldsByProduct?type=5&receiverId=\(receiverID)&payoutPartner=\(payoutPartner)&IsAccountValidation=\(isAccountValidationRrquired)"
case .validateReferralCode(let code):
return "\(baseUrl)/mobile/validateReferralCode"
}

12
GME Remit/AppDelegate.swift

@ -259,7 +259,19 @@ extension AppDelegate: UNUserNotificationCenterDelegate {
DispatchQueue.main.async { [self] in
switch action {
case .notifictaion:
if (KeyChain.shared.get(key: .login) ?? "0") == "0" {
DispatchQueue.main.asyncAfter(deadline: .now() + 0.4, execute: {
let splashWireframe = SplashScreenWireframe()
let splashViewController = splashWireframe.getMainView()
let nav = UINavigationController(rootViewController: splashViewController)
self.window?.rootViewController = nav
})
if #available(iOS 13.0, *) {
window?.overrideUserInterfaceStyle = .light
}
} else {
NotificationListWireframe().open(on: baseVC)
}
case .notice:
NotificationHistoryWireframe().open(on: baseVC)
case .renewID:

2
GME Remit/Extensions/UITextField+Ext.swift

@ -14,6 +14,7 @@ public enum GMEKeyboardType: String {
case alphabet = "A"
case alphabetNumberic = "AN"
case alphabetNumbericSpecial = "ANS"
case alphabetNumbericSpecialWithoutSpace = "ANW"
case numberic = "N"
}
@ -27,6 +28,7 @@ extension UITextField {
switch type {
case .alphabet: extractText = value?.extract(regex: "[A-Za-z\\s]")
case .alphabetNumberic: extractText = value?.extract(regex: "[A-Z0-9a-z\\s]")
case .alphabetNumbericSpecialWithoutSpace: extractText = value?.extract(regex: "[a-zA-Z0-9]")
case .alphabetNumbericSpecial: extractText = value?.filter { $0.isASCII }
case .numberic: extractText = text?.extract(regex: "[0-9]")
}

4
GME Remit/Models/Response/ReferralModel.swift

@ -52,11 +52,15 @@ struct ReferralDetails: Mappable {
struct RewardPointModel: Mappable {
var showRewardPoint: String?
var point: String?
var showValidationdAlert: String?
var validationMsg: String?
init?(map: Map) {}
mutating func mapping(map: Map) {
showRewardPoint <- map["ShowRewardPoint"]
showValidationdAlert <- map["ShowValidationAlert"]
validationMsg <- map["ValidationMsg"]
point <- map["Point"]
}
}

3
GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift

@ -60,6 +60,8 @@ struct Recipient: Mappable {
var isPartnerChanged: String?
var isForceUpdate: String?
var hasVerifiedOTP: Bool?
var isAccountValidationRequired: String?
init?(map: Map) {}
init() {
@ -141,6 +143,7 @@ struct Recipient: Mappable {
isPartnerChanged <- map["isPartnerChanged"]
isForceUpdate <- map["isForceUpdate"]
hasVerifiedOTP <- map["hasVerifiedOTP"]
isAccountValidationRequired <- map["IsAccountValidationReq"]
}
func serialize() -> [String : String] {

6
GME Remit/Modules/RecipientModules/Recipients/User Interface/Wireframe/RecipientsWireframe.swift

@ -12,6 +12,8 @@ class RecipientsWireframe {
weak var view: UIViewController!
weak var output: RecipientsWireframeOutput?
var parentType: RecipientParentType = .sendmoney
var presenter: RecipientsPresenter?
var viewModel: RecipientsViewModel?
}
extension RecipientsWireframe: RecipientsWireframeInput {
@ -23,9 +25,11 @@ extension RecipientsWireframe: RecipientsWireframeInput {
let interactor = RecipientsInteractor(service: service)
let presenter = RecipientsPresenter()
let viewModel = RecipientsViewModel()
self.viewModel = viewModel
let viewController = viewControllerFromStoryboard(of: RecipientsViewController.self)
output = presenter
self.presenter = presenter
viewController.parentType = self.parentType
viewController.viewModel = viewModel
interactor.output = presenter
@ -59,6 +63,8 @@ extension RecipientsWireframe: RecipientsWireframeInput {
return
}
let wireframe = SendMoneyParentWireframe()
wireframe.output = self.presenter
wireframe.viewModel = viewModel
wireframe.open(for: recipient, in: navigationVC)
}

2
GME Remit/Modules/RecipientModules/SetupRecipient/Application Logic/Interactor/SetupRecipientInteractor.swift

@ -95,7 +95,7 @@ extension SetupRecipientInteractor: SetupRecipientInteractorInput {
func checkAccountValidation(request: AccountValidate) {
self.service.checkAccountValidation(request: request) {_ in
self.output?.success()
} failure: { self.output?.accountValidationError(error: $0)}
}

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

@ -100,6 +100,7 @@ extension SetupRecipientPresenter: SetupRecipientInteractorOutput {
}
func accountValidationError(error: Error) {
wireframe?.view.hideProgressHud()
wireframe?.view.gmeAlert(type:.error,
title: "Validation failed",
message: error.localizedDescription,
@ -117,6 +118,7 @@ extension SetupRecipientPresenter: SetupRecipientInteractorOutput {
}
func success() {
wireframe?.view.hideProgressHud()
viewModel?.progress(isShow: true)
if let recipent = self.recipient {
interactor?.editRecipient(at: recipent)

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

@ -718,7 +718,7 @@ extension SetupRecipientViewController: OtpDelegate, UITextFieldDelegate {
let randomInt = Int.random(in: 0..<1000)
let randomNumber = "\(randomInt)"
let accounValidation = AccountValidate(accountNumber: accountTextField.text ?? "", bankCode: self.bankCode, bankCountry: self.countryCode, providerId: self.payoutPartner, paymentMethod: self.selectedPayment, sessionID: randomNumber, firstName: self.firstNameTextField.text ?? "", middleName: middleNameTextField.text ?? "", lastName: lastNameTextField.text ?? "")
self.showProgressHud()
self.viewModel.presenter?.checkAccountValidation(request: accounValidation)
}
}

5
GME Remit/Modules/RecipientModules/SetupRecipient/User Interface/View/ViewModel/SetupRecipientViewModel.swift

@ -259,7 +259,10 @@ class SetupRecipientViewModel: ViewModelType {
bank: selectedBank,
branch: recipient.agent?.branch
)
self.presenter?.validateAccount(with: validateModel, recipient: recipient)
if let viewController = viewController {
self.presenter?.saveRecipient(at: recipient, parentType: parentType, viewcontroller: viewController)
}
//self.presenter?.validateAccount(with: validateModel, recipient: recipient)
} else {
// if let viewController = viewController {
// self.presenter?.moveToTermsAndConditionView(at: recipient, viewController)

4
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractor.swift

@ -47,8 +47,8 @@ extension SendMoneyExchangeRateInteractor: SendMoneyExchangeRateInteractorInput
)
}
func getRewardPoint() {
self.service.getRewardPoint { model in
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) {
self.service.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner) { model in
self.output?.show(model: model)
} failure: { error in
self.output?.show(error: error)

2
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Interactor/SendMoneyExchangeRateInteractorIO.swift

@ -8,7 +8,7 @@
protocol SendMoneyExchangeRateInteractorInput: class {
func calculate(params: [String: String])
func getRewardPoint()
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String)
}
protocol SendMoneyExchangeRateInteractorOutput: class {

6
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift

@ -19,7 +19,7 @@ protocol FetchSendMoneyExchangeRateService: ApiServiceType {
failure: @escaping (Error) -> Void
)
func getRewardPoint(success: @escaping (RewardPointModel) -> Void,
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String, success: @escaping (RewardPointModel) -> Void,
failure: @escaping (Error) -> Void)
}
@ -53,8 +53,8 @@ extension FetchSendMoneyExchangeRateService {
)
}
func getRewardPoint(success: @escaping (RewardPointModel) -> Void,
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String, success: @escaping (RewardPointModel) -> Void,
failure: @escaping (Error) -> Void) {
APIRouter.getRewardPoint.json(success: success, failure: failure)
APIRouter.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner).json(needsAuthorization: true, success: success, failure: failure)
}
}

2
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Module Interface/SendMoneyExchangeRateModuleInterface.swift

@ -23,5 +23,5 @@ protocol SendMoneyExchangeRateModuleInterface: class {
bankId: String?,
discountedFee: String?
)
func getRewardPoint()
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String)
}

4
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/Presenter/SendMoneyExchangeRatePresenter.swift

@ -84,8 +84,8 @@ extension SendMoneyExchangeRatePresenter: SendMoneyExchangeRateModuleInterface {
self.interactor?.calculate(params: param)
}
func getRewardPoint() {
interactor?.getRewardPoint()
func getRewardPoint(receiverID: String, isAccountValidationRequired: String, payoutPartner: String) {
interactor?.getRewardPoint(receiverID: receiverID, isAccountValidationRequired: isAccountValidationRequired, payoutPartner: payoutPartner)
}
}

22
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift

@ -91,6 +91,8 @@ class SendMoneyExchangeRateViewController: UIViewController {
private lazy var couponListTapGesture: UITapGestureRecognizer = UITapGestureRecognizer()
private var plainSendingAmount: String?
var output: RecipientsPresenter?
var viewModel: RecipientsViewModel?
private var action: ActionBehaviour? {
didSet {
@ -182,7 +184,8 @@ class SendMoneyExchangeRateViewController: UIViewController {
setup()
self.cardView.isHidden = true
cardView.layer.cornerRadius = 10
presenter?.getRewardPoint()
self.showProgressHud()
presenter?.getRewardPoint(receiverID: self.reciepient?.receiverID ?? "", isAccountValidationRequired: self.reciepient?.isAccountValidationRequired ?? "", payoutPartner: self.reciepient?.payoutPartner ?? "")
}
override func viewWillAppear(_ animated: Bool) {
@ -460,10 +463,12 @@ class SendMoneyExchangeRateViewController: UIViewController {
extension SendMoneyExchangeRateViewController: SendMoneyExchangeRateViewInterface {
func show(model: SendMoneyExchangeRateModel) {
self.hideProgressHud()
exchangeRateModel = model
}
func show(error: String) {
self.hideProgressHud()
showExchangeRateInfomation(isHidden: false)
alert(type: .error, message: error)
}
@ -477,11 +482,26 @@ extension SendMoneyExchangeRateViewController: SendMoneyExchangeRateViewInterfac
}
func setError(with error: Error) {
self.hideProgressHud()
alert(message: error.localizedDescription)
}
func show(model: RewardPointModel) {
self.hideProgressHud()
self.rewardPointModel = model
if model.showValidationdAlert == "Y" {
self.gmeAlert(type:.error,
title: "Validation failed",
message: model.validationMsg,
rightButtonTitle: "Proceed",
leftButtonTitle: "Edit", rightButtonAction: {
}, leftButtonAction: {
if let reciepient = self.reciepient, let viewModel = self.viewModel {
self.output?.openEditRecipient(who: reciepient, with: viewModel)
}
})
}
}
}

5
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift

@ -85,7 +85,8 @@ class SendMoneyParentViewController: UIViewController {
lazy private var requestModel = SendMoneyRequestModel()
lazy private var cddiModel = CDDIRequestData()
var presenter: SendMoneyParentModuleInterface?
var output: RecipientsPresenter?
var viewModel: RecipientsViewModel?
// Buttons representing the pages marked as 1, 2, 3 in UI.
var stateButtons: [UIButton] = []
@ -184,6 +185,8 @@ class SendMoneyParentViewController: UIViewController {
sendMoneyExchangeRateViewController?.reciepient = self.receipient
sendMoneyExchangeRateViewController?.actionDelegate = self
sendMoneyExchangeRateViewController?.hudDelegate = self
sendMoneyExchangeRateViewController?.output = self.output
sendMoneyExchangeRateViewController?.viewModel = self.viewModel
sendMoneyVerificationViewController = SendMoneyVerificationWireframe()
.getMainView() as? SendMoneyVerificationViewController

5
GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/Wireframe/SendMoneyParentWireframe.swift

@ -11,6 +11,8 @@ import UIKit
class SendMoneyParentWireframe {
weak var view: UIViewController!
var reciepient: Recipient?
var output: RecipientsPresenter?
var viewModel: RecipientsViewModel?
}
extension SendMoneyParentWireframe: SendMoneyParentWireframeInput {
@ -26,7 +28,8 @@ extension SendMoneyParentWireframe: SendMoneyParentWireframeInput {
let presenter = SendMoneyParentPresenter()
let viewController = viewControllerFromStoryboard(of: SendMoneyParentViewController.self)
viewController.output = self.output
viewController.viewModel = self.viewModel
viewController.presenter = presenter
interactor.output = presenter
presenter.interactor = interactor

Loading…
Cancel
Save