Add Payment-Service
This commit is contained in:
@@ -2,7 +2,6 @@ package com.food.order.system.payment.data.access.credithistory.adapter;
|
||||
|
||||
|
||||
import com.food.order.system.payment.application.service.ports.output.repository.CreditHistoryRepository;
|
||||
import com.food.order.system.payment.data.access.credithistory.entity.CreditHistoryEntity;
|
||||
import com.food.order.system.payment.data.access.credithistory.mapper.CreditHistoryDataAccessMapper;
|
||||
import com.food.order.system.payment.data.access.credithistory.repository.CreditHistoryJpaRepository;
|
||||
import com.food.order.system.payment.service.domain.entity.CreditHistory;
|
||||
@@ -11,7 +10,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class CreditHistoryRepositoryImpl implements CreditHistoryRepository {
|
||||
@@ -33,12 +31,11 @@ public class CreditHistoryRepositoryImpl implements CreditHistoryRepository {
|
||||
|
||||
@Override
|
||||
public Optional<List<CreditHistory>> findByCustomerId(CustomerId customerId) {
|
||||
Optional<List<CreditHistoryEntity>> creditHistory =
|
||||
creditHistoryJpaRepository.findByCustomerId(customerId.getValue());
|
||||
return creditHistory
|
||||
return creditHistoryJpaRepository.findByCustomerId(customerId.getValue())
|
||||
.map(creditHistoryList ->
|
||||
creditHistoryList.stream()
|
||||
.map(creditHistoryDataAccessMapper::creditHistoryEntityToCreditHistory)
|
||||
.collect(Collectors.toList()));
|
||||
.toList());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user