Skip to content

Commit 4f9975d

Browse files
committed
fix: remove invalid validation annotations
1 parent 1d7f5a4 commit 4f9975d

File tree

8 files changed

+12
-15
lines changed

8 files changed

+12
-15
lines changed

techchallenge/src/main/java/br/com/grupo63/techchallenge/adapter/out/external/payment/MercadoPagoService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class MercadoPagoService implements IMercadoPagoService {
1111

1212
// Simulates integration with Mercado Pago
1313
// Would register payment on Mercado Pago side and returns the generated QR code
14-
public String generateQRCode(@NotNull Long id, @NotNull Double transactionAmount) {
14+
public String generateQRCode(Long id, Double transactionAmount) {
1515
String qrCodeData1 = String.format("%020d", id);
1616
String qrCodeData2 = UUID.randomUUID().toString();
1717
String qrCodeData3 = transactionAmount.toString();
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package br.com.grupo63.techchallenge.core.application.external.payment;
22

3-
import jakarta.validation.constraints.NotNull;
4-
53
public interface IMercadoPagoService {
64

7-
String generateQRCode(@NotNull Long id, @NotNull Double transactionAmount);
5+
String generateQRCode(Long id, Double transactionAmount);
86

97
}

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/order/IOrderUseCase.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import br.com.grupo63.techchallenge.core.application.usecase.exception.NotFoundException;
66
import br.com.grupo63.techchallenge.core.application.usecase.exception.ValidationException;
77
import br.com.grupo63.techchallenge.core.domain.model.order.OrderStatus;
8-
import jakarta.validation.constraints.NotNull;
98

109
import java.util.List;
1110

1211
public interface IOrderUseCase extends ICRUDUseCase<OrderDTO> {
1312

14-
OrderStatus advanceStatus(@NotNull Long orderId) throws NotFoundException, ValidationException;
13+
OrderStatus advanceStatus(Long orderId) throws NotFoundException, ValidationException;
1514

1615
List<OrderDTO> listUnfinishedOrders();
1716

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/order/OrderUseCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private void fillCurrentPrices(Order order) throws NotFoundException {
4343
}
4444

4545
@Override
46-
public OrderStatus advanceStatus(@NotNull Long orderId) throws NotFoundException, ValidationException {
46+
public OrderStatus advanceStatus(Long orderId) throws NotFoundException, ValidationException {
4747
Order order = orderRepository.findByIdAndDeletedFalse(orderId).orElseThrow(NotFoundException::new);
4848

4949
if (order.getPayment() == null || order.getPayment().getStatus() != PaymentStatus.PAID) {

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/payment/IPaymentUseCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
public interface IPaymentUseCase {
99

10-
String startPayment(@NotNull Long orderId) throws NotFoundException, ValidationException;
10+
String startPayment(Long orderId) throws NotFoundException, ValidationException;
1111

12-
void finishPayment(@NotNull Long orderId) throws ValidationException, NotFoundException;
12+
void finishPayment(Long orderId) throws ValidationException, NotFoundException;
1313

14-
PaymentStatus getPaymentStatus(@NotNull Long orderId) throws NotFoundException, ValidationException;
14+
PaymentStatus getPaymentStatus(Long orderId) throws NotFoundException, ValidationException;
1515

1616
}

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/payment/PaymentUseCase.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class PaymentUseCase implements IPaymentUseCase {
2020
private final OrderUseCase orderUseCase;
2121

2222
@Override
23-
public String startPayment(@NotNull(message = "payment.order.id.notNull") Long orderId) throws NotFoundException, ValidationException {
23+
public String startPayment(Long orderId) throws NotFoundException, ValidationException {
2424
OrderDTO orderDTO = orderUseCase.read(orderId);
2525

2626
if (orderDTO.getStatus() != null) {
@@ -37,7 +37,7 @@ public String startPayment(@NotNull(message = "payment.order.id.notNull") Long o
3737
}
3838

3939
@Override
40-
public void finishPayment(@NotNull(message = "payment.order.id.notNull") Long orderId) throws ValidationException, NotFoundException {
40+
public void finishPayment(Long orderId) throws ValidationException, NotFoundException {
4141
OrderDTO orderDTO = orderUseCase.read(orderId);
4242

4343
if (orderDTO.getPayment() == null) {
@@ -53,7 +53,7 @@ public void finishPayment(@NotNull(message = "payment.order.id.notNull") Long or
5353
}
5454

5555
@Override
56-
public PaymentStatus getPaymentStatus(@NotNull Long orderId) throws NotFoundException, ValidationException {
56+
public PaymentStatus getPaymentStatus(Long orderId) throws NotFoundException, ValidationException {
5757
OrderDTO orderDTO = orderUseCase.read(orderId);
5858

5959
if (orderDTO.getPayment() == null) {

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/product/IProductUseCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
public interface IProductUseCase extends ICRUDUseCase<ProductDTO> {
1010

11-
List<ProductDTO> listByCategoryName(@NotNull String categoryName);
11+
List<ProductDTO> listByCategoryName(String categoryName);
1212

1313
}

techchallenge/src/main/java/br/com/grupo63/techchallenge/core/application/usecase/product/ProductUseCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public void delete(Long id) throws NotFoundException {
5454
repository.saveAndFlush(product);
5555
}
5656

57-
public List<ProductDTO> listByCategoryName(@NotNull String categoryName) {
57+
public List<ProductDTO> listByCategoryName(String categoryName) {
5858
return repository.findByDeletedFalseAndCategory_Name(categoryName).stream().map(ProductDTO::toDto).toList();
5959
}
6060
}

0 commit comments

Comments
 (0)