Skip to content
Permalink
d5f19aae2e
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
49 lines (44 sloc) 1.33 KB
//
// Transaction.swift
//
//
// Created by Alan Maynard on 1/23/19.
//
import Foundation
public enum TransactionType: Int {
case purchase = 0
case reimbursement = 1
}
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
//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) {
self.type = type
self.amount = amount
self.merchantID = merchantID
self.date = date
self.confirmationNum = confirmationNum
self.paymentId = paymentId
self.isPending = isPending
self.isModifiable = isModifiable
}
}