Skip to content
Permalink
Browse files

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 86153dfea383341f1c3768687be6ec29f316f607
@@ -12,6 +12,7 @@ public enum AccountType: Int {
case checkings = 0
case savings = 1
}

class BankAcct: NSObject {
var bankAcctId: String
var acctType: AccountType
@@ -22,28 +22,15 @@ class Transaction: NSObject {
var isPending: 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,
confirmationNum: String, paymentId: Int, isPending: Bool, isModifiable: Bool) {
confirmationNum: String? = nil, paymentId: Int? = nil, isPending: Bool? = nil, isModifiable: Bool? = nil) {
self.type = type
self.amount = amount
self.merchantID = merchantID
self.date = date
self.confirmationNum = confirmationNum
self.paymentId = paymentId
self.isPending = isPending
self.isModifiable = isModifiable
self.confirmationNum = confirmationNum ?? ""
self.paymentId = paymentId ?? 0
self.isPending = isPending ?? false
self.isModifiable = isModifiable ?? false
}
}

0 comments on commit 86153df

Please sign in to comment.
You can’t perform that action at this time.