Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
SynchronyFinancialWatchApp/SynchronyFinancial/SynchronyFinancial/Transaction.swift
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
41 lines (36 sloc)
1020 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Transaction.swift | |
// | |
// | |
// Created by Alan Maynard on 1/23/19. | |
// | |
import Foundation | |
public enum TransactionType: Int { | |
case purchase = 0 | |
case reimbursement = 1 | |
} | |
public enum PaymentType: String { | |
case currentBal = "CBL" | |
case minimumDue = "MIN" | |
} | |
class Transaction: NSObject { | |
var type: TransactionType | |
var amount: Double | |
var merchantID: String | |
var date: Date | |
var confirmationNum: String | |
var paymentId: Int | |
var isPending: Bool | |
var isModifiable: Bool | |
init(type: TransactionType, amount: Double, merchantID: String, date: Date, | |
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 ?? 0 | |
self.isPending = isPending ?? false | |
self.isModifiable = isModifiable ?? false | |
} | |
} |