-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCustomer.cpp
More file actions
69 lines (53 loc) · 1.75 KB
/
Copy pathCustomer.cpp
File metadata and controls
69 lines (53 loc) · 1.75 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
58
59
60
61
62
63
64
65
66
67
68
69
//
// Created by Jairo Riaño on 13/04/20.
//
#include "Customer.h"
Customer::Customer(const std::string &idCustomer, const std::string &firstName, const std::string &lastName, EGender gender,
const std::string &phone) : idCustomer(idCustomer), firstName(firstName), lastName(lastName),
gender(gender), phone(phone) {}
const std::string &Customer::getIdCustomer() const {
return idCustomer;
}
void Customer::setIdCustomer(const std::string &idCustomer) {
Customer::idCustomer = idCustomer;
}
const std::string &Customer::getFirstName() const {
return firstName;
}
void Customer::setFirstName(const std::string &firstName) {
Customer::firstName = firstName;
}
const std::string &Customer::getLastName() const {
return lastName;
}
void Customer::setLastName(const std::string &lastName) {
Customer::lastName = lastName;
}
EGender Customer::getGender() const {
return gender;
}
void Customer::setGender(EGender gender) {
Customer::gender = gender;
}
const std::string &Customer::getPhone() const {
return phone;
}
void Customer::setPhone(const std::string &phone) {
Customer::phone = phone;
}
void Customer::addAccount(Account* account) {
accounts.push_back( account );
}
std::vector<Account *> Customer::getAccounts() {
return std::vector<Account *>( Customer::accounts );
}
std::string Customer::toString() {
std::string gender = Customer::gender == EGender::FEMALE ? "Femenino" : "Masculino";
return "Customer[idCustomer=" + idCustomer + ", lastName=" + lastName + ", firstName=" + firstName +
", gender=" + gender + ", phone=" + phone + "]\n";
}
Customer::~Customer() {
for (Account* account : accounts ){
delete( account );
}
}