merged code with feature1
This commit is contained in:
@@ -26,6 +26,7 @@ import com.billpaymentservice.bbps.dto.response.AmountOptionsResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ComplaintHistoryStatusResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ComplaintStatusResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.PlanResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ViewAllComplaintsResponse;
|
||||
import com.billpaymentservice.bbps.dto.response.ViewComplainByIdResponse;
|
||||
import com.billpaymentservice.bbps.entites.AdditionalInfoPlans;
|
||||
import com.billpaymentservice.bbps.entites.AmountOptionByBillerId;
|
||||
@@ -654,6 +655,29 @@ public class BillerMapperHelper {
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
public String saveAllComplaints(ViewAllComplaintsResponse responseWrapper, String reqId, String txnId) {
|
||||
|
||||
ModelMapper mapper = new ModelMapper();
|
||||
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
|
||||
|
||||
// Map list → ComplaintStatusDetails list
|
||||
List<ComplaintStatusDetails> entityList = responseWrapper.getComplaintsList()
|
||||
.stream()
|
||||
.map(c -> mapper.map(c, ComplaintStatusDetails.class))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// Set extra fields
|
||||
for (ComplaintStatusDetails entity : entityList) {
|
||||
entity.setReqId(reqId);
|
||||
entity.setTxnId(txnId);
|
||||
}
|
||||
|
||||
// Save to repository
|
||||
complainDetailRepository.saveAll(entityList);
|
||||
|
||||
return "SUCCESS";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user