Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed constructor implementation for transaction and added newline af…
…ter enum in BankAcct
  • Loading branch information
rrk12005 committed Apr 3, 2019
1 parent d5f19aa commit 86153df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions SynchronyFinancial/SynchronyFinancial/BankAcct.swift
Expand Up @@ -12,6 +12,7 @@ public enum AccountType: Int {
case checkings = 0 case checkings = 0
case savings = 1 case savings = 1
} }

class BankAcct: NSObject { class BankAcct: NSObject {
var bankAcctId: String var bankAcctId: String
var acctType: AccountType var acctType: AccountType
Expand Down
23 changes: 5 additions & 18 deletions SynchronyFinancial/SynchronyFinancial/Transaction.swift
Expand Up @@ -22,28 +22,15 @@ class Transaction: NSObject {
var isPending: Bool var isPending: Bool
var isModifiable: Bool var isModifiable: Bool


//this constructor is for the case if it is a posted transaction
init(type: TransactionType, amount: Double, merchantID: String, date: Date, isPending: Bool) {
self.type = type
self.amount = amount
self.merchantID = merchantID
self.date = date
self.confirmationNum = ""
self.paymentId = 0
self.isPending = isPending
self.isModifiable = false
}

//this constructor is for the case if it is a pending transaction
init(type: TransactionType, amount: Double, merchantID: String, date: Date, init(type: TransactionType, amount: Double, merchantID: String, date: Date,
confirmationNum: String, paymentId: Int, isPending: Bool, isModifiable: Bool) { confirmationNum: String? = nil, paymentId: Int? = nil, isPending: Bool? = nil, isModifiable: Bool? = nil) {
self.type = type self.type = type
self.amount = amount self.amount = amount
self.merchantID = merchantID self.merchantID = merchantID
self.date = date self.date = date
self.confirmationNum = confirmationNum self.confirmationNum = confirmationNum ?? ""
self.paymentId = paymentId self.paymentId = paymentId ?? 0
self.isPending = isPending self.isPending = isPending ?? false
self.isModifiable = isModifiable self.isModifiable = isModifiable ?? false
} }
} }

0 comments on commit 86153df

Please sign in to comment.