Class: Transaction

Transaction(transactionId, name, value, description, date, budgetId)

Represents a transaction made in a budget. A transaction could be either an income or a expense. Expenses will have a negative number in the value attribute.

Constructor

new Transaction(transactionId, name, value, description, date, budgetId)

Creates a new instance of a transaction of Transaction.

Parameters:
Name Type Description
transactionId Number

The ID of the transaction.

name String

The title of the transaction.

value Number

The value of the transaction.

description String

A short description of the transaction.

date String

The date which the transaction was made.

budgetId Number

The ID of the budget associated to the transaction.

Source:

Classes

Transaction

Methods

getBudgetId()

Return the ID of the associated budget.

Source:
Returns:

The BudgetID of the transaction.

getDate()

Return the date of the transaction.

Source:
Returns:

Transaction date as a string.

getDescription()

Return the description text to the transaction.

Source:
Returns:

Transaction description.

getName()

Return the title of the transaction.

Source:
Returns:

The transaction name.

getTransactionId()

Return the unique ID of the transaction.

Source:
Returns:

TransactionID.

getValue()

Return the value of the transaction.

Source:
Returns:

Transaction value.

setDate(date)

Set the date of the transaction.

Parameters:
Name Type Description
date String

The date of the transaction.

Source:

setDescription(description)

Set the description of the transaction.

Parameters:
Name Type Description
description String

The description of the transaction.

Source:

setName(name)

Set the name of the transaction.

Parameters:
Name Type Description
name String

The name of the transaction.

Source:

setValue(value)

Set the value of the transaction.

Parameters:
Name Type Description
value Number

New value of the transaction.

Source: