// start leave feedbacks
SellingManagerSoldTransactionType[] soldTrans = item.getSellingManagerSoldTransaction();
if (UtilValidate.isNotEmpty(soldTrans)) {
for (SellingManagerSoldTransactionType soldTran : soldTrans) {
LeaveFeedbackCall leaveFeedbackCall = new LeaveFeedbackCall(apiContext);
FeedbackDetailType detail = new FeedbackDetailType();
// ramdom comments
if (list.size() > 0) {
Collections.shuffle(list, new Random());
comment = list.get(0);
}
detail.setCommentText(comment);
detail.setCommentingUser(commentingUser);
//detail.setCommentingUserScore(value);
detail.setCommentType(CommentTypeCodeType.POSITIVE);
detail.setItemID(soldTran.getItemID());
detail.setItemPrice(soldTran.getItemPrice());
detail.setItemTitle(soldTran.getItemTitle());
leaveFeedbackCall.setFeedbackDetail(detail);
leaveFeedbackCall.setTargetUser(item.getBuyerID());
leaveFeedbackCall.setTransactionID(String.valueOf(soldTran.getTransactionID()));
leaveFeedbackCall.leaveFeedback();
Debug.logInfo("Auto leave feedback with site ".concat(apiContext.getSite().value()).concat("itemId ".concat(soldTran.getItemID())).concat(" comment is ".concat(comment)), module);