Search in sources :

Example 11 with MiraklGetShopsRequest

use of com.mirakl.client.mmp.request.shop.MiraklGetShopsRequest in project mirakl-hyperwallet-connector by paypal.

the class MiraklSellersExtractServiceImpl method retrieveMiraklShopsByShopIds.

private MiraklShops retrieveMiraklShopsByShopIds(final List<String> shopIds) {
    final MiraklGetShopsRequest request = new MiraklGetShopsRequest();
    request.setShopIds(shopIds);
    request.setPaginate(false);
    log.info("Retrieving shops with ids {}", shopIds);
    try {
        return miraklOperatorClient.getShops(request);
    } catch (final MiraklApiException ex) {
        log.error("Something went wrong getting s information with ids [{}]", shopIds);
        sellerMailNotificationUtil.sendPlainTextEmail(EMAIL_SUBJECT_MESSAGE, String.format(ERROR_MESSAGE_PREFIX + "Something went wrong getting shop information with ids [%s]%n%s", shopIds, MiraklLoggingErrorsUtil.stringify(ex)));
        return new MiraklShops();
    }
}
Also used : MiraklGetShopsRequest(com.mirakl.client.mmp.request.shop.MiraklGetShopsRequest) MiraklApiException(com.mirakl.client.core.exception.MiraklApiException) MiraklShops(com.mirakl.client.mmp.domain.shop.MiraklShops)

Example 12 with MiraklGetShopsRequest

use of com.mirakl.client.mmp.request.shop.MiraklGetShopsRequest in project mirakl-hyperwallet-connector by paypal.

the class MiraklSellersExtractServiceImpl method retrieveMiraklShopsByDate.

private MiraklShops retrieveMiraklShopsByDate(@Nullable final Date delta) {
    final MiraklGetShopsRequest request = new MiraklGetShopsRequest();
    request.setUpdatedSince(delta);
    request.setPaginate(false);
    log.info("Retrieving shops since {}", delta);
    try {
        return miraklOperatorClient.getShops(request);
    } catch (final MiraklApiException ex) {
        log.error("Something went wrong getting shop information since [{}]", delta);
        sellerMailNotificationUtil.sendPlainTextEmail(EMAIL_SUBJECT_MESSAGE, String.format(ERROR_MESSAGE_PREFIX + "Something went wrong getting shop information since [%s]%n%s", delta, MiraklLoggingErrorsUtil.stringify(ex)));
        return new MiraklShops();
    }
}
Also used : MiraklGetShopsRequest(com.mirakl.client.mmp.request.shop.MiraklGetShopsRequest) MiraklApiException(com.mirakl.client.core.exception.MiraklApiException) MiraklShops(com.mirakl.client.mmp.domain.shop.MiraklShops)

Aggregations

MiraklGetShopsRequest (com.mirakl.client.mmp.request.shop.MiraklGetShopsRequest)12 MiraklShops (com.mirakl.client.mmp.domain.shop.MiraklShops)7 MiraklShop (com.mirakl.client.mmp.domain.shop.MiraklShop)4 MiraklException (com.mirakl.client.core.exception.MiraklException)3 MiraklMarketplacePlatformOperatorApiClient (com.mirakl.client.mmp.operator.core.MiraklMarketplacePlatformOperatorApiClient)3 MiraklUpdateShop (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdateShop)3 MiraklUpdatedShopReturn (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdatedShopReturn)3 MiraklUpdatedShops (com.mirakl.client.mmp.operator.domain.shop.update.MiraklUpdatedShops)3 MiraklUpdateShopsRequest (com.mirakl.client.mmp.operator.request.shop.MiraklUpdateShopsRequest)3 MiraklRequestAdditionalFieldValue (com.mirakl.client.mmp.request.additionalfield.MiraklRequestAdditionalFieldValue)3 Converter (com.paypal.infrastructure.converter.Converter)3 MailNotificationUtil (com.paypal.infrastructure.mail.MailNotificationUtil)3 LoggingConstantsUtil (com.paypal.infrastructure.util.LoggingConstantsUtil)3 MiraklLoggingErrorsUtil (com.paypal.infrastructure.util.MiraklLoggingErrorsUtil)3 KYCConstants (com.paypal.kyc.model.KYCConstants)3 KYCDocumentInfoModel (com.paypal.kyc.model.KYCDocumentInfoModel)3 java.util (java.util)3 Predicate (java.util.function.Predicate)3 Collectors (java.util.stream.Collectors)3 Stream (java.util.stream.Stream)3