This repository has been archived by the owner on Dec 4, 2024. It is now read-only.
-
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 branch 'main' into feature/use-cases
- Loading branch information
Showing
21 changed files
with
301 additions
and
210 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
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
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
19 changes: 0 additions & 19 deletions
19
src/main/java/br/com/fiap/grupo30/fastfood/application/services/OrderService.java
This file was deleted.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
...fastfood/application/services/exceptions/CantChangeOrderProductsAfterSubmitException.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,17 @@ | ||
package br.com.fiap.grupo30.fastfood.application.services.exceptions; | ||
|
||
import java.io.Serial; | ||
|
||
public class CantChangeOrderProductsAfterSubmitException extends DomainValidationException { | ||
|
||
@Serial private static final long serialVersionUID = 1L; | ||
private static final String MESSAGE = "Can not change products of a submitted order"; | ||
|
||
public CantChangeOrderProductsAfterSubmitException() { | ||
super(MESSAGE); | ||
} | ||
|
||
public CantChangeOrderProductsAfterSubmitException(Throwable exception) { | ||
super(MESSAGE, exception); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
.../grupo30/fastfood/application/services/exceptions/CompositeDomainValidationException.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 br.com.fiap.grupo30.fastfood.application.services.exceptions; | ||
|
||
import java.io.Serial; | ||
import java.util.Collection; | ||
|
||
public class CompositeDomainValidationException extends ResourceBadRequestException { | ||
|
||
@Serial private static final long serialVersionUID = 1L; | ||
|
||
public CompositeDomainValidationException(Collection<String> domainErrors) { | ||
super(String.join(", ", domainErrors)); | ||
} | ||
|
||
public CompositeDomainValidationException( | ||
Collection<String> domainErrors, Throwable exception) { | ||
super(String.join(", ", domainErrors), exception); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
.../com/fiap/grupo30/fastfood/application/services/exceptions/DomainValidationException.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,15 @@ | ||
package br.com.fiap.grupo30.fastfood.application.services.exceptions; | ||
|
||
import java.io.Serial; | ||
|
||
public abstract class DomainValidationException extends ResourceBadRequestException { | ||
@Serial private static final long serialVersionUID = 1L; | ||
|
||
public DomainValidationException(String msg) { | ||
super(msg); | ||
} | ||
|
||
public DomainValidationException(String msg, Throwable exception) { | ||
super(msg, exception); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...ava/br/com/fiap/grupo30/fastfood/application/services/exceptions/InvalidCpfException.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,16 @@ | ||
package br.com.fiap.grupo30.fastfood.application.services.exceptions; | ||
|
||
import java.io.Serial; | ||
|
||
public class InvalidCpfException extends DomainValidationException { | ||
@Serial private static final long serialVersionUID = 1L; | ||
private static final String MESSAGE_TEMPLATE = "Invalid CPF: %s"; | ||
|
||
public InvalidCpfException(String cpf) { | ||
super(String.format(MESSAGE_TEMPLATE, cpf)); | ||
} | ||
|
||
public InvalidCpfException(String cpf, Throwable exception) { | ||
super(String.format(MESSAGE_TEMPLATE, cpf), exception); | ||
} | ||
} |
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
16 changes: 0 additions & 16 deletions
16
...o30/fastfood/application/services/exceptions/UserCantChangeOrderAfterSubmitException.java
This file was deleted.
Oops, something went wrong.
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
106 changes: 0 additions & 106 deletions
106
src/main/java/br/com/fiap/grupo30/fastfood/application/services/impl/OrderServiceImpl.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/br/com/fiap/grupo30/fastfood/domain/commands/AddProductToOrderCommand.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.