Skip to content

Swf 21 hook up to web apis #11

Merged
merged 23 commits into from Apr 3, 2019
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
79afbdf
SWF-21 [cocoapods] install Alamofire
ahm11003 Mar 12, 2019
ff0b413
Merge branch 'master' into SWF-21-hook-up-to-web-apis
ahm11003 Mar 12, 2019
f2a8883
SWF-21 [cocoapods] install SwiftyJSON
ahm11003 Mar 13, 2019
e85d2cb
SWF-21 initial web service setup
ahm11003 Mar 14, 2019
da5294a
Updated Accounts Model and created request to Multi-Account-Summary-D…
rrk12005 Mar 14, 2019
a2599ec
Quick Fix for bug where request not parsing payload JSON
rrk12005 Mar 14, 2019
ba4409d
SWF-21 improve login logic & more
ahm11003 Mar 21, 2019
8405351
Merge branch 'master' into SWF-21-hook-up-to-web-apis
ahm11003 Mar 28, 2019
c80231e
SWF-21 pass fetched accounts to AccountTVIC
ahm11003 Mar 28, 2019
c4cc995
SWF-21 Modified header for transactions fetch
ahm11003 Mar 28, 2019
21d742c
SWF-21 preliminary fetch function for transactions
ahm11003 Mar 28, 2019
8487ce3
SWF-21 Initial transaction implementation
ahm11003 Mar 28, 2019
24deb73
SWF-21 Initial setup for “loading” during account tap
ahm11003 Mar 28, 2019
a3682e4
SWF-21 basic paradigm for passing account data to root interface cont…
ahm11003 Mar 28, 2019
56caa7c
SWF-21 Extensions on WKInterfaceImage
ahm11003 Mar 28, 2019
2c01f37
SWF-21 Replace alerts with new activity indicator
ahm11003 Mar 28, 2019
82d2319
SWF-21 Remove unused code
ahm11003 Mar 28, 2019
28a7fc1
Merge branch 'master' into SWF-21-hook-up-to-web-apis
ahm11003 Mar 29, 2019
3ee46a5
SWF-21 move fetch transactions call
ahm11003 Mar 29, 2019
6bedc02
SWF-21 UI fixes
ahm11003 Mar 29, 2019
00d3583
SWF-21 Care credit image assets, loading label
ahm11003 Mar 29, 2019
d5f19aa
Added requests and handlers for fetching pending transactions, fetchi…
rrk12005 Apr 2, 2019
86153df
fixed constructor implementation for transaction and added newline af…
rrk12005 Apr 3, 2019
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

SWF-21 Initial transaction implementation

- we now fetch transactions for a given account when that account is selected from the table
- storyboard segue to present account details and transactions was deleted in favor of presenting programmatically in order to only perform the segue once web service to fetch transactions completes
- removed some code populating UI with demo data
  • Loading branch information
ahm11003 committed Mar 28, 2019
commit 8487ce3b4cc32d5ba9309a79d540cf234d8a787f
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14460.31" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Qge-pO-HLc">
<device id="watch38" orientation="portrait">
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14490.64" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Qge-pO-HLc">
<device id="watch42" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="watchOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14460.16"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.47"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14490.20"/>
</dependencies>
<scenes>
<!--Main Menu Interface Controller-->
@@ -100,7 +100,6 @@
</group>
<connections>
<outlet property="accountName" destination="Tl1-Kc-YJS" id="cgD-CY-lzh"/>
<segue destination="yrN-yp-gkH" kind="modal" identifier="showAccountDetails" id="geu-70-EU1"/>
</connections>
</tableRow>
</items>
@@ -113,10 +112,10 @@
</objects>
<point key="canvasLocation" x="414" y="-53"/>
</scene>
<!--Account Details Interface Controller-->
<!--AccountDetails-->
<scene sceneID="ozX-Kj-4yZ">
<objects>
<controller id="yrN-yp-gkH" customClass="AccountDetailsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<controller identifier="AccountDetails" id="yrN-yp-gkH" customClass="AccountDetailsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="left" text="Label" textAlignment="center" id="qzl-GE-bpZ">
<fontDescription key="font" style="UICTFontTextStyleHeadline"/>
@@ -137,10 +136,10 @@
</objects>
<point key="canvasLocation" x="755" y="-53.5"/>
</scene>
<!--Transactions Interface Controller-->
<!--Transactions-->
<scene sceneID="yXO-yR-k6b">
<objects>
<controller id="Jfd-Hv-PHe" customClass="TransactionsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<controller identifier="Transactions" id="Jfd-Hv-PHe" customClass="TransactionsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<table alignment="left" id="OQb-xu-Ynf">
<items>
@@ -12,6 +12,7 @@ import Foundation
class AccountTableInterfaceController: WKInterfaceController {
var accounts: [Account] = []
var acctDict: [String: Account] = [:]
var transactionDict: [String: [Transaction]] = [:]

@IBOutlet weak var accountTable: WKInterfaceTable!
override func awake(withContext context: Any?) {
@@ -38,12 +39,22 @@ class AccountTableInterfaceController: WKInterfaceController {
if segueIdentifier == "showAccountDetails" {
// account data is passed to the first interface controller in our new navigation stack
// if we want to pass to subsequent interface controllers, we would add them in corresponding order
acctDict.updateValue(accounts[rowIndex], forKey: "acct")
// acctDict.updateValue(accounts[rowIndex], forKey: "acct")
// acctDict.updateValue(transactions, forKey: "transactions")
return [acctDict]
}
return nil
}

override func table(_ table: WKInterfaceTable, didSelectRowAt rowIndex: Int) {
acctDict.updateValue(accounts[rowIndex], forKey: "acct")
FetchData.fetchTransactionsFor(accountAlias: accounts[rowIndex].accountAlias) { transactions, error in
guard error == nil else { return }
self.transactionDict.updateValue(transactions, forKey: "transactions")
self.presentController(withNames: ["AccountDetails", "Transactions"], contexts: [self.acctDict, self.transactionDict])
}
}

private func configureRows() {
accountTable.setNumberOfRows(accounts.count, withRowType: "account")

@@ -15,10 +15,13 @@ class TransactionsInterfaceController: WKInterfaceController {

override func awake(withContext context: Any?) {
super.awake(withContext: context)
for i in 0..<5 {
transactions.append(Transaction(type: .purchase, amount: 50.00 * Double(i), merchantID: "WalMart Store 1245\(i)", date: Calendar.current.date(byAdding: .day, value: -i, to: Date()) ?? Date()))
transactions.append(Transaction(type: .reimbursement, amount: 12.5 * Double(i), merchantID: "Thank You", date: Calendar.current.date(byAdding: .day, value: -i, to: Date()) ?? Date()))

guard let data = context as? [String: [Transaction]], let trans = data["transactions"] else {
NSLog("Error receiving context containing transactions in TransactionsInterfaceController")
return
}

transactions = trans
configureRows()
}

@@ -11,7 +11,6 @@
281283568A34D3C5D9C7B383 /* libPods-SynchronyFinancial WatchKit Extension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CAA6D46F907ADAABF49FD409 /* libPods-SynchronyFinancial WatchKit Extension.a */; };
48DA0058221D12E70081A500 /* AccountCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48DA0057221D12E70081A500 /* AccountCell.swift */; };
48F243072214C98600B9C894 /* AccountTableInterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F243062214C98600B9C894 /* AccountTableInterfaceController.swift */; };
48F243082214CA9600B9C894 /* AccountTableInterfaceController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F243062214C98600B9C894 /* AccountTableInterfaceController.swift */; };
48F2430A2214CBA200B9C894 /* Interface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 67BAC27C219E254800713FEF /* Interface.storyboard */; };
48F2430D2214CBF700B9C894 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F2430B2214CBF700B9C894 /* Account.swift */; };
48F2430E2214CBF700B9C894 /* Transaction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48F2430C2214CBF700B9C894 /* Transaction.swift */; };
@@ -171,8 +170,6 @@
48F2430B2214CBF700B9C894 /* Account.swift */,
48F2430C2214CBF700B9C894 /* Transaction.swift */,
67E17B85223812C2008871FE /* Defaults.swift */,
6717460B21F8FCC100696468 /* Account.swift */,
6717460921F8FCBE00696468 /* Transaction.swift */,
67BAC268219E254700713FEF /* AppDelegate.swift */,
67BAC26C219E254700713FEF /* Main.storyboard */,
67BAC26F219E254800713FEF /* Assets.xcassets */,
@@ -455,13 +452,11 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
6717460A21F8FCBF00696468 /* Transaction.swift in Sources */,
67E17B86223812C2008871FE /* Defaults.swift in Sources */,
48F2430D2214CBF700B9C894 /* Account.swift in Sources */,
678C388622309F7D00FEAAF6 /* AccountCell.swift in Sources */,
48F2430E2214CBF700B9C894 /* Transaction.swift in Sources */,
67BAC269219E254700713FEF /* AppDelegate.swift in Sources */,
48F243082214CA9600B9C894 /* AccountTableInterfaceController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -474,9 +469,7 @@
678C38842230950100FEAAF6 /* AccountDetailsInterfaceController.swift in Sources */,
673F396E21A644570051469E /* MainMenuInterfaceController.swift in Sources */,
67E17B87223812C2008871FE /* Defaults.swift in Sources */,
6717460E21F8FCDB00696468 /* Transaction.swift in Sources */,
1123372E223ABD6400B70925 /* FetchData.swift in Sources */,
6717460D21F8FCD800696468 /* Account.swift in Sources */,
48F243072214C98600B9C894 /* AccountTableInterfaceController.swift in Sources */,
676392B62242A3F800740A8C /* TransactionCell.swift in Sources */,
48F2430F2214CC2200B9C894 /* Transaction.swift in Sources */,
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.