Personal Finance 1.0.0
An application that allows you to track/store/view finances, as well as calculate different financial values.
Account.h
Go to the documentation of this file.
1/*
2 * Author: Dawson Dauphinais
3 * ddauphin@nmu.edu
4 *
5 * Date Last Modified: 11/23/2021
6 *
7 * This file contains the definitions of functions belonging to the Account class.
8 * --------------------------------------------------------------------------------
9 * */
10/*
11* This application contains software from:
12*
13* Title: "JSON for Modern C++"
14* Author: Lohmann, Niels
15* -orchid: https://orcid.org/0000-0001-9037-795X
16* -email: mail@nlohmann.me
17* -website: https://nlohmann.me
18*
19* Version: 3.10.4
20* License: MIT
21* Repository-Code: "https://github.com/nlohmann"
22* URL: https://json.nlohmann.me
23*/
24
25#ifndef PERSONALFINANCE_ACCOUNT_H
26#define PERSONALFINANCE_ACCOUNT_H
27
28#include "Money.h"
29#include "Expense.h"
30#include <vector>
31#include "Income.h"
32#include <map>
33#include <nlohmann/json.hpp>
34
40class Account : public Money
41{
42private:
43 string nameOfAccount;
44 Money balance;
45 Money grossIncome;
46 map<string, string> transactions;
47 map<string, string> recurring;
48 map<string, string> incomeList;
49
50public:
58 void setValues(string str, Money bal, map<string, string> tr, map<string, string> inc);
59
65 void setName(string name);
66
72 void setBalance(Money bal);
73
79 void setTransactions(map<string, string> mp);
80
86 void setRecurringList(map<string, string> mp);
87
93 void setIncomeList(map<string, string> in);
94
100
105 map<string, string> getTransactions();
106
111 map<string, string> getIncomeList();
112
117 map<string, string> getRecurringList();
118
124
130
136
142
148
154
160
166
172
178
186
193
199 nlohmann::json toJSON();
200};
201
202#endif //PERSONALFINANCE_ACCOUNT_H
The Account class is used to perform various operations on an Account object.
Definition: Account.h:41
void setIncomeList(map< string, string > in)
Sets the income list on the account.
Money getGrossIncome()
Returns the gross income on the account.
void addToGrossIncome(Money m)
Adds a value to the gross income.
void addIncome(Income i)
Adds an income to the current account.
Money getTotalFromTransactions()
Returns the total amount spent on transactions.
void setBalance(Money bal)
Sets the account balance.
void setRecurringList(map< string, string > mp)
Sets the recurring transactions list on the account.
Money getTotalIncome()
Returns the total amount of income on the account.
void printAccountDetails()
Prints all details of the current account.
void setValues(string str, Money bal, map< string, string > tr, map< string, string > inc)
Sets the values of Account.
map< string, string > getIncomeList()
Returns the list of incomes currently on the account.
void setName(string name)
Sets the name of the account.
void printIncomeList()
Prints a list of all incomes on the account.
void addTransaction(Expense &e)
Adds an expense to the transaction list.
string getNameOfAccount()
Returns the name of the account.
void addToIncomeList(Income i)
Adds an income to the income list.
nlohmann::json toJSON()
Converts the Account object into a nlohmann::json object.
void printTransactions()
Prints a list of all transactions on the account.
map< string, string > getTransactions()
Returns the list of transactions on the account.
void updateBalance(Money &m)
Updates the current balance of the account.
Money getBalance()
Returns the current balance of the account.
map< string, string > getRecurringList()
Returns the list of recurring transactions on the account.
void setTransactions(map< string, string > mp)
Sets the transactions list on the account.
The Expense class is used to perform various operations on an Expense object.
Definition: Expense.h:21
This class is used to store income objects.
Definition: Income.h:20
The Money class is used to allow operations on Money.
Definition: Money.h:27