cretaed entities for BillerDetail

This commit is contained in:
himanshu
2025-10-31 10:10:43 +05:30
parent 65cd50567d
commit 6ec6847ad2
31 changed files with 413 additions and 61 deletions
@@ -6,6 +6,8 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.modelmapper.ModelMapper;
import org.modelmapper.convention.MatchingStrategies;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,7 +15,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import com.billpaymentservice.bbps.dto.BillerDAO;
import com.billpaymentservice.bbps.dto.BillerDTO;
import com.billpaymentservice.bbps.dto.GeneralResp;
import com.billpaymentservice.bbps.dto.MasterApiResponse;
import com.billpaymentservice.bbps.dto.ResponseModel;
@@ -28,6 +30,8 @@ import com.billpaymentservice.bbps.dto.response.CategoryResponse;
import com.billpaymentservice.bbps.dto.response.ContactMasterResponse;
import com.billpaymentservice.bbps.dto.response.CustomParamResp;
import com.billpaymentservice.bbps.entites.BBPSMerchantValidation;
import com.billpaymentservice.bbps.entites.BillPayment;
import com.billpaymentservice.bbps.entites.BillerDetails;
import com.billpaymentservice.bbps.exception.AppException;
import com.billpaymentservice.bbps.exception.CustomException;
import com.billpaymentservice.bbps.repository.BillerDataRepository;
@@ -99,16 +103,21 @@ public class MasterDataServiceImpl implements MasterDataService {
}
BillerDataResponse responseWrapper = objectMapper.convertValue(dataMap, BillerDataResponse.class);
GeneralResp generalResp = responseWrapper.getGeneralResp();
BillerDAO biller = responseWrapper.getBillerDAO();
ModelMapper mapper = new ModelMapper();
mapper.getConfiguration().setMatchingStrategy(MatchingStrategies.STRICT);
BillerDetails entity = mapper.map(responseWrapper.getBillerDAO(), BillerDetails.class);
if (biller != null) {
LOGGER.info("Saving biller {} to database...", biller.getBillerId());
billerDataRespository.save(biller);
} else {
LOGGER.warn("No biller found in response to save.");
}
System.out.println(entity);
if (entity != null)
{
billerDataRespository.save(entity);
}
else {
LOGGER.warn("No biller found in response to save.");
}
ResponseModel responseModel=new ResponseModel( generalResp.getMessage(),