Browse Source

reciepient passwed to child view controller

pull/1/head
gme_2 6 years ago
parent
commit
d31efbb80e
  1. 5
      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

5
GMERemittance/Model/Reciepient.swift

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

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

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

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

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

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

@ -7,5 +7,5 @@
//
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
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
@ -52,6 +52,6 @@ extension SendMoneyPaymentModePresenter: SendMoneyPaymentModeModuleInterface {
extension SendMoneyPaymentModePresenter: SendMoneyPaymentModeInteractorOutput {
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
var presenter: SendMoneyPaymentModeModuleInterface?
var recipient: SendMoneyRecipientViewModel?
var recipient: Recipient?
// MARK: VC's Life cycle
@ -45,7 +45,7 @@ class SendMoneyPaymentModeViewController: UIViewController {
// MARK: 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 {
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 {
weak var view: UIViewController!
var reciepient: Recipient!
}
extension SendMoneyPaymentModeWireframe: SendMoneyPaymentModeWireframeInput {
@ -31,4 +32,9 @@ extension SendMoneyPaymentModeWireframe: SendMoneyPaymentModeWireframeInput {
self.view = 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
var presenter: SendMoneyVerificationModuleInterface?
var reciepient: Recipient?
// MARK: VC's Life cycle

Loading…
Cancel
Save