Skip to content

Commit

Permalink
API issues resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
appuser committed Mar 15, 2024
1 parent 52138a8 commit e894079
Show file tree
Hide file tree
Showing 37 changed files with 167 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.reflect.TypeToken;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
Expand Down Expand Up @@ -607,8 +608,7 @@ public String createIdentity(@Param(value = "{\r\n" + " \"eventTypeName\": \"St
if (json instanceof JsonNull || json instanceof JsonPrimitive) {
return getErrorResponseString("Null/Empty Identity Create Data.", 200, "success", "");
}

IdentityDTO identity = InputMapper.getInstance().gson().fromJson(json, IdentityDTO.class);
IdentityDTO identity = new Gson().fromJson(json, IdentityDTO.class);
logger.info("identity hit: " + identity);
BeneficiaryCreateResp map;
map = svc.createIdentity(identity);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
@Data
public class RMNCHBornBirthDetails {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose
@Column(name = "BornBirthDeatilsId", insertable = false, updatable = false)
private Long bornBirthDeatilsId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@Data
public class RMNCHCBACdetails {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose
@Column(name = "CBACDetailsid", insertable = false, updatable = false)
private Long cBACDetailsid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
public class RMNCHHouseHoldDetails {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Expose
@Column(name = "houseHoldDetailsId", insertable = false, updatable = false)
private Long houseHoldDetailsId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Data
public class RMNCHMBeneficiaryAccount {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BenAccountID")
private BigInteger benAccountID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@Data
public class RMNCHMBeneficiaryImage {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BenImageId")
private BigInteger benImageId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Data
public class RMNCHMBeneficiaryServiceMap {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benServiceMapID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RMNCHMBeneficiaryaddress implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benAddressID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RMNCHMBeneficiaryconsent implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benConsentID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class RMNCHMBeneficiarycontact implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benContactsID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@Data
public class RMNCHMBeneficiarydetail {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger beneficiaryDetailsId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RMNCHMBeneficiaryfamilymapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benFamilyMapId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class RMNCHMBeneficiarymapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benMapId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Data
public class RMNCHMBeneficiaryregidmapping {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private Long benRegId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@Data
public class MBeneficiaryAccount {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BenAccountID")
private BigInteger benAccountID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@Data
public class MBeneficiaryImage {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BenImageId")
private Long benImageId;
@Column(name = "BenImage")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MBeneficiaryaddress implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benAddressID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MBeneficiaryconsent implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benConsentID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class MBeneficiarycontact implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benContactsID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class MBeneficiarydetail implements Serializable {
private static final int ND_INT = 3;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger beneficiaryDetailsId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class MBeneficiaryfamilymapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benFamilyMapId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MBeneficiaryidentity implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benIdentityId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class MBeneficiarymapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benMapId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MBeneficiaryregidmapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benRegId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class MBeneficiaryservicemapping implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger benServiceMapID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class TBendataaccess implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private BigInteger accessId;

Expand Down
105 changes: 2 additions & 103 deletions src/main/java/com/iemr/common/identity/mapper/IdentityMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,86 +63,7 @@ public interface IdentityMapper {

MBeneficiarymapping identityDTOToMBeneficiarymapping(IdentityDTO dto);

@Mapping(source = "dto.currentAddress.addrLine1", target = "currAddrLine1")
@Mapping(source = "dto.currentAddress.addrLine2", target = "currAddrLine2")
@Mapping(source = "dto.currentAddress.addrLine3", target = "currAddrLine3")
@Mapping(source = "dto.currentAddress.countryId", target = "currCountryId")
@Mapping(source = "dto.currentAddress.country", target = "currCountry")
@Mapping(source = "dto.currentAddress.stateId", target = "currStateId")
@Mapping(source = "dto.currentAddress.state", target = "currState")
@Mapping(source = "dto.currentAddress.districtId", target = "currDistrictId")
@Mapping(source = "dto.currentAddress.district", target = "currDistrict")
@Mapping(source = "dto.currentAddress.subDistrictId", target = "currSubDistrictId")
@Mapping(source = "dto.currentAddress.subDistrict", target = "currSubDistrict")
@Mapping(source = "dto.currentAddress.villageId", target = "currVillageId")
@Mapping(source = "dto.currentAddress.village", target = "currVillage")
@Mapping(source = "dto.currentAddress.addressValue", target = "currAddressValue")
@Mapping(source = "dto.currentAddress.pinCode", target = "currPinCode")
@Mapping(source = "dto.emergencyAddress.addrLine1", target = "emerAddrLine1")
@Mapping(source = "dto.emergencyAddress.addrLine2", target = "emerAddrLine2")
@Mapping(source = "dto.emergencyAddress.addrLine3", target = "emerAddrLine3")
@Mapping(source = "dto.emergencyAddress.countryId", target = "emerCountryId")
@Mapping(source = "dto.emergencyAddress.country", target = "emerCountry")
@Mapping(source = "dto.emergencyAddress.stateId", target = "emerStateId")
@Mapping(source = "dto.emergencyAddress.state", target = "emerState")
@Mapping(source = "dto.emergencyAddress.districtId", target = "emerDistrictId")
@Mapping(source = "dto.emergencyAddress.district", target = "emerDistrict")
@Mapping(source = "dto.emergencyAddress.subDistrictId", target = "emerSubDistrictId")
@Mapping(source = "dto.emergencyAddress.subDistrict", target = "emerSubDistrict")
@Mapping(source = "dto.emergencyAddress.villageId", target = "emerVillageId")
@Mapping(source = "dto.emergencyAddress.village", target = "emerVillage")
@Mapping(source = "dto.emergencyAddress.addressValue", target = "emerAddressValue")
@Mapping(source = "dto.emergencyAddress.pinCode", target = "emerPinCode")
@Mapping(source = "dto.permanentAddress.addrLine1", target = "permAddrLine1")
@Mapping(source = "dto.permanentAddress.addrLine2", target = "permAddrLine2")
@Mapping(source = "dto.permanentAddress.addrLine3", target = "permAddrLine3")
@Mapping(source = "dto.permanentAddress.countryId", target = "permCountryId")
@Mapping(source = "dto.permanentAddress.country", target = "permCountry")
@Mapping(source = "dto.permanentAddress.stateId", target = "permStateId")
@Mapping(source = "dto.permanentAddress.state", target = "permState")
@Mapping(source = "dto.permanentAddress.districtId", target = "permDistrictId")
@Mapping(source = "dto.permanentAddress.district", target = "permDistrict")
@Mapping(source = "dto.permanentAddress.subDistrictId", target = "permSubDistrictId")
@Mapping(source = "dto.permanentAddress.subDistrict", target = "permSubDistrict")
@Mapping(source = "dto.permanentAddress.villageId", target = "permVillageId")
@Mapping(source = "dto.permanentAddress.village", target = "permVillage")
@Mapping(source = "dto.permanentAddress.addressValue", target = "permAddressValue")
@Mapping(source = "dto.permanentAddress.pinCode", target = "permPinCode")
@Mapping(source = "dto.agentName", target = "createdBy")
// @Mapping(source = "dto.eventTypeDate", target = "createdDate")
@Mapping(source = "dto.createdDate", target = "createdDate")

/*
* New columns added for MMU integration 09-04-2018
*/
@Mapping(source = "dto.permanentAddress.zoneID", target = "permZoneID")
@Mapping(source = "dto.permanentAddress.zoneName", target = "permZone")
@Mapping(source = "dto.permanentAddress.parkingPlaceID", target = "permAreaId")
@Mapping(source = "dto.permanentAddress.parkingPlaceName", target = "permArea")
@Mapping(source = "dto.permanentAddress.servicePointID", target = "permServicePointId")
@Mapping(source = "dto.permanentAddress.servicePointName", target = "permServicePoint")
@Mapping(source = "dto.permanentAddress.habitation", target = "permHabitation")

@Mapping(source = "dto.currentAddress.zoneID", target = "currZoneID")
@Mapping(source = "dto.currentAddress.zoneName", target = "currZone")
@Mapping(source = "dto.currentAddress.parkingPlaceID", target = "currAreaId")
@Mapping(source = "dto.currentAddress.parkingPlaceName", target = "currArea")
@Mapping(source = "dto.currentAddress.servicePointID", target = "currServicePointId")
@Mapping(source = "dto.currentAddress.servicePointName", target = "currServicePoint")
@Mapping(source = "dto.currentAddress.habitation", target = "currHabitation")

@Mapping(source = "dto.emergencyAddress.zoneID", target = "emerZoneID")
@Mapping(source = "dto.emergencyAddress.zoneName", target = "emerZone")
@Mapping(source = "dto.emergencyAddress.parkingPlaceID", target = "emerAreaId")
@Mapping(source = "dto.emergencyAddress.parkingPlaceName", target = "emerArea")
@Mapping(source = "dto.emergencyAddress.servicePointID", target = "emerServicePointId")
@Mapping(source = "dto.emergencyAddress.servicePointName", target = "emerServicePoint")
@Mapping(source = "dto.emergencyAddress.habitation", target = "emerHabitation")

@Mapping(source = "dto.vanID", target = "vanID")
@Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID")

MBeneficiaryaddress identityDTOToMBeneficiaryaddress(IdentityDTO dto);


@Mapping(source = "defaultNo", target = "shareAnonymousWithGovt")
@Mapping(source = "defaultNo", target = "shareAnonymousWithMedicalCommunity")
Expand All @@ -169,29 +90,7 @@ public interface IdentityMapper {

MBeneficiaryconsent identityDTOToDefaultMBeneficiaryconsent(IdentityDTO dto, Boolean defaultYes, Boolean defaultNo);

@Mapping(source = "dto.contact.preferredPhoneNum", target = "preferredPhoneNum")
@Mapping(source = "dto.contact.preferredPhoneTyp", target = "preferredPhoneTyp")
@Mapping(source = "dto.contact.preferredSMSPhoneNum", target = "preferredSMSPhoneNum")
@Mapping(source = "dto.contact.preferredSMSPhoneTyp", target = "preferredSMSPhoneTyp")
@Mapping(source = "dto.contact.emergencyContactNum", target = "emergencyContactNum")
@Mapping(source = "dto.contact.phoneNum1", target = "phoneNum1")
@Mapping(source = "dto.contact.phoneTyp1", target = "phoneTyp1")
@Mapping(source = "dto.contact.phoneNum2", target = "phoneNum2")
@Mapping(source = "dto.contact.phoneTyp2", target = "phoneTyp2")
@Mapping(source = "dto.contact.phoneNum3", target = "phoneNum3")
@Mapping(source = "dto.contact.phoneTyp3", target = "phoneTyp3")
@Mapping(source = "dto.contact.phoneNum4", target = "phoneNum4")
@Mapping(source = "dto.contact.phoneTyp4", target = "phoneTyp4")
@Mapping(source = "dto.contact.phoneNum5", target = "phoneNum5")
@Mapping(source = "dto.contact.phoneTyp5", target = "phoneTyp5")
@Mapping(source = "dto.preferredEmailId", target = "emailId")
@Mapping(source = "dto.agentName", target = "createdBy")
@Mapping(source = "dto.createdDate", target = "createdDate")

@Mapping(source = "dto.vanID", target = "vanID")
@Mapping(source = "dto.parkingPlaceId", target = "parkingPlaceID")

MBeneficiarycontact identityDTOToMBeneficiarycontact(IdentityDTO dto);


@Mapping(source = "dto.areaId", target = "areaId")
@Mapping(source = "dto.beneficiaryRegId", target = "beneficiaryRegID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import com.iemr.common.identity.domain.MBeneficiaryAccount;

public interface MBeneficiaryAccountRepo extends CrudRepository<MBeneficiaryAccount, Long> {
public interface MBeneficiaryAccountRepo extends CrudRepository<MBeneficiaryAccount, BigInteger> {
@Transactional
@Modifying
@Query(" UPDATE MBeneficiaryAccount set vanSerialNo = :benAccountID WHERE benAccountID = :benAccountID")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.iemr.common.identity.data.rmnch.RMNCHMBeneficiaryAccount;

@Repository
public interface RMNCHBenAccountRepo extends CrudRepository<RMNCHMBeneficiaryAccount, Long> {
public interface RMNCHBenAccountRepo extends CrudRepository<RMNCHMBeneficiaryAccount, BigInteger> {
@Query(" SELECT t FROM RMNCHMBeneficiaryAccount t WHERE t.id = :vanSerialNo AND t.VanID = :vanID")
public RMNCHMBeneficiaryAccount getByIdAndVanID(@Param("vanSerialNo") BigInteger vanSerialNo,
@Param("vanID") int vanID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import com.iemr.common.identity.data.rmnch.RMNCHMBeneficiaryaddress;

@Repository
public interface RMNCHBenAddressRepo extends JpaRepository<RMNCHMBeneficiaryaddress, Long> {
public interface RMNCHBenAddressRepo extends JpaRepository<RMNCHMBeneficiaryaddress, BigInteger> {
@Query(" SELECT t FROM RMNCHMBeneficiaryaddress t WHERE t.id = :vanSerialNo AND t.VanID = :vanID")
public RMNCHMBeneficiaryaddress getByIdAndVanID(@Param("vanSerialNo") BigInteger vanSerialNo,
@Param("vanID") int vanID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import com.iemr.common.identity.data.rmnch.RMNCHMBeneficiaryconsent;

@Repository
public interface RMNCHBenConsentRepo extends CrudRepository<RMNCHMBeneficiaryconsent, Long> {
public interface RMNCHBenConsentRepo extends CrudRepository<RMNCHMBeneficiaryconsent, BigInteger> {
@Query(" SELECT t FROM RMNCHMBeneficiaryconsent t WHERE t.id = :vanSerialNo AND t.VanID = :vanID")
public RMNCHMBeneficiaryconsent getByIdAndVanID(@Param("vanSerialNo") BigInteger vanSerialNo,
@Param("vanID") int vanID);
Expand Down
Loading

0 comments on commit e894079

Please sign in to comment.