Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed update uin issue. #953

Merged
merged 121 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
f45c455
Fixed service history issue.
kameshsr Dec 13, 2022
3b8f2d0
Merge branch 'mosip:develop' into develop
kameshsr Dec 13, 2022
fbe3949
Merge branch 'mosip:develop' into develop
kameshsr Dec 14, 2022
be6e0fc
Merge branch 'mosip:develop' into develop
kameshsr Dec 15, 2022
f08b625
Merge branch 'mosip:develop' into develop
kameshsr Dec 16, 2022
35e6916
Merge branch 'mosip:develop' into develop
kameshsr Dec 19, 2022
d6af139
Merge branch 'mosip:develop' into develop
kameshsr Dec 19, 2022
9049410
Merge branch 'mosip:develop' into develop
kameshsr Dec 19, 2022
0048dac
Merge branch 'mosip:develop' into develop
kameshsr Dec 19, 2022
fd98ca7
Merge branch 'mosip:develop' into develop
kameshsr Dec 21, 2022
ec18f7a
Merge branch 'mosip:develop' into develop
kameshsr Dec 21, 2022
0fe62aa
Merge branch 'mosip:develop' into develop
kameshsr Dec 26, 2022
5dc32e7
Merge branch 'mosip:develop' into develop
kameshsr Dec 26, 2022
b2f03c2
Merge branch 'mosip:develop' into develop
kameshsr Dec 27, 2022
c87620f
Merge branch 'mosip:develop' into develop
kameshsr Dec 27, 2022
775c495
Merge branch 'mosip:develop' into develop
kameshsr Dec 27, 2022
81827c7
Merge branch 'mosip:develop' into develop
kameshsr Dec 29, 2022
c7f3475
Merge branch 'mosip:develop' into develop
kameshsr Dec 29, 2022
8a2d271
Merge branch 'mosip:develop' into develop
kameshsr Dec 30, 2022
b083a68
Merge branch 'mosip:develop' into develop
kameshsr Jan 2, 2023
1a21f69
Merge branch 'mosip:develop' into develop
kameshsr Jan 3, 2023
60b9a9a
Merge branch 'mosip:develop' into develop
kameshsr Jan 4, 2023
3af851b
Merge branch 'mosip:develop' into develop
kameshsr Jan 4, 2023
4dfad5a
Merge branch 'mosip:develop' into develop
kameshsr Jan 5, 2023
ceebe29
Merge branch 'mosip:develop' into develop
kameshsr Jan 6, 2023
31da1b5
Merge branch 'mosip:develop' into develop
kameshsr Jan 10, 2023
6fa308f
Merge branch 'mosip:develop' into develop
kameshsr Jan 10, 2023
cae3228
Merge branch 'mosip:develop' into develop
kameshsr Jan 11, 2023
c79f019
Merge branch 'mosip:develop' into develop
kameshsr Jan 11, 2023
75e48f4
Merge branch 'mosip:develop' into develop
kameshsr Jan 12, 2023
bbeb086
Merge branch 'mosip:develop' into develop
kameshsr Jan 12, 2023
2b9772e
Merge branch 'mosip:develop' into develop
kameshsr Jan 13, 2023
6d481bf
Merge branch 'mosip:develop' into develop
kameshsr Jan 13, 2023
a08892d
Merge branch 'mosip:develop' into develop
kameshsr Jan 13, 2023
c6a003c
Merge branch 'mosip:develop' into develop
kameshsr Jan 16, 2023
782164a
Merge branch 'mosip:develop' into develop
kameshsr Jan 16, 2023
5cae9d7
Merge branch 'mosip:develop' into develop
kameshsr Jan 17, 2023
b7349bd
Merge branch 'mosip:develop' into develop
kameshsr Jan 18, 2023
ce66191
Merge branch 'mosip:develop' into develop
kameshsr Jan 18, 2023
58c6c84
Merge branch 'mosip:develop' into develop
kameshsr Jan 19, 2023
681f8a4
Merge branch 'mosip:develop' into develop
kameshsr Jan 23, 2023
51dfb66
Merge branch 'mosip:develop' into develop
kameshsr Jan 25, 2023
9297c9d
Merge branch 'mosip:develop' into develop
kameshsr Jan 30, 2023
45cf2f9
Merge branch 'mosip:develop' into develop
kameshsr Jan 30, 2023
ed83d52
Merge branch 'mosip:develop' into develop
kameshsr Jan 31, 2023
dca2de7
Merge branch 'mosip:develop' into develop
kameshsr Feb 1, 2023
a608cd2
Merge branch 'mosip:develop' into develop
kameshsr Feb 1, 2023
d39d656
Merge branch 'mosip:develop' into develop
kameshsr Feb 8, 2023
e993e5d
Merge branch 'mosip:develop' into develop
kameshsr Feb 9, 2023
7e2b68a
Merge branch 'mosip:develop' into develop
kameshsr Feb 14, 2023
71f50e7
Merge branch 'mosip:develop' into develop
kameshsr Feb 15, 2023
00af4f6
Merge branch 'mosip:develop' into develop
kameshsr Feb 16, 2023
a7558c9
Merge branch 'mosip:develop' into develop
kameshsr Feb 16, 2023
0bcbe76
Merge branch 'mosip:develop' into develop
kameshsr Feb 17, 2023
f230f13
Merge branch 'mosip:develop' into develop
kameshsr Feb 17, 2023
8499fc5
Merge branch 'mosip:develop' into develop
kameshsr Feb 22, 2023
1e0f0d6
Merge branch 'mosip:develop' into develop
kameshsr Feb 22, 2023
d2eecba
Merge branch 'mosip:develop' into develop
kameshsr Feb 22, 2023
dc345f7
Merge branch 'mosip:develop' into develop
kameshsr Feb 24, 2023
3341cc7
Merge branch 'mosip:develop' into develop
kameshsr Feb 27, 2023
38c95a7
Merge branch 'mosip:develop' into develop
kameshsr Feb 27, 2023
2383df4
Merge branch 'mosip:develop' into develop
kameshsr Mar 2, 2023
f8394e4
Merge branch 'mosip:develop' into develop
kameshsr Mar 3, 2023
496d7af
Merge branch 'mosip:develop' into develop
kameshsr Mar 3, 2023
d6f9273
Merge branch 'mosip:develop' into develop
kameshsr Mar 6, 2023
5c97203
Merge branch 'mosip:develop' into develop
kameshsr Mar 6, 2023
8e50a4e
Merge branch 'mosip:develop' into develop
kameshsr Mar 7, 2023
aeeaca7
Merge branch 'mosip:develop' into develop
kameshsr Mar 7, 2023
8b997d5
Merge branch 'mosip:develop' into develop
kameshsr Mar 9, 2023
1a97121
Merge branch 'mosip:develop' into develop
kameshsr Mar 13, 2023
ac97b68
Merge branch 'mosip:develop' into develop
kameshsr Mar 15, 2023
4187ff2
Merge branch 'mosip:develop' into develop
kameshsr Mar 16, 2023
660a6d1
Merge branch 'mosip:develop' into develop
kameshsr Mar 21, 2023
aeab19f
Merge branch 'mosip:develop' into develop
kameshsr Mar 21, 2023
035d885
Merge branch 'mosip:develop' into develop
kameshsr Mar 21, 2023
6c038cc
Merge branch 'mosip:develop' into develop
kameshsr Mar 24, 2023
c0e491e
Merge branch 'mosip:develop' into develop
kameshsr Mar 24, 2023
6d9aeda
Merge branch 'mosip:develop' into develop
kameshsr Mar 28, 2023
58aaa85
Merge branch 'mosip:develop' into develop
kameshsr Mar 29, 2023
2c28c75
Merge branch 'mosip:develop' into develop
kameshsr Mar 30, 2023
c79a62e
Merge branch 'mosip:develop' into develop
kameshsr Mar 31, 2023
7248799
Merge branch 'mosip:develop' into develop
kameshsr Apr 10, 2023
3bc05f5
Merge branch 'mosip:develop' into develop
kameshsr Apr 11, 2023
dee3825
Merge branch 'mosip:develop' into develop
kameshsr Apr 12, 2023
1913009
Merge branch 'mosip:develop' into develop
kameshsr Apr 17, 2023
e998283
Merge branch 'mosip:develop' into develop
kameshsr Apr 17, 2023
0de722e
Merge branch 'mosip:develop' into develop
kameshsr Apr 17, 2023
99379d1
Merge branch 'mosip:develop' into develop
kameshsr Apr 19, 2023
fc13d0a
Merge branch 'mosip:develop' into develop
kameshsr Apr 19, 2023
bc8c343
Merge branch 'mosip:develop' into develop
kameshsr Apr 20, 2023
6f84051
Merge branch 'mosip:develop' into develop
kameshsr Apr 21, 2023
2fc3d31
Merge branch 'mosip:develop' into develop
kameshsr Apr 25, 2023
5a1d12f
Merge branch 'mosip:develop' into develop
kameshsr Apr 26, 2023
54d41f7
Merge branch 'mosip:develop' into develop
kameshsr Apr 28, 2023
c2caac5
Merge branch 'mosip:develop' into develop
kameshsr Apr 28, 2023
1e91f3f
Merge branch 'mosip:develop' into develop
kameshsr May 2, 2023
b3c7b6e
Merge branch 'mosip:develop' into develop
kameshsr May 2, 2023
91a8a6b
Merge branch 'mosip:develop' into develop
kameshsr May 8, 2023
a1afdb1
Merge branch 'mosip:develop' into develop
kameshsr May 8, 2023
4fd7316
Merge branch 'mosip:develop' into develop
kameshsr May 10, 2023
c20ea2a
Merge branch 'mosip:develop' into develop
kameshsr May 15, 2023
a7b5abe
Merge branch 'mosip:develop' into develop
kameshsr May 15, 2023
7ea50e8
Merge branch 'mosip:develop' into develop
kameshsr May 16, 2023
a1e7e49
Merge branch 'mosip:develop' into develop
kameshsr May 17, 2023
bea36b7
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr May 23, 2023
264c873
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr May 24, 2023
e7d0407
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr May 25, 2023
74da18f
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr May 29, 2023
cfa036e
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr May 30, 2023
b3ce4ec
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 1, 2023
9f9df77
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 1, 2023
e65c202
Merge branch 'mosip:develop' into develop
kameshsr Jun 1, 2023
5111008
Merge branch 'develop' of https://github.com/kameshsr/resident-servic…
kameshsr Jun 1, 2023
9e49e0b
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 2, 2023
9998373
MOSIP-27716 Moved identity-data-formatter.mvel to credentialdata.mvel.
kameshsr Jun 5, 2023
14b6165
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 6, 2023
741cb56
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 7, 2023
8582888
Merge branch 'mosip:develop' into develop
kameshsr Jun 7, 2023
37ae5a0
Merge branch 'develop' of https://github.com/kameshsr/resident-servic…
kameshsr Jun 7, 2023
eeba09a
Merge branch 'develop' of https://github.com/mosip/resident-services …
kameshsr Jun 8, 2023
25f9db1
Fixed email update issue.
kameshsr Jun 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
public interface OtpManager {
public boolean sendOtp(MainRequestDTO<OtpRequestDTOV2> requestDTO, String channelType, String language) throws IOException, ResidentServiceCheckedException, ApisResourceAccessException;
public boolean validateOtp(String otp, String userId, String transactionId) throws ApisResourceAccessException, ResidentServiceCheckedException;
public Tuple2<Object, String> updateUserId(String userId, String transactionId) throws ApisResourceAccessException, ResidentServiceCheckedException;
public Tuple2<Object, String> updateUserId(String userId, String transactionId) throws ApisResourceAccessException, ResidentServiceCheckedException, IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import javax.xml.bind.DatatypeConverter;

import io.mosip.resident.util.Utilities;
import org.json.simple.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
Expand Down Expand Up @@ -87,6 +88,8 @@ public class OtpManagerServiceImpl implements OtpManager {

@Autowired
private RequestValidator requestValidator;
@Autowired
private Utilities utilities;


@Override
Expand Down Expand Up @@ -205,7 +208,7 @@ public boolean validateOtp(String otp, String userId, String transactionId) thr
return true;
}

public Tuple2<Object, String> updateUserId(String userId, String transactionId) throws ApisResourceAccessException, ResidentServiceCheckedException {
public Tuple2<Object, String> updateUserId(String userId, String transactionId) throws ApisResourceAccessException, ResidentServiceCheckedException, IOException {
ResidentUpdateRequestDto residentUpdateRequestDto = new ResidentUpdateRequestDto();
String individualId= identityService.getResidentIndvidualIdFromSession();
String individualIdType = templateUtil.getIndividualIdType();
Expand All @@ -216,9 +219,11 @@ public Tuple2<Object, String> updateUserId(String userId, String transactionId)
return residentService.reqUinUpdate(residentUpdateRequestDto);
}

public String getIdentityJson(String individualId, String transactionId, String userId, String individualIdType) {
public String getIdentityJson(String individualId, String transactionId, String userId, String individualIdType) throws ApisResourceAccessException, IOException {
Map identityMap = new LinkedHashMap();
identityMap.put("IDSchemaVersion", "0.1");
JSONObject obj = utilities.retrieveIdrepoJson(individualId);
String idSchemaVersionStr = String.valueOf(obj.get("IDSchemaVersion"));
identityMap.put("IDSchemaVersion", idSchemaVersionStr);
identityMap.put(individualIdType, individualId);
String channel = getChannel(userId, transactionId);
identityMap.put(channel, userId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,18 @@
package io.mosip.resident.service.impl;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpServerErrorException;

import io.mosip.kernel.core.authmanager.model.AuthNResponse;
import io.mosip.kernel.core.logger.spi.Logger;
import io.mosip.kernel.core.util.DateUtils;
import io.mosip.preregistration.application.constant.PreRegLoginConstant;
import io.mosip.preregistration.core.util.GenericUtil;
import io.mosip.resident.config.LoggerConfiguration;
import io.mosip.resident.constant.EventStatusSuccess;
import io.mosip.resident.constant.RequestType;
import io.mosip.resident.constant.ResidentConstants;
import io.mosip.resident.constant.ResidentErrorCode;
import io.mosip.resident.dto.ExceptionJSONInfoDTO;
import io.mosip.resident.dto.MainRequestDTO;
import io.mosip.resident.dto.MainResponseDTO;
import io.mosip.resident.dto.OtpRequestDTOV2;
import io.mosip.resident.dto.OtpRequestDTOV3;
import io.mosip.resident.entity.ResidentTransactionEntity;
import io.mosip.resident.exception.ApisResourceAccessException;
import io.mosip.resident.exception.ResidentServiceCheckedException;
import io.mosip.resident.exception.ResidentServiceException;
Expand All @@ -37,9 +22,21 @@
import io.mosip.resident.util.EventEnum;
import io.mosip.resident.util.Utility;
import io.mosip.resident.validator.RequestValidator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.HttpServerErrorException;
import reactor.util.function.Tuple2;
import reactor.util.function.Tuples;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* @author Kamesh Shekhar Prasad
* This class is used to implement opt service impl class.
Expand Down Expand Up @@ -172,6 +169,9 @@ public Tuple2<MainResponseDTO<AuthNResponse>, String> validateWithUserIdOtp(Main
} catch (ApisResourceAccessException e) {
throw new ResidentServiceException(ResidentErrorCode.API_RESOURCE_ACCESS_EXCEPTION, e,
Map.of(ResidentConstants.EVENT_ID, eventId));
} catch (IOException e) {
throw new ResidentServiceException(ResidentErrorCode.IO_EXCEPTION, e,
Map.of(ResidentConstants.EVENT_ID, eventId));
} finally {
response.setResponsetime(GenericUtil.getCurrentResponseTime());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -912,9 +912,9 @@ public Tuple2<Object, String> reqUinUpdate(ResidentUpdateRequestDto dto, JSONObj
regProcReqUpdateDto.setIdentityJson(encodedIdentityJson);
String mappingJson = utility.getMappingJson();
String idSchemaVersionStr = null;
JSONObject obj = utilities.retrieveIdrepoJson(dto.getIndividualId());
idSchemaVersionStr = String.valueOf(obj.get("IDSchemaVersion"));
if(validateIdObject) {
JSONObject obj = utilities.retrieveIdrepoJson(dto.getIndividualId());
idSchemaVersionStr = String.valueOf(obj.get("IDSchemaVersion"));
Double idSchemaVersion = Double.parseDouble(idSchemaVersionStr);
ResponseWrapper<?> idSchemaResponse = proxyMasterdataService.getLatestIdSchema(idSchemaVersion, null, null);
Object idSchema = idSchemaResponse.getResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void testValidateOtpFailure() {
}

@Test
public void testValidateOtpSuccess() throws ResidentServiceCheckedException, ApisResourceAccessException {
public void testValidateOtpSuccess() throws ResidentServiceCheckedException, ApisResourceAccessException, IOException {
MainRequestDTO<OtpRequestDTOV3> requestDTO1 = new MainRequestDTO<>();
OtpRequestDTOV3 otpRequestDTOV3 = new OtpRequestDTOV3();
otpRequestDTOV3.setOtp("11111");
Expand Down