-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/add sequence to order request (#30)
* add sequence id to create request order return saveOrUpdate to CategoryOutputAdapter, ProductOutputAdapter to maintain idempotency improvements unit tests to 100% coverage pom referenced * add handler advice pre condition failed for DataIntegrityViolationException * remove active attr from category * remove active attr from product * add order dtos to response * add order dtos to response * move package mappers to infrastructure * add payment link rule to core/output adapter * review swagger properties --------- Co-authored-by: Myller Sakaguchi Lobo <myller.lobo@omni.com.br>
- Loading branch information
1 parent
27d865a
commit cce7fa6
Showing
80 changed files
with
586 additions
and
309 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
4 changes: 2 additions & 2 deletions
4
...e/persistence/mappers/CustomerMapper.java → ...nfrastructure/mappers/CustomerMapper.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
4 changes: 2 additions & 2 deletions
4
...sistence/mappers/OrderHistoricMapper.java → ...tructure/mappers/OrderHistoricMapper.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
4 changes: 2 additions & 2 deletions
4
.../persistence/mappers/OrderItemMapper.java → ...frastructure/mappers/OrderItemMapper.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
4 changes: 2 additions & 2 deletions
4
.../persistence/mappers/OrderListMapper.java → ...frastructure/mappers/OrderListMapper.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
6 changes: 3 additions & 3 deletions
6
...ture/persistence/mappers/OrderMapper.java → ...n/infrastructure/mappers/OrderMapper.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
4 changes: 2 additions & 2 deletions
4
...rsistence/mappers/ProductImageMapper.java → ...structure/mappers/ProductImageMapper.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
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
4 changes: 2 additions & 2 deletions
4
...cture/persistence/mappers/UserMapper.java → ...en/infrastructure/mappers/UserMapper.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
4 changes: 2 additions & 2 deletions
4
...istence/mappers/base/MapperConstants.java → ...ructure/mappers/base/MapperConstants.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
...ersistence/mappers/base/MapperEntity.java → ...astructure/mappers/base/MapperEntity.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
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
28 changes: 28 additions & 0 deletions
28
...ain/java/com/fiap/tc/adapters/driven/infrastructure/outputs/PaymentLinkOutputAdapter.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,28 @@ | ||
package com.fiap.tc.adapters.driven.infrastructure.outputs; | ||
|
||
import com.fiap.tc.adapters.driven.infrastructure.utils.QRCodeGenerator; | ||
import com.fiap.tc.core.application.ports.out.payment.PaymentLinkOutputPort; | ||
import com.fiap.tc.core.domain.entities.Order; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.Optional; | ||
|
||
import static com.fiap.tc.core.domain.constants.OrderConstants.PAYMENT_LINK_STATUS; | ||
|
||
@Service | ||
public class PaymentLinkOutputAdapter implements PaymentLinkOutputPort { | ||
|
||
private final QRCodeGenerator qrCodeGenerator; | ||
|
||
public PaymentLinkOutputAdapter(QRCodeGenerator qrCodeGenerator) { | ||
this.qrCodeGenerator = qrCodeGenerator; | ||
} | ||
|
||
@Override | ||
public Optional<String> generate(Order order) { | ||
if (PAYMENT_LINK_STATUS.contains(order.getStatus())) { | ||
return Optional.ofNullable(qrCodeGenerator.generate(order.orderWithTotalAsText())); | ||
} | ||
return Optional.empty(); | ||
} | ||
} |
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
Oops, something went wrong.