-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.cpp
46 lines (34 loc) · 903 Bytes
/
Customer.cpp
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
#include "OrderHistory.h"
#include "OrderSystem.h"
#include "Customer.h"
Customer::Customer(std::string name, std::string address) : _name(name), _address(address) { }
void Customer::AddOrder(const Order& order) {
_history.Add(order);
}
std::vector<Order> Customer::GetActiveOrders(){
return _history.GetActiveOrders();
}
void Customer::CancelOrder(int id) {
_history.CancelOrder(id);
}
void Customer::CompleteOrder(int id) {
_history.CompleteOrder(id);
}
bool Customer::operator==(const Customer& other) const {
if (this->_name != other._name) {
return false;
}
if (this->_address != other._address) {
return false;
}
return true;
}
std::vector<Order>& Customer::GetOrders(){
return _history.GetOrders();
}
std::string Customer::GetName() {
return _name;
}
void Customer::DeleteOrder(const int id) {
_history.DeleteOrder(id);
}