-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransaction.h
More file actions
57 lines (48 loc) · 1.52 KB
/
Transaction.h
File metadata and controls
57 lines (48 loc) · 1.52 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef TRANSACTION_H
#define TRANSACTION_H
#include <string>
/**
* @class Transaction
* @brief Represents a transaction in the library, which could be a book checkout or return.
*/
class Transaction {
private:
std::string memberID;
std::string bookISBN;
std::string transactionType; // e.g., "checkout" or "return"
std::string date; // Date of the transaction
public:
/**
* @brief Constructor to initialize a Transaction object.
* @param memberID ID of the member involved in the transaction.
* @param bookISBN ISBN of the book involved in the transaction.
* @param transactionType Type of transaction ("checkout" or "return").
* @param date Date of the transaction.
*/
Transaction(const std::string& memberID, const std::string& bookISBN, const std::string& transactionType, const std::string& date);
/**
* @brief Gets the member ID involved in the transaction.
* @return Member ID.
*/
std::string getMemberID() const;
/**
* @brief Gets the ISBN of the book involved in the transaction.
* @return Book ISBN.
*/
std::string getBookISBN() const;
/**
* @brief Gets the type of transaction.
* @return Transaction type.
*/
std::string getTransactionType() const;
/**
* @brief Gets the date of the transaction.
* @return Date of the transaction.
*/
std::string getDate() const;
/**
* @brief Displays the transaction's information.
*/
void display() const;
};
#endif // TRANSACTION_H