Browse Source

commit modif

placidenduwayo 2 years ago
parent
commit
1177c4d53d

+ 61
- 2
address-microservice/src/main/java/fr/natan/addressmicroservice/entity/Address.java View File

@@ -11,7 +11,6 @@ import javax.persistence.GenerationType;
11 11
 import javax.persistence.Id;
12 12
 
13 13
 @Entity
14
-@Data @AllArgsConstructor @NoArgsConstructor @ToString
15 14
 public class Address {
16 15
 
17 16
     @Id @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -21,5 +20,65 @@ public class Address {
21 20
     private String pb;
22 21
     private String city;
23 22
     private String residenceCountry;
24
-    private String birthCountry;
23
+
24
+    public Address() {
25
+    }
26
+
27
+    public Address(Long addressID, String numHouse, String streetName,
28
+                   String pb, String city, String residenceCountry) {
29
+        this.addressID = addressID;
30
+        this.numHouse = numHouse;
31
+        this.streetName = streetName;
32
+        this.pb = pb;
33
+        this.city = city;
34
+        this.residenceCountry = residenceCountry;
35
+    }
36
+
37
+    public Long getAddressID() {
38
+        return addressID;
39
+    }
40
+
41
+    public void setAddressID(Long addressID) {
42
+        this.addressID = addressID;
43
+    }
44
+
45
+    public String getNumHouse() {
46
+        return numHouse;
47
+    }
48
+
49
+    public void setNumHouse(String numHouse) {
50
+        this.numHouse = numHouse;
51
+    }
52
+
53
+    public String getStreetName() {
54
+        return streetName;
55
+    }
56
+
57
+    public void setStreetName(String streetName) {
58
+        this.streetName = streetName;
59
+    }
60
+
61
+    public String getPb() {
62
+        return pb;
63
+    }
64
+
65
+    public void setPb(String pb) {
66
+        this.pb = pb;
67
+    }
68
+
69
+    public String getCity() {
70
+        return city;
71
+    }
72
+
73
+    public void setCity(String city) {
74
+        this.city = city;
75
+    }
76
+
77
+    public String getResidenceCountry() {
78
+        return residenceCountry;
79
+    }
80
+
81
+    public void setResidenceCountry(String residenceCountry) {
82
+        this.residenceCountry = residenceCountry;
83
+    }
25 84
 }

+ 0
- 2
address-microservice/src/main/java/fr/natan/addressmicroservice/service/service/AddressService.java View File

@@ -25,7 +25,6 @@ public class AddressService  implements AddressContract {
25 25
         address.setPb(address.getPb().strip());
26 26
         address.setCity(address.getCity().strip());
27 27
         address.setResidenceCountry(address.getResidenceCountry().strip());
28
-        address.setBirthCountry(address.getBirthCountry().strip());
29 28
         return address;
30 29
     }
31 30
 
@@ -36,7 +35,6 @@ public class AddressService  implements AddressContract {
36 35
                 || address.getPb().isEmpty()
37 36
                 || address.getCity().isEmpty()
38 37
                 || address.getResidenceCountry().isEmpty()
39
-                || address.getBirthCountry().isEmpty()
40 38
         ){
41 39
             isInvalid=true;
42 40
         }

+ 18
- 5
employee-microservice/src/main/java/fr/natan/employeemicroservice/entity/Employee.java View File

@@ -16,24 +16,29 @@ public class Employee {
16 16
     private String lastname;
17 17
     private String email;
18 18
     private String createdDate;
19
+    private String birthCountry;
19 20
     private Long addressID;
20 21
     @Transient
21 22
     private Address address;
22 23
 
23
-    public Employee(Long employeeID, String firstname, String lastname, String email, String createdDate,
24
-                    Long addressID, Address address) {
24
+    public Employee() {
25
+    }
26
+
27
+    public Employee(Long employeeID,
28
+                    String firstname, String lastname,
29
+                    String email, String createdDate,
30
+                    String birthCountry, Long addressID,
31
+                    Address address) {
25 32
         this.employeeID = employeeID;
26 33
         this.firstname = firstname;
27 34
         this.lastname = lastname;
28 35
         this.email = email;
29 36
         this.createdDate = createdDate;
37
+        this.birthCountry = birthCountry;
30 38
         this.addressID = addressID;
31 39
         this.address = address;
32 40
     }
33 41
 
34
-    public Employee() {
35
-    }
36
-
37 42
     public Long getEmployeeID() {
38 43
         return employeeID;
39 44
     }
@@ -74,6 +79,14 @@ public class Employee {
74 79
         this.createdDate = createdDate;
75 80
     }
76 81
 
82
+    public String getBirthCountry() {
83
+        return birthCountry;
84
+    }
85
+
86
+    public void setBirthCountry(String birthCountry) {
87
+        this.birthCountry = birthCountry;
88
+    }
89
+
77 90
     public Long getAddressID() {
78 91
         return addressID;
79 92
     }

+ 1
- 0
employee-microservice/src/main/java/fr/natan/employeemicroservice/service/services/EmployeeService.java View File

@@ -29,6 +29,7 @@ public class EmployeeService implements EmployeeContract {
29 29
     private Employee normalizeEmployee(Employee employee){
30 30
         employee.setFirstname(employee.getFirstname().strip());
31 31
         employee.setLastname(employee.getLastname().strip());
32
+        employee.setBirthCountry(employee.getBirthCountry().strip());
32 33
         employee.setLastname(employee.getLastname().toUpperCase());
33 34
 
34 35
         return employee;

+ 0
- 1
employee-microservice/src/main/java/fr/natan/employeemicroservice/t_openFeign/address/Address.java View File

@@ -10,5 +10,4 @@ public class Address {
10 10
     private int pb;
11 11
     private String city;
12 12
     private String residenceCountry;
13
-    private String birthCountry;
14 13
 }

Powered by TurnKey Linux.