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 or symbol
Failed to load files and symbols.
+50 −36
Diff settings

Always

Just for now

SWF-17 More wellness implementation and improvements

- added static defaults for the “blurbs” used to describe wellness metrics
- used these in our new and existing metrics descriptions
- implemented passing of values to `AvgUtilization` and `HealthyAccounts` metrics
- set up calculation for these metrics in Wellness as well
  • Loading branch information...
ahm11003 committed Apr 23, 2019
commit 433ebacb56a9cedddc0702f52c93ee2daad517e9
@@ -464,7 +464,7 @@
<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"/>
<imageView width="1" height="93" alignment="center" verticalAlignment="center" contentMode="scaleAspectFit" id="JDC-go-3sn"/>
<button width="1" alignment="left" verticalAlignment="bottom" title="Button" id="JxL-nb-z6E">
<connections>
<action selector="showDetails" destination="WY4-SK-U7W" id="Hie-sR-PE3"/>
@@ -492,7 +492,7 @@
</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">
<label width="0.5" height="1" alignment="center" alpha="0.0" 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>
@@ -9,26 +9,33 @@
import WatchKit
import Foundation


class AvgUtilizationInterfaceController: WKInterfaceController {

@IBOutlet var avgUtilizationChart: WKInterfaceImage!

var didAnimate: Bool = false
var average: Double = 0.0
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()
guard let avg = context as? Double else {
NSLog("Error getting average utilization.")
return
}
average = avg
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
override func didAppear() {
if !didAnimate {
avgUtilizationChart.setImageNamed("scores")
if average < 1.0 {
avgUtilizationChart.startAnimatingWithImages(in: NSRange(location: 0, length: 1), duration: 1, repeatCount: 1)
} else {
avgUtilizationChart.startAnimatingWithImages(in: NSRange(location: 1, length: Int(average)), duration: 1, repeatCount: 1)
}
didAnimate = true
}
}

@IBAction func showDetails() {
presentAlert(withTitle: "Average Utilization", message: Defaults.AVG_UTIL, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}
}
@@ -9,26 +9,27 @@
import WatchKit
import Foundation


class HealthyAccountsInterfaceController: WKInterfaceController {

@IBOutlet var healthyCountLabel: WKInterfaceLabel!

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

// Configure interface objects here.
}
guard let data = context as? Int else {
NSLog("Error getting healthy account count.")
return
}

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

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
override func didAppear() {
super.didAppear()
animate(withDuration: 1.5) {
self.healthyCountLabel.setAlpha(1.0)
}
}

@IBAction func showDetails() {
presentAlert(withTitle: "Healthy Accounts", message: Defaults.HEALTHY_ACCTS, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}

}
@@ -9,14 +9,12 @@
import WatchKit
import Foundation


class LastPaymentInterfaceController: WKInterfaceController {

@IBOutlet var descriptionLabel: WKInterfaceLabel!
@IBOutlet var valueLabel: WKInterfaceLabel!

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

// Configure interface objects here.
}

@@ -31,5 +29,6 @@ class LastPaymentInterfaceController: WKInterfaceController {
}

@IBAction func showDetails() {
presentAlert(withTitle: "Last Payment", message: Defaults.LAST_PAYMENT, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}
}
@@ -54,6 +54,6 @@ class UtilizationTrendInterfaceController: WKInterfaceController {
}

@IBAction func showDetails() {
presentAlert(withTitle: "Trends", message: "Lowering your utilization over time can help reduce the amount of interest accrued on your accounts.", preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
presentAlert(withTitle: "Trends", message: Defaults.UTIL_TRENDS, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}
}
@@ -65,6 +65,6 @@ class UtilizationInterfaceController: WKInterfaceController {
}

@IBAction func showDetails() {
presentAlert(withTitle: "Utilization Details", message: "Credit utilization is the ratio of credit used compared to total credit. Ideally, this value should be 20% or below.", preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
presentAlert(withTitle: "Utilization Details", message: Defaults.UTIL, preferredStyle: .alert, actions: [WKAlertAction(title: "Done", style: .default, handler: {})])
}
}
@@ -22,6 +22,13 @@ final class Defaults {
static let token = UserDefaults.standard.string(forKey: "access_token") ?? ""
static let authHeader = ["Authorization": "Bearer \(token)"]

// MARK: - Wellness Detail Blurbs
static let UTIL = "Credit utilization is the ratio of credit used compared to total credit. Ideally, this value should be 30% or below."
static let UTIL_TRENDS = "Lowering your utilization over time can help reduce the amount of interest accrued on your accounts."
static let AVG_UTIL = "Average Utilization shows the mean credit utilization across all of your CareCredit accounts"
static let LAST_PAYMENT = "Making monthly payments at this rate (excluding interests), you can eliminate your balance in the noted time period."
static let HEALTHY_ACCTS = "Healthy accounts shows how many of your CareCredit accounts stand with a utilization at 30% or below."

static let careCreditDateFormatter: DateFormatter = {
var formatter = DateFormatter()
formatter.dateFormat = "yyyyMMdd"
@@ -40,13 +47,13 @@ final class Defaults {
"mobile_longitude": 0.0],
"password": "Test12test",
"scope": "default",
"username": "carecredit"]
"username": "hhgregg2088"]
}()

// this header is used for multi-account and fetch banks resources
static var headerForMulti: [String: Any] = {
return ["header": defaultHeader,
"username": "carecredit"]
"username": "hhgregg2088"]
}()

static var headerForTransaction: [String: Any] = {
@@ -65,7 +72,7 @@ final class Defaults {
"header": defaultHeader,
"scope_indicator": "B",
"start_date": start_date,
"username": "carecredit"]
"username": "hhgregg2088"]
}()

static var headerForCancelPmt: [String: Any] = {
@@ -83,7 +90,7 @@ final class Defaults {
"scope_indicator": "B",
"payment_confirmation_number": pmt_confirmation,
"payment_id": payment_id,
"username": "carecredit"]
"username": "hhgregg2088"]
}()

static var headerForPmt: [String: Any] = {
@@ -99,6 +106,6 @@ final class Defaults {
"payment_amount": 123.45,
"payment_amount_type": "CBL",
"scheduled_payment_post_date": "20190306",
"username": "carecredit"]
"username": "hhgregg2088"]
}()
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.