-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mairess/creates-customer-routes
Creates customer routes
- Loading branch information
Showing
12 changed files
with
167 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/com/maires/wnet/controller/advice/GeneralControllerAdvice.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/main/java/com/maires/wnet/controller/dto/CustomerCreationDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package com.maires.wnet.controller.dto; | ||
|
||
import com.maires.wnet.entity.Customer; | ||
|
||
/** | ||
* The addressType Customer creation dto. | ||
*/ | ||
public record CustomerCreationDto(String name, String cpf, String phone, String email) { | ||
|
||
/** | ||
* To entity customer. | ||
* | ||
* @return the customer | ||
*/ | ||
public Customer toEntity() { | ||
return new Customer(name, cpf, phone, email); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/maires/wnet/controller/dto/CustomerDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.maires.wnet.controller.dto; | ||
|
||
import com.maires.wnet.entity.Customer; | ||
|
||
/** | ||
* The addressType Customer dto. | ||
*/ | ||
public record CustomerDto(Long id, String name, String cpf, String phone, String email, | ||
String registrationDate) { | ||
|
||
/** | ||
* From entity customer dto. | ||
* | ||
* @param customer the customer | ||
* @return the customer dto | ||
*/ | ||
public static CustomerDto fromEntity(Customer customer) { | ||
return new CustomerDto( | ||
customer.getId(), | ||
customer.getName(), | ||
customer.getCpf(), | ||
customer.getPhone(), | ||
customer.getEmail(), | ||
customer.getRegistrationDate() | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
.../exceptions/AddressNotFoundException.java → ...e/exception/AddressNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...exceptions/CustomerNotFoundException.java → .../exception/CustomerNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...xceptions/EquipmentNotFoundException.java → ...exception/EquipmentNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.maires.wnet.service.exceptions; | ||
package com.maires.wnet.service.exception; | ||
|
||
|
||
/** | ||
|
2 changes: 1 addition & 1 deletion
2
...ptions/InstallationNotFoundException.java → ...eption/InstallationNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.maires.wnet.service.exceptions; | ||
package com.maires.wnet.service.exception; | ||
|
||
|
||
/** | ||
|
2 changes: 1 addition & 1 deletion
2
...service/exceptions/NotFoundException.java → .../service/exception/NotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...vice/exceptions/PanNotFoundException.java → ...rvice/exception/PanNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.maires.wnet.service.exceptions; | ||
package com.maires.wnet.service.exception; | ||
|
||
|
||
/** | ||
|
2 changes: 1 addition & 1 deletion
2
...ceptions/TechnicianNotFoundException.java → ...xception/TechnicianNotFoundException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package com.maires.wnet.service.exceptions; | ||
package com.maires.wnet.service.exception; | ||
|
||
|
||
/** | ||
|