-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.h
39 lines (32 loc) · 1.19 KB
/
account.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef ACCOUNT_H
#define ACCOUNT_H
#include <iostream>
#include <nlohmann/json.hpp>
#include "utils.h"
#include "bankerror.h"
class Account{
private:
// ====== normal members ======
unsigned long int accountNumber;
unsigned long int accountHolderId;
unsigned long int balance;
std::string type;
public:
// ====== constructors ======
Account(const unsigned long int &accountNumber);
// ====== static methods ======
static long int getLastAccountNumber();
static void displayAccountDetails(const unsigned long int &accountNumber);
static long int createNewAccount(const std::string &accountHolderId, const unsigned long int &balance, const std::string &type);
static void removeAccount(const unsigned long int &accountNumber, const std::string &staffId);
// ====== getter methods ======
long int getAccountNumber();
long int getBalance();
long int getAccountHolderId();
std::string getType();
// ====== util methods ======
void withdraw(const unsigned long int &amount, const std::string &staffId="");
void deposit(const unsigned long int &amount, const std::string &staffId="");
void displayAccountDetails();
};
#endif // ACCOUNT_H