Skip to content

Commit b0f52f7

Browse files
feat: add AccountResellerAgent entity to manage agents for resellers
Signed-off-by: Mario Serrano <[email protected]>
1 parent 1411c3d commit b0f52f7

File tree

1 file changed

+103
-0
lines changed

1 file changed

+103
-0
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package tools.dynamia.modules.saas.domain;
2+
3+
import jakarta.persistence.Column;
4+
import jakarta.persistence.Entity;
5+
import jakarta.persistence.ManyToOne;
6+
import tools.dynamia.domain.contraints.Email;
7+
import tools.dynamia.domain.contraints.NotEmpty;
8+
import tools.dynamia.domain.jpa.SimpleEntity;
9+
10+
import java.io.Serializable;
11+
12+
/**
13+
* Entity representing an agent or seller for a reseller (AccountReseller).
14+
* Contains basic contact information and a many-to-one relationship with AccountReseller.
15+
* <p>
16+
* Fields:
17+
* <ul>
18+
* <li>name: Agent's full name (required)</li>
19+
* <li>email: Contact email</li>
20+
* <li>phone: Contact phone number</li>
21+
* <li>address: Contact address</li>
22+
* <li>identification: Identification number or code</li>
23+
* <li>reseller: Associated AccountReseller</li>
24+
* </ul>
25+
*/
26+
@Entity
27+
public class AccountResellerAgent extends SimpleEntity implements Serializable {
28+
29+
30+
@NotEmpty(message = "Agent name is required")
31+
private String name;
32+
33+
@Email
34+
private String email;
35+
36+
@Column(length = 20)
37+
private String phone;
38+
39+
@Column(length = 200)
40+
private String address;
41+
42+
@Column(length = 50)
43+
private String identification;
44+
45+
@ManyToOne(optional = false)
46+
private AccountReseller reseller;
47+
48+
49+
// Getters y setters
50+
51+
public String getName() {
52+
return name;
53+
}
54+
55+
public void setName(String name) {
56+
this.name = name;
57+
}
58+
59+
public String getEmail() {
60+
return email;
61+
}
62+
63+
public void setEmail(String email) {
64+
this.email = email;
65+
}
66+
67+
public String getPhone() {
68+
return phone;
69+
}
70+
71+
public void setPhone(String phone) {
72+
this.phone = phone;
73+
}
74+
75+
public String getAddress() {
76+
return address;
77+
}
78+
79+
public void setAddress(String address) {
80+
this.address = address;
81+
}
82+
83+
public String getIdentification() {
84+
return identification;
85+
}
86+
87+
public void setIdentification(String identification) {
88+
this.identification = identification;
89+
}
90+
91+
public AccountReseller getReseller() {
92+
return reseller;
93+
}
94+
95+
public void setReseller(AccountReseller reseller) {
96+
this.reseller = reseller;
97+
}
98+
99+
@Override
100+
public String toString() {
101+
return name;
102+
}
103+
}

0 commit comments

Comments
 (0)