class CmsPsuPisServiceInternal implements CmsPsuPisService {

    @Override
    public Optional<List<CmsPisPsuDataAuthorisation>> getPsuDataAuthorisations(@NotNull String paymentId, @NotNull String instanceId) {
        return commonPaymentDataService.getPisCommonPaymentData(paymentId, instanceId)
                   .map(p -> authorisationRepository.findAllByParentExternalIdAndTypeIn(paymentId, EnumSet.of(AuthorisationType.PIS_CREATION, AuthorisationType.PIS_CANCELLATION)))
                   .map(this::getPsuDataAuthorisations);
    }

}