Browse Source

seeAll api call

v0.17
Dibya 1 year ago
parent
commit
8a326f6bf3
  1. BIN
      .DS_Store
  2. 14
      GME Remit/APIs/Router/APIRouter.swift
  3. 6
      GME Remit/Modules/AllRecipients/Application Logic/Interactor/AllRecipientsInteractor.swift
  4. 1
      GME Remit/Modules/AllRecipients/Application Logic/Interactor/AllRecipientsInteractorIO.swift
  5. 4
      GME Remit/Modules/AllRecipients/Application Logic/Service/AllRecipientsService.swift
  6. 4
      GME Remit/Modules/AllRecipients/Application Logic/Service/AllRecipientsServiceType.swift
  7. 5
      GME Remit/Modules/AllRecipients/User Interface/Presenter/AllRecipientsPresenter.swift
  8. 15
      GME Remit/Modules/AllRecipients/User Interface/View/AllRecipients.storyboard
  9. 15
      GME Remit/Modules/AllRecipients/User Interface/View/AllRecipientsViewController.swift
  10. 1
      GME Remit/Modules/AllRecipients/User Interface/View/AllRecipientsViewInterface.swift
  11. 6
      GME Remit/Modules/AllRecipients/User Interface/Wireframe/AllRecipientsWireframe.swift
  12. 2
      GME Remit/Modules/RecipientModules/Recipients/Application Logic/Service/RecipientsService.swift
  13. 4
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift
  14. 2
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/Application Logic/Service/SendMoneyExchangeRateServiceType.swift
  15. 4
      GME Remit/Modules/RemittanceModules/OverseasModules/SendMoneyExchangeRate/User Interface/View/SendMoneyExchangeRateViewController.swift

BIN
.DS_Store

14
GME Remit/APIs/Router/APIRouter.swift

@ -63,7 +63,7 @@ enum APIRouter {
case validateReferralCode(code: String)
// MARK: - Receiver
case fetchRecipients(senderID: String)
case fetchRecipients(senderID: String, fromDate: String, toDate: String, countryCode: String, pageCount: String)
case dynamicReceiver(username: String, countryID: String, serviceTypeID: String)
case fetchCountriesAndServiceTypes(username: String)
case addRecipient(senderID: String, recipient: Recipient)
@ -572,8 +572,8 @@ extension APIRouter {
case .dynamicReceiver(let username, let countryID, let serviceType):
let path = "\(username)/dynamicField?countryId=\(countryID)&serviceType=\(serviceType)"
return "\(baseUrlWithoutVersion)v3/mobile/receiver/\(path)"
case .fetchRecipients(let senderID):
return "\(baseUrlWithoutVersion)v5/mobile/\(senderID)/receiverinfo/151"
case .fetchRecipients(let senderID,_,_, let countryCode,_):
return "\(baseUrlWithoutVersion)v5/mobile/\(senderID)/receiverinfo/\(countryCode)"
case .fetchCountriesAndServiceTypes(let username):
return "\(baseUrlWithoutVersion)v3/mobile/\(username)/FetchCountriesAndServiceTypes"
case .addRecipient(let senderID, _):
@ -827,11 +827,11 @@ extension APIRouter {
case .post:
switch self {
case .fetchRecipients:
case .fetchRecipients(_, let fromDate, let toDate,_, let pageCount):
return [
"fromDate": "",
"toDate": "",
"Page": ""
"fromDate": fromDate,
"toDate": toDate,
"Page": pageCount
]
case .uploadProfile:

6
GME Remit/Modules/AllRecipients/Application Logic/Interactor/AllRecipientsInteractor.swift

@ -14,6 +14,7 @@ class AllRecipientsInteractor {
weak var output: AllRecipientsInteractorOutput?
private let service: AllRecipientsServiceType
private var recipients: FetchBeneficiariesModel?
// MARK: Initialization
@ -28,8 +29,9 @@ class AllRecipientsInteractor {
extension AllRecipientsInteractor: AllRecipientsInteractorInput {
func makeApiRequest() {
self.service.makeApiRequest(success: { (message) in
self.output?.success(message: message ?? "")
self.service.makeApiRequest(success: {
self.recipients = $0.recipients
self.output?.setRecipients(using: $0.recipients)
}) { (error) in
self.output?.show(error: error)
}

1
GME Remit/Modules/AllRecipients/Application Logic/Interactor/AllRecipientsInteractorIO.swift

@ -13,4 +13,5 @@ protocol AllRecipientsInteractorInput: class {
protocol AllRecipientsInteractorOutput: class {
func show(error: Error)
func success(message: String)
func setRecipients(using model: FetchBeneficiariesModel?)
}

4
GME Remit/Modules/AllRecipients/Application Logic/Service/AllRecipientsService.swift

@ -10,8 +10,10 @@ import Foundation
class AllRecipientsService: AllRecipientsServiceType {
func makeApiRequest(
success: @escaping (String?) -> Void,
success: @escaping (FetchRecipientsModel) -> Void,
failure: @escaping (Error) -> Void
){
let senderId = GMEDB.shared.user.string(.senderId) ?? ""
APIRouter.fetchRecipients(senderID: senderId, fromDate: "", toDate: "", countryCode: "", pageCount: "").json(success: success, failure: failure)
}
}

4
GME Remit/Modules/AllRecipients/Application Logic/Service/AllRecipientsServiceType.swift

@ -10,7 +10,7 @@ import Foundation
protocol AllRecipientsServiceType: class, ApiServiceType {
func makeApiRequest(
success: @escaping (String?) -> Void,
failure: @escaping (Error) -> Void
success: @escaping (FetchRecipientsModel) -> Void,
failure: @escaping (Error) -> Void
)
}

5
GME Remit/Modules/AllRecipients/User Interface/Presenter/AllRecipientsPresenter.swift

@ -31,6 +31,11 @@ extension AllRecipientsPresenter: AllRecipientsModuleInterface {
// MARK: AllRecipients interactor output interface
extension AllRecipientsPresenter: AllRecipientsInteractorOutput {
func setRecipients(using model: FetchBeneficiariesModel?) {
self.view?.hideLoading()
self.view?.setRecipients(using: model)
}
func show(error: Error) {
self.view?.hideLoading()
self.view?.show(error: error.localizedDescription)

15
GME Remit/Modules/AllRecipients/User Interface/View/AllRecipients.storyboard

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="HSb-ou-7T5">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
@ -74,16 +74,25 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="mxF-LV-o9l" secondAttribute="trailing" id="CLG-kb-bZ8"/>
<constraint firstItem="mxF-LV-o9l" firstAttribute="top" secondItem="y1H-iV-BwG" secondAttribute="bottom" id="Ki6-nU-psR"/>
<constraint firstItem="PYB-Kq-ghm" firstAttribute="top" secondItem="mxF-LV-o9l" secondAttribute="bottom" id="Llp-56-obb"/>
<constraint firstItem="mxF-LV-o9l" firstAttribute="top" secondItem="9Uc-9s-KgO" secondAttribute="top" id="ck5-LO-Lpr"/>
<constraint firstItem="mxF-LV-o9l" firstAttribute="leading" secondItem="9Uc-9s-KgO" secondAttribute="leading" id="eCW-cx-8TC"/>
</constraints>
</view>
<connections>
<outlet property="searchDisplayController" destination="iPa-j6-YMR" id="ahD-I5-nsa"/>
<outlet property="tableView" destination="mxF-LV-o9l" id="ALO-JY-dFG"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="8je-5K-XuW" userLabel="First Responder" sceneMemberID="firstResponder"/>
<searchDisplayController id="iPa-j6-YMR">
<connections>
<outlet property="delegate" destination="HSb-ou-7T5" id="HIE-Bx-Qb6"/>
<outlet property="searchContentsController" destination="HSb-ou-7T5" id="2Vb-G2-YuE"/>
<outlet property="searchResultsDataSource" destination="HSb-ou-7T5" id="u1i-Yf-zka"/>
<outlet property="searchResultsDelegate" destination="HSb-ou-7T5" id="Cak-Ia-QzC"/>
</connections>
</searchDisplayController>
</objects>
<point key="canvasLocation" x="-92" y="232.53373313343329"/>
</scene>

15
GME Remit/Modules/AllRecipients/User Interface/View/AllRecipientsViewController.swift

@ -11,13 +11,8 @@ import UIKit
class AllRecipientsViewController: UIViewController {
// MARK: Properties
var presenter: AllRecipientsModuleInterface?
var beneficaiaryModel: [Recipient]? {
didSet {
// self.tableView.reloadData()
}
}
var beneficaiaryModel: [Recipient]?
// MARK: IBOutlets
@ -37,6 +32,7 @@ class AllRecipientsViewController: UIViewController {
private func setup() {
self.tableView.delegate = self
self.tableView.dataSource = self
self.presenter?.makeApiRequest()
}
}
@ -56,6 +52,11 @@ extension AllRecipientsViewController: UITableViewDelegate, UITableViewDataSourc
// MARK: AllRecipientsViewInterface
extension AllRecipientsViewController: AllRecipientsViewInterface {
func setRecipients(using model: FetchBeneficiariesModel?) {
self.beneficaiaryModel = model?.beneficiaries
self.tableView.reloadData()
}
func showLoading() {
self.showProgressHud()
}
@ -77,4 +78,6 @@ extension AllRecipientsViewController: AllRecipientsViewInterface {
) {
}
}
}

1
GME Remit/Modules/AllRecipients/User Interface/View/AllRecipientsViewInterface.swift

@ -11,4 +11,5 @@ protocol AllRecipientsViewInterface: class {
func hideLoading()
func show(error: String)
func show(message: String)
func setRecipients(using model: FetchBeneficiariesModel?)
}

6
GME Remit/Modules/AllRecipients/User Interface/Wireframe/AllRecipientsWireframe.swift

@ -41,4 +41,10 @@ extension AllRecipientsWireframe: AllRecipientsWireframeInput {
self.beneficiaryModel = model
self.pushMainView(in: source)
}
func openAllRecipients(
source: UINavigationController
) {
self.pushMainView(in: source)
}
}

2
GME Remit/Modules/RecipientModules/Recipients/Application Logic/Service/RecipientsService.swift

@ -16,7 +16,7 @@ class RecipientsService: RecipientsServiceType {
) {
let senderID = GMEDB.shared.user.string(.senderId) ?? ""
APIRouter
.fetchRecipients(senderID: senderID)
.fetchRecipients(senderID: senderID, fromDate: "", toDate: "", countryCode: "", pageCount: "")
.json(success: success, failure: failure)
}

4
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/RecipientsViewController.swift

@ -47,8 +47,8 @@ class RecipientsViewController: UIViewController {
// @IBOutlet private var addRecipientTapGestureRecognizer: UITapGestureRecognizer!
@IBAction func seeAllButton(_ sender: UIButton) {
if let model = self.model, let navigation = self.navigationController {
AllRecipientsWireframe().opemRecipients(model: model, source: navigation)
if let navigation = self.navigationController {
AllRecipientsWireframe().openAllRecipients(source: navigation)
}
}

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

@ -28,7 +28,7 @@ extension FetchSendMoneyExchangeRateService {
params: [String: String],
success: @escaping (SendMoneyExchangeRateModel?) -> Void,
failure: @escaping (Error) -> Void) {
let url = baseUrl + "/mobile/calculateDefExRate"
let url = baseUrl + "/mobile/sendmoney/calculate"
auth.request(
method: .post,
url: url,

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

@ -434,10 +434,10 @@ class SendMoneyExchangeRateViewController: UIViewController {
let reciepientCountryName = reciepient?.country
let reciepientCountryId = reciepient?.countryID
let paymentMode = "wallet"
let paymentMethodId = paymentModel?.receiverId
let paymentMethodId = paymentModel?.id
let payoutPartner = requestModel?.paymemtMode?.payoutPartner
let myUsername = Utility.getMyUserName()
let bankId = paymentModel?.receiverId
let bankId = requestModel?.bank?.id
let discountedFee = rewardTextField.text
// let discountedFee
//bank id if selected bank

Loading…
Cancel
Save