Browse Source

reciepient passwed to child view controller

pull/1/head
gme_2 6 years ago
parent
commit
d31efbb80e
  1. 7
      GMERemittance/Model/Reciepient.swift
  2. 1
      GMERemittance/Module/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift
  3. 36
      GMERemittance/Module/SendMoneyParent/User Interface/Presenter/SendMoneyParentPresenter.swift
  4. 20
      GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift
  5. 2
      GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewInterface.swift
  6. 40
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/Presenter/SendMoneyPaymentModePresenter.swift
  7. 6
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift
  8. 2
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewInterface.swift
  9. 6
      GMERemittance/Module/SendMoneyPaymentMode/User Interface/Wireframe/SendMoneyPaymentModeWireframe.swift
  10. 2
      GMERemittance/Module/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

7
GMERemittance/Model/Reciepient.swift

@ -50,6 +50,8 @@ struct Recipient: Codable, Mappable {
var middleName: String? var middleName: String?
var lastName: String? var lastName: String?
var country: String? var country: String?
var countryId: String?
var countryCode: String?
var state: String? var state: String?
var stateId: String? var stateId: String?
var city: String? var city: String?
@ -63,9 +65,7 @@ struct Recipient: Codable, Mappable {
var recipientId: String? var recipientId: String?
var reason: String? var reason: String?
var reasonId: String? var reasonId: String?
var countryId: String?
mutating func mapping(map: Map) { mutating func mapping(map: Map) {
firstName <- map["firstName"] firstName <- map["firstName"]
middleName <- map["middleName"] middleName <- map["middleName"]
@ -85,6 +85,7 @@ struct Recipient: Codable, Mappable {
reason <- map["reason"] reason <- map["reason"]
reasonId <- map["reasonId"] reasonId <- map["reasonId"]
countryId <- map["countryId"] countryId <- map["countryId"]
countryCode <- map["countryCode"]
} }

1
GMERemittance/Module/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift

@ -16,6 +16,7 @@ class SendMoneyExchangeRateViewController: UIViewController {
// MARK: Properties // MARK: Properties
var presenter: SendMoneyExchangeRateModuleInterface? var presenter: SendMoneyExchangeRateModuleInterface?
var reciepient: Recipient?
// MARK: VC's Life cycle // MARK: VC's Life cycle

36
GMERemittance/Module/SendMoneyParent/User Interface/Presenter/SendMoneyParentPresenter.swift

@ -19,23 +19,23 @@ class SendMoneyParentPresenter {
// MARK: Converting entities // MARK: Converting entities
func convert(model: Recipient) { func convert(model: Recipient) {
let reciepient = SendMoneyRecipientViewModel()
reciepient.id = model.recipientId
reciepient.firstName = model.firstName
reciepient.middleName = model.middleName
reciepient.lastName = model.lastName
reciepient.country = model.country
reciepient.countryId = model.countryId
reciepient.state = model.state
reciepient.stateId = model.stateId
reciepient.address = model.address
reciepient.relation = model.relation
reciepient.relationId = model.relationId
reciepient.reason = model.reason
reciepient.reasonId = model.reasonId
reciepient.mobileNumber = model.mobileNumber
reciepient.email = model.email
self.view?.show(model: reciepient)
// let reciepient = SendMoneyRecipientViewModel()
// reciepient.id = model.recipientId
// reciepient.firstName = model.firstName
// reciepient.middleName = model.middleName
// reciepient.lastName = model.lastName
// reciepient.country = model.country
// reciepient.countryId = model.countryId
// reciepient.state = model.state
// reciepient.stateId = model.stateId
// reciepient.address = model.address
// reciepient.relation = model.relation
// reciepient.relationId = model.relationId
// reciepient.reason = model.reason
// reciepient.reasonId = model.reasonId
// reciepient.mobileNumber = model.mobileNumber
// reciepient.email = model.email
// self.view?.show(model: reciepient)
} }
} }
@ -51,7 +51,7 @@ extension SendMoneyParentPresenter: SendMoneyParentModuleInterface {
extension SendMoneyParentPresenter: SendMoneyParentInteractorOutput { extension SendMoneyParentPresenter: SendMoneyParentInteractorOutput {
func show(model: Recipient) { func show(model: Recipient) {
self.convert(model: model)
self.view?.show(model: model)
} }

20
GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewController.swift

@ -1,4 +1,4 @@
//
i//
// SendMoneyParentViewController.swift // SendMoneyParentViewController.swift
// GMERemittance // GMERemittance
// //
@ -24,7 +24,7 @@ class SendMoneyParentViewController: UIViewController {
var presenter: SendMoneyParentModuleInterface? var presenter: SendMoneyParentModuleInterface?
var receipient: SendMoneyRecipientViewModel? {
var receipient: Recipient? {
didSet { didSet {
print( self.receipient?.firstName) print( self.receipient?.firstName)
} }
@ -76,13 +76,21 @@ class SendMoneyParentViewController: UIViewController {
private func setupViewControllers() { private func setupViewControllers() {
let paymentModelWireframe = SendMoneyPaymentModeWireframe() let paymentModelWireframe = SendMoneyPaymentModeWireframe()
self.paymentModeViewController = paymentModelWireframe.getMainView()
let pvc = paymentModelWireframe.getMainView() as! SendMoneyPaymentModeViewController
pvc.recipient = self.receipient
self.paymentModeViewController = pvc
let exchangeViewWireframe = SendMoneyExchangeRateWireframe() let exchangeViewWireframe = SendMoneyExchangeRateWireframe()
self.exchangeViewController = exchangeViewWireframe.getMainView()
let evc = exchangeViewWireframe.getMainView() as! SendMoneyExchangeRateViewController
evc.reciepient = self.receipient
self.exchangeViewController = evc
let verificationWireframe = SendMoneyVerificationWireframe() let verificationWireframe = SendMoneyVerificationWireframe()
self.verificationViewController = verificationWireframe.getMainView()
let vvc = verificationWireframe.getMainView() as! SendMoneyVerificationViewController
vvc.reciepient = self.receipient
self.verificationViewController = vvc
} }
private func configureViews() { private func configureViews() {
@ -129,7 +137,7 @@ class SendMoneyParentViewController: UIViewController {
// MARK: SendMoneyParentViewInterface // MARK: SendMoneyParentViewInterface
extension SendMoneyParentViewController: SendMoneyParentViewInterface { extension SendMoneyParentViewController: SendMoneyParentViewInterface {
func show(model: SendMoneyRecipientViewModel) {
func show(model: Recipient) {
self.receipient = model self.receipient = model
} }
} }

2
GMERemittance/Module/SendMoneyParent/User Interface/View/SendMoneyParentViewInterface.swift

@ -7,5 +7,5 @@
// //
protocol SendMoneyParentViewInterface: class { protocol SendMoneyParentViewInterface: class {
func show(model: SendMoneyRecipientViewModel)
func show(model: Recipient)
} }

40
GMERemittance/Module/SendMoneyPaymentMode/User Interface/Presenter/SendMoneyPaymentModePresenter.swift

@ -19,25 +19,25 @@ class SendMoneyPaymentModePresenter {
// MARK: Converting entities // MARK: Converting entities
func convert(model: Recipient) {
let reciepient = SendMoneyRecipientViewModel()
reciepient.id = model.recipientId
reciepient.firstName = model.firstName
reciepient.middleName = model.middleName
reciepient.lastName = model.lastName
reciepient.country = model.country
reciepient.countryId = model.countryId
reciepient.state = model.state
reciepient.stateId = model.stateId
reciepient.address = model.address
reciepient.relation = model.relation
reciepient.relationId = model.relationId
reciepient.reason = model.reason
reciepient.reasonId = model.reasonId
reciepient.mobileNumber = model.mobileNumber
reciepient.email = model.email
self.view?.show(model: reciepient)
}
// func convert(model: Recipient) {
// let reciepient = SendMoneyRecipientViewModel()
// reciepient.id = model.recipientId
// reciepient.firstName = model.firstName
// reciepient.middleName = model.middleName
// reciepient.lastName = model.lastName
// reciepient.country = model.country
// reciepient.countryId = model.countryId
// reciepient.state = model.state
// reciepient.stateId = model.stateId
// reciepient.address = model.address
// reciepient.relation = model.relation
// reciepient.relationId = model.relationId
// reciepient.reason = model.reason
// reciepient.reasonId = model.reasonId
// reciepient.mobileNumber = model.mobileNumber
// reciepient.email = model.email
// self.view?.show(model: reciepient)
// }
} }
// MARK: SendMoneyPaymentMode module interface // MARK: SendMoneyPaymentMode module interface
@ -52,6 +52,6 @@ extension SendMoneyPaymentModePresenter: SendMoneyPaymentModeModuleInterface {
extension SendMoneyPaymentModePresenter: SendMoneyPaymentModeInteractorOutput { extension SendMoneyPaymentModePresenter: SendMoneyPaymentModeInteractorOutput {
func show(model: Recipient) { func show(model: Recipient) {
self.convert(model: model)
self.view?.show(model: model)
} }
} }

6
GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewController.swift

@ -18,7 +18,7 @@ class SendMoneyPaymentModeViewController: UIViewController {
// MARK: Properties // MARK: Properties
var presenter: SendMoneyPaymentModeModuleInterface? var presenter: SendMoneyPaymentModeModuleInterface?
var recipient: SendMoneyRecipientViewModel?
var recipient: Recipient?
// MARK: VC's Life cycle // MARK: VC's Life cycle
@ -45,7 +45,7 @@ class SendMoneyPaymentModeViewController: UIViewController {
// MARK: SendMoneyPaymentModeViewInterface // MARK: SendMoneyPaymentModeViewInterface
extension SendMoneyPaymentModeViewController: SendMoneyPaymentModeViewInterface { extension SendMoneyPaymentModeViewController: SendMoneyPaymentModeViewInterface {
func show(model: SendMoneyRecipientViewModel) {
self.recipient = model
func show(model: Recipient) {
// self.recipient = model
} }
} }

2
GMERemittance/Module/SendMoneyPaymentMode/User Interface/View/SendMoneyPaymentModeViewInterface.swift

@ -7,5 +7,5 @@
// //
protocol SendMoneyPaymentModeViewInterface: class { protocol SendMoneyPaymentModeViewInterface: class {
func show(model: SendMoneyRecipientViewModel)
func show(model: Recipient)
} }

6
GMERemittance/Module/SendMoneyPaymentMode/User Interface/Wireframe/SendMoneyPaymentModeWireframe.swift

@ -10,6 +10,7 @@ import UIKit
class SendMoneyPaymentModeWireframe { class SendMoneyPaymentModeWireframe {
weak var view: UIViewController! weak var view: UIViewController!
var reciepient: Recipient!
} }
extension SendMoneyPaymentModeWireframe: SendMoneyPaymentModeWireframeInput { extension SendMoneyPaymentModeWireframe: SendMoneyPaymentModeWireframeInput {
@ -31,4 +32,9 @@ extension SendMoneyPaymentModeWireframe: SendMoneyPaymentModeWireframeInput {
self.view = viewController self.view = viewController
return viewController return viewController
} }
func open(for reciepient: Recipient, source: UINavigationController) {
self.reciepient = reciepient
self.pushMainView(in: source)
}
} }

2
GMERemittance/Module/SendMoneyVerification/User Interface/View/SendMoneyVerificationViewController.swift

@ -16,7 +16,7 @@ class SendMoneyVerificationViewController: UIViewController {
// MARK: Properties // MARK: Properties
var presenter: SendMoneyVerificationModuleInterface? var presenter: SendMoneyVerificationModuleInterface?
var reciepient: Recipient?
// MARK: VC's Life cycle // MARK: VC's Life cycle

Loading…
Cancel
Save