Browse Source

my transfers setup

v0.17
Dibya 1 year ago
parent
commit
0897bd6d6f
  1. BIN
      .DS_Store
  2. 6
      GME Remit/Modules/RecipientModules/Recipients/Application Logic/Interactor/RecipientsInteractor.swift
  3. 2
      GME Remit/Modules/RecipientModules/Recipients/Application Logic/Interactor/RecipientsInteractorIO.swift
  4. 2
      GME Remit/Modules/RecipientModules/Recipients/User Interface/Presenter/RecipientsPresenter.swift
  5. 27
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard
  6. 6
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModel.swift
  7. 2
      GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModelInterface.swift

BIN
.DS_Store

6
GME Remit/Modules/RecipientModules/Recipients/Application Logic/Interactor/RecipientsInteractor.swift

@ -15,7 +15,7 @@ class RecipientsInteractor {
weak var output: RecipientsInteractorOutput?
private let service: RecipientsServiceType
private var recipients: [Recipient]?
private var recipients: FetchBeneficiariesModel?
// MARK: Initialization
@ -57,8 +57,8 @@ extension RecipientsInteractor: RecipientsInteractorInput {
private func fetchRecipients() {
service.fetchRecipients(
success: {
self.recipients = $0.recipients?.beneficiaries
self.output?.setRecipients(using: $0.recipients?.beneficiaries ?? [])
self.recipients = $0.recipients
self.output?.setRecipients(using: $0.recipients)
},
failure: { self.output?.setError(with:$0) }
)

2
GME Remit/Modules/RecipientModules/Recipients/Application Logic/Interactor/RecipientsInteractorIO.swift

@ -12,6 +12,6 @@ protocol RecipientsInteractorInput: class {
}
protocol RecipientsInteractorOutput: class {
func setRecipients(using model: [Recipient])
func setRecipients(using model: FetchBeneficiariesModel?)
func setError(with error: Error)
}

2
GME Remit/Modules/RecipientModules/Recipients/User Interface/Presenter/RecipientsPresenter.swift

@ -47,7 +47,7 @@ extension RecipientsPresenter: RecipientsModuleInterface {
// MARK: Recipients interactor output interface
extension RecipientsPresenter: RecipientsInteractorOutput {
func setRecipients(using model: [Recipient]) {
func setRecipients(using model: FetchBeneficiariesModel?) {
viewModel?.progress(isShow: false)
viewModel?.setRecipients(using: model)
}

27
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/Recipients.storyboard

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21678"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
@ -28,7 +28,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="P7h-Wp-hN8">
<rect key="frame" x="20" y="10" width="335" height="80"/>
<rect key="frame" x="20" y="30" width="335" height="80"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="ic_recipient" translatesAutoresizingMaskIntoConstraints="NO" id="JqD-KC-CpN">
<rect key="frame" x="20" y="15" width="50" height="50"/>
@ -41,7 +41,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="New Recipient" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" minimumScaleFactor="0.5" translatesAutoresizingMaskIntoConstraints="NO" id="Wj9-qf-u2U">
<rect key="frame" x="90" y="30" width="228" height="20.5"/>
<rect key="frame" x="90" y="30" width="228" height="20"/>
<fontDescription key="fontDescription" name="SanFranciscoDisplay-Regular" family="San Francisco Display" pointSize="17"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
@ -62,7 +62,7 @@
</connections>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="o4b-PJ-27E">
<rect key="frame" x="0.0" y="90" width="375" height="528"/>
<rect key="frame" x="0.0" y="110" width="375" height="508"/>
<subviews>
<searchBar contentMode="redraw" searchBarStyle="minimal" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PQz-1Q-bqI">
<rect key="frame" x="0.0" y="0.0" width="375" height="56"/>
@ -70,7 +70,7 @@
<textInputTraits key="textInputTraits"/>
</searchBar>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" dataMode="prototypes" style="plain" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="vEB-d2-zNF">
<rect key="frame" x="10" y="56" width="355" height="472"/>
<rect key="frame" x="10" y="56" width="355" height="452"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="separatorColor" name="ThemeSeparate"/>
<inset key="separatorInset" minX="15" minY="0.0" maxX="15" maxY="0.0"/>
@ -296,13 +296,13 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Vxa-tz-5xl">
<rect key="frame" x="0.0" y="0.0" width="375" height="1000"/>
<rect key="frame" x="0.0" y="20" width="375" height="980"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Jn7-ZO-8UT">
<rect key="frame" x="0.0" y="0.0" width="375" height="1000"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="999.5"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="0go-1x-iws">
<rect key="frame" x="0.0" y="0.0" width="375" height="1000"/>
<rect key="frame" x="0.0" y="0.0" width="375" height="999.5"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Kly-ZR-KcE">
<rect key="frame" x="0.0" y="0.0" width="375" height="125"/>
@ -477,16 +477,19 @@
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bhj-7t-TFt">
<rect key="frame" x="0.0" y="272" width="375" height="728"/>
<rect key="frame" x="0.0" y="272" width="375" height="727.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Recent Transactions" textAlignment="natural" lineBreakMode="wordWrap" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="10B-NZ-04W">
<rect key="frame" x="24" y="8" width="120.5" height="14.5"/>
<rect key="frame" x="24" y="8" width="120.5" height="14"/>
<constraints>
<constraint firstAttribute="width" secondItem="10B-NZ-04W" secondAttribute="height" multiplier="60:7" id="lkO-qh-O87"/>
</constraints>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="12"/>
<color key="textColor" name="ThemeText"/>
<nil key="highlightedColor"/>
</label>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" scrollEnabled="NO" dataMode="prototypes" style="plain" separatorStyle="none" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="-1" estimatedSectionHeaderHeight="-1" sectionFooterHeight="-1" estimatedSectionFooterHeight="-1" translatesAutoresizingMaskIntoConstraints="NO" id="fv4-Df-cKH">
<rect key="frame" x="20" y="34.5" width="335" height="653.5"/>
<rect key="frame" x="20" y="34" width="335" height="653.5"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="653.5" id="In6-dW-UpD"/>

6
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModel.swift

@ -158,14 +158,14 @@ class RecipientsViewModel: ViewModelType {
// MARK: - RecipientsViewModelInterface
extension RecipientsViewModel: RecipientsViewModelInterface {
func setRecipients(using model: [Recipient]) {
recipientsLinker.onNext(model)
func setRecipients(using model: FetchBeneficiariesModel?) {
recipientsLinker.onNext(model?.beneficiaries ?? [])
guard let selectedID = selectedRecipientID else {
return
}
selectedRecipient = model.filter({$0.receiverID == selectedID}).first
selectedRecipient = model?.beneficiaries?.filter({$0.receiverID == selectedID}).first
if let receipnt = selectedRecipient{
presenter?.openSendMoneyCalculate(who: receipnt)

2
GME Remit/Modules/RecipientModules/Recipients/User Interface/View/ViewModel/RecipientsViewModelInterface.swift

@ -7,7 +7,7 @@
//
protocol RecipientsViewModelInterface: class {
func setRecipients(using model: [Recipient])
func setRecipients(using model: FetchBeneficiariesModel?)
func setError(with error: Error)
func progress(isShow: Bool)

Loading…
Cancel
Save