Moved changes from develop to feature1

This commit is contained in:
Lincpay Tech
2025-11-13 22:09:28 +05:30
parent dad3548f3a
commit 71b4b0b9ab
10 changed files with 275 additions and 5 deletions
@@ -6,6 +6,8 @@ import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
@@ -22,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.ViewComplainByIdResponse;
import com.billpaymentservice.bbps.entites.AdditionalInfoPlans;
import com.billpaymentservice.bbps.entites.AmountOptionByBillerId;
import com.billpaymentservice.bbps.entites.AmountOptionDetails;
@@ -29,7 +32,9 @@ import com.billpaymentservice.bbps.entites.BillerCategoryIcon;
import com.billpaymentservice.bbps.entites.BillerCategoryWise;
import com.billpaymentservice.bbps.entites.CategoryResponseList;
import com.billpaymentservice.bbps.entites.ComplainStatus;
import com.billpaymentservice.bbps.entites.ComplaintDetails;
import com.billpaymentservice.bbps.entites.ComplaintHistory;
import com.billpaymentservice.bbps.entites.ComplaintStatusDetails;
import com.billpaymentservice.bbps.entites.CustomerParamGroupById;
import com.billpaymentservice.bbps.entites.GroupParam;
import com.billpaymentservice.bbps.entites.Plan;
@@ -46,6 +51,7 @@ import com.billpaymentservice.bbps.repository.CustomerParamGroupByBillerIdReposi
import com.billpaymentservice.bbps.repository.FetchBillValidateRepository;
import com.billpaymentservice.bbps.repository.PlanResponseRepository;
import com.billpaymentservice.bbps.repository.ReOpenComplaintRepository;
import com.billpaymentservice.bbps.repository.ComplainDetailRepository;
import com.billpaymentservice.bbps.serviceImpl.AgentServiceImpl;
@Component
@@ -62,6 +68,8 @@ public class BillerMapperHelper {
private final ComplaintStatusRepository complaintStatusRepository;
private final ReOpenComplaintRepository reOpenComplaintRepository;
private final ComplaintHistoryRepository complaintHistoryRepository;
private final ComplainDetailRepository complainDetailRepository;
public BillerMapperHelper(BillerCategoryWiseRepository billerRepo,
CustomerParamGroupByBillerIdRepository customerParamGroupByBillerIdRepo,
@@ -70,7 +78,8 @@ public class BillerMapperHelper {
CategoryResponseListRepository categoryResponseListRepository,
FetchBillValidateRepository fetchBillValidateRepository,
ComplaintStatusRepository complaintStatusRepository, ReOpenComplaintRepository reOpenComplaintRepository,
ComplaintHistoryRepository complaintHistoryRepository) {
ComplaintHistoryRepository complaintHistoryRepository,
ComplainDetailRepository complainDetailRepository) {
this.billerRepo = billerRepo;
this.customerParamGroupByBillerIdRepo = customerParamGroupByBillerIdRepo;
this.amountOptionByBillerIdRepository = amountOptionByBillerIdRepository;
@@ -80,6 +89,7 @@ public class BillerMapperHelper {
this.complaintStatusRepository = complaintStatusRepository;
this.reOpenComplaintRepository = reOpenComplaintRepository;
this.complaintHistoryRepository = complaintHistoryRepository;
this.complainDetailRepository = complainDetailRepository;
}
/**
@@ -534,4 +544,31 @@ public class BillerMapperHelper {
}
}
public String saveComplainStatusDetail(ViewComplainByIdResponse 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";
}
}