Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavofg1pontes committed Oct 7, 2024
1 parent 2e51036 commit 0961627
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,4 @@ public class MercadoPagoConfiguration {
public void initialize() {
MercadoPagoConfig.setAccessToken(mercadoPagoAccessToken);
}

@Bean
public PaymentService paymentService() {
System.out.println("AAAAAAAAAAAAAAAAAAAA: " + this.mercadoPagoAccessToken);
return PaymentServiceFactory.create(ticketGateway, ticketSaleGateway, paymentGateway);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ public Optional<TicketSale> findById(TicketSaleID id) {

@Override
public Pagination<TicketSale> findAllByEventID(EventID id, SearchQuery sq) {
return null;
}
final PageRequest request = PageRequest.of(
sq.page(),
sq.perPage(),
Sort.by(Sort.Direction.fromString(sq.direction()), sq.sort())
);

final Page<TicketSale> page = this.repository.findAllByEventId(id.getValue(), request).map(TicketSaleJpaEntity::toAggregate);

return Pagination.of(
page.getNumber(),
page.getSize(),
page.getTotalElements(),
page.getContent()
);
}

@Override
public TicketSale update(TicketSale ticketSale) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package br.com.ifsp.tickets.infra.contexts.event.sale.ticket.persistence;


import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.UUID;

public interface TicketSaleRepository extends JpaRepository<TicketSaleJpaEntity, UUID> {
Page<TicketSaleJpaEntity> findAllByEventId(UUID eventID, Pageable pageable);
}

0 comments on commit 0961627

Please sign in to comment.