Skip to content
Permalink
9303329f97
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
43 lines (38 sloc) 1.1 KB
//
// 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
var transactionCode: String
init(type: TransactionType, amount: Double, merchantID: String, date: Date,
confirmationNum: String? = nil, paymentId: Int? = nil, isPending: Bool? = nil, isModifiable: Bool? = nil, transactionCode: String) {
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
self.transactionCode = transactionCode
}
}