Code refinement
if (newPrimaryOfferId != null) {
if (restrictedPrimaryOffersForSelectionSO.getOfferIds().contains(newPrimaryOfferId)) {
PrimaryOfferCannotSelectSOException ex = PrimaryOfferCannotSelectSOException.builder()
.offeringName(offerResponse.getPrimaryOffering().getOfferingName())
.build();
log.error("ActionLog.getMsisdnDetails.error ex", ex);
throw ex;
}
} else {
if (restrictedPrimaryOffersForSelectionSO.getOfferIds().contains(primaryOfferId)) {
PrimaryOfferCannotSelectSOException ex = PrimaryOfferCannotSelectSOException.builder()
.offeringName(offerResponse.getPrimaryOffering().getOfferingName())
.build();
log.error("ActionLog.getMsisdnDetails.error ex", ex);
throw ex;
}
}
offersInfos = mnoProductClient.getOfferListByTypeForSalesApp("az", ProviderTypes.Azerfon.getKey(),
OfferType.SO).getData();
to this:
if (newPrimaryOfferId != null && restrictedPrimaryOffersForSelectionSO.getOfferIds().contains(newPrimaryOfferId)
|| newPrimaryOfferId == null && restrictedPrimaryOffersForSelectionSO.getOfferIds().contains(primaryOfferId)) {
throw PrimaryOfferCannotSelectSOException.builder()
.offeringName(offerResponse.getPrimaryOffering().getOfferingName())
.build();
}
offersInfos = mnoProductClient.getOfferListByTypeForSalesApp("az", ProviderTypes.Azerfon.getKey(),
OfferType.SO).getData();
Комментарии
Отправить комментарий