saving for laptop restart

This commit is contained in:
Lincpay Tech
2025-11-14 16:00:25 +05:30
parent 3275b49397
commit 23050efbdc
12 changed files with 172 additions and 6 deletions
@@ -24,6 +24,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;
@@ -567,6 +568,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";
}