Browse Source

send money completed

pull/1/head
Dibya Malla 3 years ago
parent
commit
73da08a8ef
  1. 4
      GME Remit.xcodeproj/project.pbxproj
  2. 14
      GME Remit/APIs/Router/APIRouter.swift
  3. 7
      GME Remit/Modules/RecipientModules/Recipients/Application Logic/Model/Recipient/Recipient.swift
  4. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift
  5. 6
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift
  6. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift
  7. 24
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift
  8. 13
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift
  9. 60
      GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/ViewModels/CDDIModel.swift
  10. 10
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift
  11. 19
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift
  12. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift
  13. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Module Interface/TermsAndConditionModuleInterface.swift
  14. 4
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/Presenter/TermsAndConditionPresenter.swift
  15. 24
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewController.swift
  16. 1
      GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift

4
GME Remit.xcodeproj/project.pbxproj

@ -244,6 +244,7 @@
735F68E12394A76800A2DBC8 /* NewRegisterWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */; }; 735F68E12394A76800A2DBC8 /* NewRegisterWireframe.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */; };
735F68E22394A76800A2DBC8 /* NewRegister.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 735F68D92394A76800A2DBC8 /* NewRegister.storyboard */; }; 735F68E22394A76800A2DBC8 /* NewRegister.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 735F68D92394A76800A2DBC8 /* NewRegister.storyboard */; };
735F68E32394A76800A2DBC8 /* NewRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */; }; 735F68E32394A76800A2DBC8 /* NewRegisterViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */; };
7366006D271C62B50091C521 /* CDDIModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7366006C271C62B50091C521 /* CDDIModel.swift */; };
7367FF5E237401860005F644 /* PushNotificationParam.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7367FF5D237401860005F644 /* PushNotificationParam.swift */; }; 7367FF5E237401860005F644 /* PushNotificationParam.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7367FF5D237401860005F644 /* PushNotificationParam.swift */; };
73684456237BD23B00796620 /* InboundTransactionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73684455237BD23B00796620 /* InboundTransactionCell.swift */; }; 73684456237BD23B00796620 /* InboundTransactionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 73684455237BD23B00796620 /* InboundTransactionCell.swift */; };
736A8C402277EB2A00337A50 /* BiometricNotificationModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */; }; 736A8C402277EB2A00337A50 /* BiometricNotificationModuleInterface.swift in Sources */ = {isa = PBXBuildFile; fileRef = 736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */; };
@ -975,6 +976,7 @@
735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterWireframe.swift; sourceTree = "<group>"; }; 735F68D72394A76800A2DBC8 /* NewRegisterWireframe.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterWireframe.swift; sourceTree = "<group>"; };
735F68D92394A76800A2DBC8 /* NewRegister.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NewRegister.storyboard; sourceTree = "<group>"; }; 735F68D92394A76800A2DBC8 /* NewRegister.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NewRegister.storyboard; sourceTree = "<group>"; };
735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterViewController.swift; sourceTree = "<group>"; }; 735F68DA2394A76800A2DBC8 /* NewRegisterViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewRegisterViewController.swift; sourceTree = "<group>"; };
7366006C271C62B50091C521 /* CDDIModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CDDIModel.swift; sourceTree = "<group>"; };
7367FF5D237401860005F644 /* PushNotificationParam.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationParam.swift; sourceTree = "<group>"; }; 7367FF5D237401860005F644 /* PushNotificationParam.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationParam.swift; sourceTree = "<group>"; };
73684455237BD23B00796620 /* InboundTransactionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboundTransactionCell.swift; sourceTree = "<group>"; }; 73684455237BD23B00796620 /* InboundTransactionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InboundTransactionCell.swift; sourceTree = "<group>"; };
736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricNotificationModuleInterface.swift; sourceTree = "<group>"; }; 736A8C2D2277EB2900337A50 /* BiometricNotificationModuleInterface.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BiometricNotificationModuleInterface.swift; sourceTree = "<group>"; };
@ -3645,6 +3647,7 @@
73D3F3D8270C65B5006C3F97 /* ViewModels */ = { 73D3F3D8270C65B5006C3F97 /* ViewModels */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7366006C271C62B50091C521 /* CDDIModel.swift */,
); );
path = ViewModels; path = ViewModels;
sourceTree = "<group>"; sourceTree = "<group>";
@ -7200,6 +7203,7 @@
D9DC108421639E56008F3C51 /* SuccessMessage.swift in Sources */, D9DC108421639E56008F3C51 /* SuccessMessage.swift in Sources */,
89739E4A24459A630016251B /* SendMoneyExchangeRateWireframe.swift in Sources */, 89739E4A24459A630016251B /* SendMoneyExchangeRateWireframe.swift in Sources */,
7EDBFBDA24B2C5DA00AD5D4D /* RedeemCashPickUpServiceType.swift in Sources */, 7EDBFBDA24B2C5DA00AD5D4D /* RedeemCashPickUpServiceType.swift in Sources */,
7366006D271C62B50091C521 /* CDDIModel.swift in Sources */,
7318534E230EACA400BA9AE3 /* SendMoneyTransFerReasonViewModel.swift in Sources */, 7318534E230EACA400BA9AE3 /* SendMoneyTransFerReasonViewModel.swift in Sources */,
73195ABB22FD14D500151434 /* SetupRecipientViewModelInterface.swift in Sources */, 73195ABB22FD14D500151434 /* SetupRecipientViewModelInterface.swift in Sources */,
7389601922C2FADD003FEA90 /* TableCell.swift in Sources */, 7389601922C2FADD003FEA90 /* TableCell.swift in Sources */,

14
GME Remit/APIs/Router/APIRouter.swift

@ -71,6 +71,7 @@ enum APIRouter {
// MARK: - New Registration // MARK: - New Registration
case loadKYCInformation case loadKYCInformation
case cddiInfo
// case saveKYCInformation(model: KYCSave) // case saveKYCInformation(model: KYCSave)
case requestPennyTestAtRegister(resend: String) case requestPennyTestAtRegister(resend: String)
case pennyTestSubmitAtRegister(accountNumber: String, certNumber: String) case pennyTestSubmitAtRegister(accountNumber: String, certNumber: String)
@ -524,6 +525,9 @@ extension APIRouter {
return "\(baseUrlWithoutVersion)v1/mobile/requestOTP" return "\(baseUrlWithoutVersion)v1/mobile/requestOTP"
case .submitRegisterOTP: case .submitRegisterOTP:
return "\(baseUrlWithoutVersion)v1/mobile/submitOTP" return "\(baseUrlWithoutVersion)v1/mobile/submitOTP"
case .cddiInfo:
let userID = GMEDB.shared.user.string(.userId) ?? ""
return "\(baseUrl)/mobile/sendmoney/getcddi/\(userID)"
} }
} }
} }
@ -622,6 +626,8 @@ extension APIRouter {
return .post return .post
case .submitRegisterOTP: case .submitRegisterOTP:
return .post return .post
case .cddiInfo:
return .get
} }
} }
} }
@ -639,14 +645,16 @@ extension APIRouter {
"uuid": self.uuid, "uuid": self.uuid,
"fcmId": firebaseToken, "fcmId": firebaseToken,
"clientId": "192.168.10.1", "clientId": "192.168.10.1",
"accessCode": ""
"accessCode": "",
"IsBiometricLogin": false,
"BiometricLoginType": ""
] ]
case .customerProfile(let firebaseToken): case .customerProfile(let firebaseToken):
return [ return [
"userId" : Utility.getMyUserName(),
"UserId" : Utility.getMyUserName(),
"uuid": self.uuid, "uuid": self.uuid,
"appVersion": Utility.getAppVersion() ?? "",
"AppVersion": Utility.getAppVersion() ?? "",
"phoneBrand": UIDevice.modelName, "phoneBrand": UIDevice.modelName,
"phoneOs": Utility.getPhoneOs(), "phoneOs": Utility.getPhoneOs(),
"fcmId": firebaseToken, "fcmId": firebaseToken,

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

@ -45,6 +45,7 @@ struct Recipient: Mappable {
var districtID: String? var districtID: String?
var purposeOfRemit: String? var purposeOfRemit: String?
var sourceOfFund: String?
var purposeOfRemitID: String? var purposeOfRemitID: String?
var idType: String? var idType: String?
@ -121,6 +122,7 @@ struct Recipient: Mappable {
relationship <- map["relationship"] relationship <- map["relationship"]
district <- map["district"] district <- map["district"]
purposeOfRemit <- map["purposeOfRemit"] purposeOfRemit <- map["purposeOfRemit"]
sourceOfFund <- map["SourceOfFund"]
fullName <- map["fullName"] fullName <- map["fullName"]
idType <- map["idType"] idType <- map["idType"]
idNumber <- map["idNumber"] idNumber <- map["idNumber"]
@ -172,3 +174,8 @@ struct Recipient: Mappable {
] ]
} }
} }
struct CDDIRequestData {
var sourceOfFund: String?
var purposeOfRemittance: String?
}

2
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Interactor/CDDIViewControllerInteractorIO.swift

@ -13,6 +13,6 @@ protocol CDDIViewControllerInteractorInput: class {
protocol CDDIViewControllerInteractorOutput: class { protocol CDDIViewControllerInteractorOutput: class {
func show(error: Error) func show(error: Error)
func success(message: String) func success(message: String)
func setModel(with model: KYCInfoModel)
func setModel(with model: CDDIModel)
func setError(with error: Error) func setError(with error: Error)
} }

6
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerService.swift

@ -10,11 +10,11 @@ import Foundation
class CDDIViewControllerService: CDDIViewControllerServiceType { class CDDIViewControllerService: CDDIViewControllerServiceType {
func fetchKycInfo( func fetchKycInfo(
success: @escaping (KYCInfoModel) -> Void,
success: @escaping (CDDIModel) -> Void,
failure: @escaping (Error) -> Void failure: @escaping (Error) -> Void
) { ) {
APIRouter.loadKYCInformation.json(
needsAuthorization: false,
APIRouter.cddiInfo.json(
needsAuthorization: true,
success: success, success: success,
failure: failure failure: failure
) )

2
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/Application Logic/Service/CDDIViewControllerServiceType.swift

@ -10,7 +10,7 @@ import Foundation
protocol CDDIViewControllerServiceType: class { protocol CDDIViewControllerServiceType: class {
func fetchKycInfo( func fetchKycInfo(
success: @escaping (KYCInfoModel) -> Void,
success: @escaping (CDDIModel) -> Void,
failure: @escaping (Error) -> Void failure: @escaping (Error) -> Void
) )
} }

24
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/Presenter/CDDIViewControllerPresenter.swift

@ -9,6 +9,7 @@
import Foundation import Foundation
import RxSwift import RxSwift
import RxCocoa import RxCocoa
import Protobuf
class CDDIViewControllerPresenter: ViewModelType { class CDDIViewControllerPresenter: ViewModelType {
@ -17,6 +18,7 @@ class CDDIViewControllerPresenter: ViewModelType {
weak var view: CDDIViewControllerViewInterface? weak var view: CDDIViewControllerViewInterface?
var interactor: CDDIViewControllerInteractorInput? var interactor: CDDIViewControllerInteractorInput?
var wireframe: CDDIViewControllerWireframeInput? var wireframe: CDDIViewControllerWireframeInput?
weak var actionDelegate: SendMoneyExchangeRateActionDelegate?
// MARK: Converting entities // MARK: Converting entities
@ -36,20 +38,34 @@ class CDDIViewControllerPresenter: ViewModelType {
let isProgress: Driver<Bool> let isProgress: Driver<Bool>
let purposes: Driver<[KeyValue]?> let purposes: Driver<[KeyValue]?>
let sourceOfFund: Driver<[KeyValue]?> let sourceOfFund: Driver<[KeyValue]?>
let sourceOfFundId: Driver<String>
let purposeId: Driver<String>
} }
private let disposeBag = DisposeBag() private let disposeBag = DisposeBag()
private let errorLinker = PublishSubject<Error>() private let errorLinker = PublishSubject<Error>()
private let progressLinker = PublishSubject<Bool>() private let progressLinker = PublishSubject<Bool>()
private let model = PublishSubject<KYCInfoModel>()
private let model = PublishSubject<CDDIModel>()
private let sourceofFundId = PublishSubject<String>()
private let purposeOfRemitId = PublishSubject<String>()
func transform(input: Input) -> Output { func transform(input: Input) -> Output {
input.sourceOfFund.map {$0?.id ?? ""}.drive(onNext: {
self.sourceofFundId.onNext($0)
}).disposed(by: disposeBag)
input.purpose.map {$0?.id ?? ""}.drive(onNext: {
self.purposeOfRemitId.onNext($0)
}).disposed(by: disposeBag)
return Output( return Output(
isError: errorLinker.asDriverOnErrorJustComplete(), isError: errorLinker.asDriverOnErrorJustComplete(),
isProgress: progressLinker.asDriverOnErrorJustComplete(), isProgress: progressLinker.asDriverOnErrorJustComplete(),
purposes: model.map {$0.purpose}.asDriverOnErrorJustComplete(),
sourceOfFund: model.map {$0.sourceOfFund}.asDriverOnErrorJustComplete()
purposes: model.map {$0.purposeOfRemit}.asDriverOnErrorJustComplete(),
sourceOfFund: model.map {$0.sourceOfFund}.asDriverOnErrorJustComplete(),
sourceOfFundId: sourceofFundId.asDriverOnErrorJustComplete(),
purposeId: purposeOfRemitId.asDriverOnErrorJustComplete()
) )
} }
@ -64,7 +80,7 @@ extension CDDIViewControllerPresenter: CDDIViewControllerModuleInterface {
// MARK: CDDIViewController interactor output interface // MARK: CDDIViewController interactor output interface
extension CDDIViewControllerPresenter: CDDIViewControllerInteractorOutput { extension CDDIViewControllerPresenter: CDDIViewControllerInteractorOutput {
func setModel(with model: KYCInfoModel) {
func setModel(with model: CDDIModel) {
progressLinker.onNext(false) progressLinker.onNext(false)
self.model.onNext(model) self.model.onNext(model)
} }

13
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/CDDIViewControllerViewController.swift

@ -21,6 +21,8 @@ class CDDIViewControllerViewController: UIViewController {
weak var actionDelegate: SendMoneyExchangeRateActionDelegate? weak var actionDelegate: SendMoneyExchangeRateActionDelegate?
var exchangeRateModel: SendMoneyExchangeRateModel? var exchangeRateModel: SendMoneyExchangeRateModel?
private let disposeBag = DisposeBag() private let disposeBag = DisposeBag()
var fund: String?
var purpose: String?
// MARK: IBOutlets // MARK: IBOutlets
@IBOutlet weak var purposeOfRemit: ValidationTextField! @IBOutlet weak var purposeOfRemit: ValidationTextField!
@ -42,7 +44,8 @@ class CDDIViewControllerViewController: UIViewController {
// MARK: IBActions // MARK: IBActions
@IBAction func continueButton(_ sender: UIButton) { @IBAction func continueButton(_ sender: UIButton) {
view.endEditing(true) view.endEditing(true)
actionDelegate?.continueToVerificationAction()
let model = CDDIRequestData(sourceOfFund: fund, purposeOfRemittance: purpose)
actionDelegate?.continueToVerificationAction(model: model)
} }
// MARK: Other Functions // MARK: Other Functions
@ -110,6 +113,14 @@ class CDDIViewControllerViewController: UIViewController {
let configure = TablePresenterConfiguration(presenterTitle: "select_source_of_fund_text".localized()) let configure = TablePresenterConfiguration(presenterTitle: "select_source_of_fund_text".localized())
self?.sourceOfFund.useAsDropDown(with: configure, items: $0) self?.sourceOfFund.useAsDropDown(with: configure, items: $0)
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
output.sourceOfFundId.drive(onNext: { [weak self] in
self?.fund = $0
}).disposed(by: disposeBag)
output.purposeId.drive(onNext: { [weak self] in
self?.purpose = $0
}).disposed(by: disposeBag)
} }
} }

60
GME Remit/Modules/RemittanceModules/OverseasModules/CDDIViewController/User Interface/View/ViewModels/CDDIModel.swift

@ -0,0 +1,60 @@
//
// CDDIModel.swift
// GME Remit
//
// Created by Swift Tech on 17/10/2021.
// Copyright © 2021 Gobal Money Express Co. Ltd. All rights reserved.
//
import Foundation
import ObjectMapper
class CDDIModel: Mappable {
var userId: String?
var sourceOfFund: [KeyValue]?
var purposeOfRemit: [KeyValue]?
required init?(map: Map) {
}
func mapping(map: Map) {
userId <- map["UserId"]
sourceOfFund <- map["SourceOfFund"]
purposeOfRemit <- map["PurposeOfRemittance"]
}
}
class SourceOfFundModel: Mappable {
var id: String?
var text: String?
required init?(map: Map) {
}
func mapping(map: Map) {
id <- map["id"]
text <- map["text"]
}
}
class PurposeOfRemitModel: Mappable {
var id: String?
var text: String?
required init?(map: Map) {
}
func mapping(map: Map) {
id <- map["id"]
text <- map["text"]
}
}

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

@ -17,7 +17,7 @@ protocol HUDStatusDelegate: class {
// Actions from SendMoneyExchangeRateViewController are delegated to Parent View // Actions from SendMoneyExchangeRateViewController are delegated to Parent View
protocol SendMoneyExchangeRateActionDelegate: class { protocol SendMoneyExchangeRateActionDelegate: class {
func continueToVerificationAction()
func continueToVerificationAction(model: CDDIRequestData)
func calculated(model: SendMoneyExchangeRateModel?) func calculated(model: SendMoneyExchangeRateModel?)
func continueToCDDI() func continueToCDDI()
func continueToTermsAndConditions() func continueToTermsAndConditions()
@ -80,7 +80,7 @@ class SendMoneyParentViewController: UIViewController {
var termsViewController: TermsAndConditionViewController? var termsViewController: TermsAndConditionViewController?
lazy private var requestModel = SendMoneyRequestModel() lazy private var requestModel = SendMoneyRequestModel()
lazy private var cddiModel = CDDIRequestData()
var presenter: SendMoneyParentModuleInterface? var presenter: SendMoneyParentModuleInterface?
// Buttons representing the pages marked as 1, 2, 3 in UI. // Buttons representing the pages marked as 1, 2, 3 in UI.
@ -402,7 +402,7 @@ class SendMoneyParentViewController: UIViewController {
guard let termsView = termsViewController else {return} guard let termsView = termsViewController else {return}
termsView.reciepient = self.receipient termsView.reciepient = self.receipient
termsView.requestModel = self.requestModel termsView.requestModel = self.requestModel
termsView.cddiModel = self.cddiModel
self.addChild(termsView) self.addChild(termsView)
UIView.transition( UIView.transition(
@ -449,7 +449,9 @@ extension SendMoneyParentViewController: SendMoneyExchangeRateActionDelegate {
self.state = StateButtons.terms self.state = StateButtons.terms
} }
func continueToVerificationAction() {
func continueToVerificationAction(model: CDDIRequestData) {
self.cddiModel = model
print("model:\(model)")
self.addVerificationViewController() self.addVerificationViewController()
self.state = StateButtons.verification self.state = StateButtons.verification
} }

19
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractor.swift

@ -27,8 +27,9 @@ class TermsAndConditionInteractor {
// MARK: TermsAndCondition interactor input interface // MARK: TermsAndCondition interactor input interface
extension TermsAndConditionInteractor: TermsAndConditionInteractorInput { extension TermsAndConditionInteractor: TermsAndConditionInteractorInput {
func submit(model: SendMoneyRequestModel, reciepient: Recipient) {
let params = self.getParams(model: model, reciepient: reciepient)
func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) {
let params = self.getParams(model: model, reciepient: reciepient, cddiModel: cddiModel)
self.service.submit( self.service.submit(
params: params, params: params,
success: { (response) in success: { (response) in
@ -74,7 +75,7 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput {
} }
} }
func getParams(model: SendMoneyRequestModel, reciepient: Recipient) -> [String: Any] {
func getParams(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) -> [String: Any] {
guard let username = GMEDB.shared.user.string(.userId) else {return [:]} guard let username = GMEDB.shared.user.string(.userId) else {return [:]}
let senderId = GMEDB.shared.user.string(.senderId) let senderId = GMEDB.shared.user.string(.senderId)
let recieverId = reciepient.receiverID let recieverId = reciepient.receiverID
@ -98,8 +99,8 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput {
"ExRate": model.exchangeRateDetail?.apiExchangeRate ?? "", "ExRate": model.exchangeRateDetail?.apiExchangeRate ?? "",
"CalBy": model.exchangeRateDetail?.calcBy ?? "", "CalBy": model.exchangeRateDetail?.calcBy ?? "",
"FOREX_SESSION_ID": model.exchangeRateDetail?.forexId ?? "", "FOREX_SESSION_ID": model.exchangeRateDetail?.forexId ?? "",
"PurposeOfRemittance": reciepient.purposeOfRemitID ?? "others",
"SourceOfFund": "3902",
"PurposeOfRemittance": cddiModel.purposeOfRemittance ?? "others",
"SourceOfFund": cddiModel.sourceOfFund ?? "",
"RelWithSender": reciepient.relationshipID ?? "", "RelWithSender": reciepient.relationshipID ?? "",
"Occupation": "", "Occupation": "",
"IpAddress": "", "IpAddress": "",
@ -118,4 +119,12 @@ extension TermsAndConditionInteractor: TermsAndConditionInteractorInput {
return params return params
} }
func getAvailableBalanceNotificationName() -> Notification.Name {
return Notification.Name.init(rawValue: SideMenuNavigationNotifications.availableBalance)
}
@objc private func getYearlyLimitNotificationName() -> Notification.Name {
return Notification.Name.init(AppConstants.yearlyLimitNotification)
}
} }

2
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/Application Logic/Interactor/TermsAndConditionInteractorIO.swift

@ -8,7 +8,7 @@
protocol TermsAndConditionInteractorInput: class { protocol TermsAndConditionInteractorInput: class {
func makeApiRequest() func makeApiRequest()
func submit(model: SendMoneyRequestModel, reciepient: Recipient)
func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData)
} }
protocol TermsAndConditionInteractorOutput: class { protocol TermsAndConditionInteractorOutput: class {

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

@ -8,6 +8,6 @@
protocol TermsAndConditionModuleInterface: class { protocol TermsAndConditionModuleInterface: class {
func makeApiRequest() func makeApiRequest()
func submit(model: SendMoneyRequestModel, reciepient: Recipient)
func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData)
func openReciept(transactionId: String) func openReciept(transactionId: String)
} }

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

@ -27,9 +27,9 @@ extension TermsAndConditionPresenter: TermsAndConditionModuleInterface {
self.interactor?.makeApiRequest() self.interactor?.makeApiRequest()
} }
func submit(model: SendMoneyRequestModel, reciepient: Recipient) {
func submit(model: SendMoneyRequestModel, reciepient: Recipient, cddiModel: CDDIRequestData) {
self.view?.showLoading() self.view?.showLoading()
self.interactor?.submit(model: model, reciepient: reciepient)
self.interactor?.submit(model: model, reciepient: reciepient, cddiModel: cddiModel)
} }
func openReciept(transactionId: String) { func openReciept(transactionId: String) {

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

@ -16,6 +16,7 @@ class TermsAndConditionViewController: UIViewController {
var presenter: TermsAndConditionModuleInterface? var presenter: TermsAndConditionModuleInterface?
var reciepient: Recipient? var reciepient: Recipient?
var requestModel: SendMoneyRequestModel? var requestModel: SendMoneyRequestModel?
var cddiModel: CDDIRequestData?
weak var hudDelegate: HUDStatusDelegate? weak var hudDelegate: HUDStatusDelegate?
private var isSelected = false private var isSelected = false
lazy var pinViewOption: Options = { lazy var pinViewOption: Options = {
@ -29,6 +30,7 @@ class TermsAndConditionViewController: UIViewController {
var password: String? { var password: String? {
didSet { didSet {
guard guard
let cddiInfoModel = cddiModel,
let model = self.requestModel, let model = self.requestModel,
let reciepient = self.reciepient, let reciepient = self.reciepient,
let password = self.password, let password = self.password,
@ -38,7 +40,7 @@ class TermsAndConditionViewController: UIViewController {
} }
model.transactionPassword = password model.transactionPassword = password
print(password) print(password)
self.presenter?.submit(model: model, reciepient: reciepient)
self.presenter?.submit(model: model, reciepient: reciepient, cddiModel: cddiInfoModel)
} }
} }
@ -128,4 +130,24 @@ extension TermsAndConditionViewController: TermsAndConditionViewInterface {
) { ) {
} }
} }
func show(model: SendMoneySubmitModelContainer?) {
guard let message = model?.message, let expectedPoint = model?.extra2 else {
return
}
// let successMessage = "\(message)\n(\("estimated_earning_points_text".localized()): \(expectedPoint.likeCommaMoney() ?? "0"))"
self.alertWithOk(
type: .success,
message: "Transfer Successful",
title: "Success",
okTitle: "OK"
) {
if let id = model?.id {
self.presenter?.openReciept(transactionId: id)
} else {
self.alert(type: .error, message: "No Transaction received.")
}
}
}
} }

1
GME Remit/Modules/RemittanceModules/OverseasModules/TermsAndCondition/User Interface/View/TermsAndConditionViewInterface.swift

@ -11,4 +11,5 @@ protocol TermsAndConditionViewInterface: class {
func hideLoading() func hideLoading()
func show(error: String) func show(error: String)
func show(message: String) func show(message: String)
func show(model: SendMoneySubmitModelContainer?)
} }
Loading…
Cancel
Save