Skip to content

Swf 17 credit health #17

Merged
merged 26 commits into from May 1, 2019
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
38a78cf
radial progress indicators and page-based nav
ahm11003 Feb 13, 2019
5d7cb80
Added Balance, Utilization, and AccountNumber Controllers. Added PLis…
Mar 6, 2019
10e6442
PList Functions
ahm11003 Mar 6, 2019
c212e13
Merge pull request #5 from rrk12005/demo-radial-style-progress-indica…
jod13004 Mar 6, 2019
83e5766
Added Utilization score calculation
Mar 28, 2019
3be3eef
Renamed files to more accurately represent them. Changed wellness rad…
Mar 29, 2019
5a821f7
no message
Mar 29, 2019
a2f3c9d
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 9, 2019
9303329
- Functions for utilization and account (temporary) metrics.
Apr 11, 2019
3599c77
SWF-17 remove storyboard segue
ahm11003 Apr 11, 2019
2c07f8e
SWF-17 pass our metrics to page hierarchy
ahm11003 Apr 11, 2019
416c2ea
SWF-17 credit utilization improvements
ahm11003 Apr 17, 2019
3e7ddcd
SWE-17 remove unused classes and files
ahm11003 Apr 17, 2019
8e8dec7
SWF-17 fix logical error leading to bad utilization score
ahm11003 Apr 17, 2019
a5c4ac1
SWF-17 remove unused class
ahm11003 Apr 17, 2019
85fd3e2
SWF-17 new class to display trends in credit utilization
ahm11003 Apr 17, 2019
4f67b56
SWF-17 new image assets, implementation for utilization trend
ahm11003 Apr 17, 2019
23fb930
SWF-17 Added basic details for utilization trends
ahm11003 Apr 17, 2019
80acdbf
Merge branch 'master' into SWF-17-credit-health
ahm11003 Apr 17, 2019
ddbc228
SWF-17 More wellness implementation
ahm11003 Apr 23, 2019
4a55d89
SWF-17 more wellness configuration
ahm11003 Apr 23, 2019
d170909
SWF-17 remove unused code
ahm11003 Apr 23, 2019
433ebac
SWF-17 More wellness implementation and improvements
ahm11003 Apr 23, 2019
17dd1df
SWF-17 metric calculations
ahm11003 Apr 23, 2019
a949599
SWF-17 clean up how we receive data for utilization
ahm11003 Apr 23, 2019
f84701b
SWF-17 new image assets, wellness calculation
ahm11003 Apr 24, 2019
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

SWF-17 More wellness implementation

- remove deprecated `PaymentScore` and all related logic to calculate this metric
- added classes `AvgUtilization`, `HealthyAccounts`, and `LastPayment` interface controllers to display more metrics and add dynamic reports for users with multiple accounts
  • Loading branch information
ahm11003 committed Apr 23, 2019
commit ddbc228b5265950d83d1fb0d7f9355e10ea80a7a
@@ -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">
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14490.70" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="Qge-pO-HLc">
<device id="watch38" 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.49"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14490.21"/>
</dependencies>
<scenes>
<!--root-->
@@ -79,8 +79,8 @@
<objects>
<controller identifier="UtilizationTrend" id="Mki-ad-UCC" customClass="UtilizationTrendInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="left" text="Utilization Trends" textAlignment="center" id="0ed-0W-LKq">
<fontDescription key="font" type="boldSystem" pointSize="15"/>
<label width="1" alignment="left" text="Utilization Trends" textAlignment="center" minimumScaleFactor="0.90000000000000002" id="0ed-0W-LKq">
<fontDescription key="font" type="boldSystem" pointSize="16"/>
</label>
<group width="1" alignment="left" verticalAlignment="center" id="FNM-AZ-gSn">
<items>
@@ -305,7 +305,7 @@
</connections>
</controller>
</objects>
<point key="canvasLocation" x="1400" y="516"/>
<point key="canvasLocation" x="1722" y="186"/>
</scene>
<!--Transactions-->
<scene sceneID="yXO-yR-k6b">
@@ -416,26 +416,63 @@
</items>
<connections>
<outlet property="image3" destination="MkL-48-J8l" id="QRq-aZ-tTD"/>
<segue destination="k4M-kn-ZzM" kind="relationship" relationship="nextPage" id="VDf-IX-Y7J"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="613" y="602"/>
</scene>
<!--PaymentScore-->
<scene sceneID="do4-GS-cad">
<!--LastPayment-->
<scene sceneID="VsC-Vr-IJF">
<objects>
<controller identifier="PaymentScore" id="k4M-kn-ZzM" customClass="ConsistencyInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<controller identifier="LastPayment" id="mId-Ii-HO4" customClass="LastPaymentInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" height="20" alignment="left" text="Payment Score" textAlignment="center" id="5cf-d7-ssN"/>
<imageView width="1" height="120" alignment="center" verticalAlignment="center" image="scores" contentMode="scaleAspectFit" initiallyAnimated="NO" id="XsN-KK-JY4"/>
<label width="1" alignment="center" text="Last Payment" textAlignment="center" id="s3f-G9-0Lf">
<fontDescription key="font" type="boldSystem" pointSize="16"/>
</label>
</items>
</controller>
</objects>
<point key="canvasLocation" x="888" y="602"/>
</scene>
<!--AvgUtilization-->
<scene sceneID="w5c-8S-E5f">
<objects>
<controller identifier="AvgUtilization" id="WY4-SK-U7W" customClass="AvgUtilizationInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="1" alignment="center" text="Average Utilization" textAlignment="center" minimumScaleFactor="0.80000000000000004" id="UGo-Sz-lKo">
<fontDescription key="font" type="boldSystem" pointSize="16"/>
</label>
<imageView width="1" height="93" alignment="center" verticalAlignment="center" id="JDC-go-3sn"/>
<button width="1" alignment="left" verticalAlignment="center" title="Button" id="JxL-nb-z6E"/>
</items>
</controller>
</objects>
<point key="canvasLocation" x="1188" y="602"/>
</scene>
<!--HealthyAccts-->
<scene sceneID="EXd-2K-21X">
<objects>
<controller identifier="HealthyAccts" id="uKU-6b-2xO" customClass="HealthyAccountsInterfaceController" customModule="SynchronyFinancial_WatchKit_Extension">
<items>
<label width="136" alignment="left" text="Healthy Accounts" textAlignment="center" minimumScaleFactor="0.80000000000000004" id="N2h-Jp-Si7">
<fontDescription key="font" type="boldSystem" pointSize="16"/>
</label>
<group width="1" height="86" alignment="left" id="kkT-69-aei">
<items>
<label width="0.5" height="1" alignment="center" text="99" textAlignment="center" id="tyj-DI-Sgf">
<color key="textColor" red="0.55326947770000001" green="0.94338613010000005" blue="0.18923908389999999" alpha="1" colorSpace="calibratedRGB"/>
<fontDescription key="font" type="system" weight="heavy" pointSize="55"/>
</label>
<label width="0.5" height="1" alignment="right" text="Accounts with Good or better Utilization" textAlignment="center" numberOfLines="5" id="W6T-4E-azA">
<fontDescription key="font" type="system" pointSize="12"/>
</label>
</items>
</group>
<button width="1" alignment="left" title="Button" id="HTc-Qj-xOt"/>
</items>
<connections>
<outlet property="image4" destination="XsN-KK-JY4" id="fqD-Hx-YuD"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="934" y="602"/>
<point key="canvasLocation" x="1460" y="602"/>
</scene>
</scenes>
<inferredMetricsTieBreakers>
@@ -0,0 +1,31 @@
//
// AvgUtilizationInterfaceController.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 4/23/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import WatchKit
import Foundation


class AvgUtilizationInterfaceController: WKInterfaceController {

override func awake(withContext context: Any?) {
super.awake(withContext: context)

// Configure interface objects here.
}

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

}

This file was deleted.

@@ -0,0 +1,31 @@
//
// GoodAccountsInterfaceController.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 4/23/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import WatchKit
import Foundation


class HealthyAccountsInterfaceController: WKInterfaceController {

override func awake(withContext context: Any?) {
super.awake(withContext: context)

// Configure interface objects here.
}

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

}
@@ -0,0 +1,31 @@
//
// LastPaymentInterfaceController.swift
// SynchronyFinancial WatchKit Extension
//
// Created by Alan Maynard on 4/23/19.
// Copyright © 2019 Alan Maynard. All rights reserved.
//
import WatchKit
import Foundation


class LastPaymentInterfaceController: WKInterfaceController {

override func awake(withContext context: Any?) {
super.awake(withContext: context)

// Configure interface objects here.
}

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}

}
@@ -15,7 +15,6 @@ class WellnessInterfaceController: WKInterfaceController {
var transactionDict: [String: [Transaction]] = [:]
var wellnessScore: Int?
var utilizationScore: Int = 0
var paymentScore: Int = 0
var previousUtil: Int = 0

@IBOutlet weak var image: WKInterfaceImage!
@@ -26,15 +25,6 @@ class WellnessInterfaceController: WKInterfaceController {
if let context = context as? [String: [Account]], let accts = context["accts"] {
accounts = accts
}
/*for index in 0..<accounts.count{
FetchData.fetchTransactionsFor(accountAlias: accounts[index].accountAlias) { transactions, error in
guard error == nil else {
NSLog("Error retrieving transactions for account.")
return
}
self.transactionDict.updateValue(self.transactions, forKey: "transactions")
}
}*/

calculateUtilization()
calculateWellness()
@@ -70,30 +60,18 @@ class WellnessInterfaceController: WKInterfaceController {

private func calculateWellness() {
let m1 = Double(utilizationScore) * 0.50
let m3 = Double(paymentScore) * 0.30
wellnessScore = Int(round(m1 + m3))
wellnessScore = Int(round(m1))
}

/*private func calculatePaymentsMissed() {
var lateCount: Int = 0
for index in 0..<accounts.count {
if let alias = selectedAccount?.accountAlias {
FetchData.fetchTransactionsFor(accountAlias: alias) { transactions, error in
guard error == nil else {
NSLog("Error retrieving transactions for account.")
return
}
self.transactionDict.updateValue(transactions, forKey: "transactions")
self.pushController(withName: "Transactions", context: self.transactionDict)
}
}
}
}*/

@IBAction func moreButtonTapped() {
let pages = ["UtilizationScore", "UtilizationTrend", "PaymentScore"]
let contexts: [Any] = [utilizationScore, [utilizationScore, previousUtil], paymentScore]
presentController(withNames: pages, contexts: contexts)
if accounts.count > 1 {
let pages = ["UtilizationScore", "UtilizationTrend", "AvgUtilization", "HealthyAccts"]
let contexts: [Any] = [utilizationScore, [utilizationScore, previousUtil], 35.5, 7]
presentController(withNames: pages, contexts: contexts)
} else {
let pages = ["UtilizationScore", "UtilizationTrend", "LastPayment"]
let contexts: [Any] = [utilizationScore, [utilizationScore, previousUtil], [10.00, 125.00]]
presentController(withNames: pages, contexts: contexts)
}
}
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.