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

Move few changes dev to dev3 #809

Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,14 @@ private void logErrorForBatchJob(Exception e) {
public void scheduleCredentialStatusUpdateJob() throws ResidentServiceCheckedException {
List<ResidentTransactionEntity> residentTxnList = repo.findByStatusCodeInAndRequestTypeCodeInOrderByCrDtimesAsc(
List.of(statusCodes.split(",")), List.of(requestTypeCodes.split(",")));
logger.info("Total records picked from resident_transaction table for processing is " + residentTxnList.size());
for (ResidentTransactionEntity txn : residentTxnList) {
logger.info("Processing event:" + txn.getEventId());
if (txn.getIndividualId() == null) {
txn.setStatusCode(FAILED.name());
txn.setStatusComment("individualId is null");
repo.save(txn);
}
handleWithTryCatch(() -> updateVidCardDownloadTxnStatus(txn));
handleWithTryCatch(() -> updateOrderPhysicalCardTxnStatus(txn));
handleWithTryCatch(() -> updateShareCredentialWithPartnerTxnStatus(txn));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,5 @@ private ResidentConstants() {
public static final String IMAGE = "mosip.resident.photo.token.claim-photo";
public static final String VID = "vid";
public static final String NAME = "name";
public static final String ONLINE_VERIFICATION_PARTNER_ID = "ida.online-verification-partner-id";
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public ResponseWrapper<Object> getInputAttributeValues(@PathVariable("schemaType
}

private String getIdFromUser() throws ApisResourceAccessException {
return idServiceImpl.getResidentIndvidualId();
return idServiceImpl.getResidentIndvidualIdFromSession();
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public ResponseEntity<Object> physicalCardOrder(@RequestParam(name = "partnerId"
@RequestParam(name = "redirectUri") String redirectUri )
throws ResidentServiceCheckedException, ApisResourceAccessException {
logger.debug("OrderCardController::getphysicalCardOrder()::entry");
String individualId = identityServiceImpl.getResidentIndvidualId();
String individualId = identityServiceImpl.getResidentIndvidualIdFromSession();
String redirectURL = orderCardService.getRedirectUrl(partnerId,individualId);
logger.debug("OrderCardController::getphysicalCardOrder()::exit");
return ResponseEntity.status(HttpStatus.FOUND).location(URI.create(redirectURL)).build();
Expand All @@ -117,7 +117,7 @@ public ResponseEntity<Object> physicalCardOrderRedirect(@RequestParam(name = "re
@RequestParam(name = "error_message",required = false) String errorMessage)
throws ResidentServiceCheckedException, ApisResourceAccessException {
logger.debug("OrderCardController::physicalCardOrderRedirect()::entry");
String individualId = identityServiceImpl.getResidentIndvidualId();
String individualId = identityServiceImpl.getResidentIndvidualIdFromSession();
String response = orderCardService.physicalCardOrder(redirectUrl, paymentTransactionId, eventId,
residentFullAddress,individualId,errorCode,errorMessage);
logger.debug("OrderCardController::physicalCardOrderRedirect()::exit");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ResponseEntity<?> authAuditLog(@RequestBody AuthenticatedAuditRequestDto
auditRequestDto.setApplicationName(requestDto.getApplicationName());
auditRequestDto.setSessionUserId(requestDto.getSessionUserId());
auditRequestDto.setSessionUserName(requestDto.getSessionUserName());
String individualId = identityService.getResidentIndvidualId();
String individualId = identityService.getResidentIndvidualIdFromSession();
auditRequestDto.setId(utility.getRefIdHash(individualId));
auditRequestDto.setIdType(identityService.getIndividualIdType(individualId));
auditRequestDto.setCreatedBy(requestDto.getCreatedBy());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public ResponseEntity<Object> reqAauthTypeStatusUpdateV2(
throws ResidentServiceCheckedException, ApisResourceAccessException {
audit.setAuditRequestDto(
EventEnum.getEventEnumWithValue(EventEnum.VALIDATE_REQUEST, "update auth Type status API"));
String individualId = identityServiceImpl.getResidentIndvidualId();
String individualId = identityServiceImpl.getResidentIndvidualIdFromSession();
validator.validateAuthLockOrUnlockRequestV2(requestDTO);
audit.setAuditRequestDto(EventEnum.getEventEnumWithValue(EventEnum.REQ_AUTH_LOCK, individualId));
ResponseWrapper<ResponseDTO> response = new ResponseWrapper<>();
Expand Down Expand Up @@ -392,7 +392,7 @@ public ResponseEntity<Object> updateUinDemographics(
RequestWrapper<ResidentUpdateRequestDto> requestWrapper = JsonUtil.convertValue(requestDTO,
new TypeReference<RequestWrapper<ResidentUpdateRequestDto>>() {
});
String individualId = identityServiceImpl.getResidentIndvidualId();
String individualId = identityServiceImpl.getResidentIndvidualIdFromSession();
ResidentUpdateRequestDto request = requestWrapper.getRequest();
if (request != null) {
request.setIndividualId(individualId);
Expand Down Expand Up @@ -420,7 +420,7 @@ public ResponseWrapper<AuthLockOrUnLockRequestDtoV2> getAuthLockStatus() throws
audit.setAuditRequestDto(
EventEnum.getEventEnumWithValue(EventEnum.VALIDATE_REQUEST, "request auth lock status API"));
ResponseWrapper<AuthLockOrUnLockRequestDtoV2> responseWrapper = new ResponseWrapper<>();
String individualId = identityServiceImpl.getResidentIndvidualId();
String individualId = identityServiceImpl.getResidentIndvidualIdFromSession();
try {
audit.setAuditRequestDto(EventEnum.getEventEnumWithValue(EventEnum.REQ_AUTH_LOCK_STATUS, individualId));
responseWrapper = residentService.getAuthLockStatus(individualId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import io.mosip.resident.dto.ResidentCredentialRequestDto;
import io.mosip.resident.dto.ResidentCredentialResponseDto;
import io.mosip.resident.dto.ResidentCredentialResponseDtoV2;
import io.mosip.resident.dto.SharableAttributesDTO;
import io.mosip.resident.dto.ShareCredentialRequestDto;
import io.mosip.resident.exception.ApisResourceAccessException;
import io.mosip.resident.exception.ResidentServiceCheckedException;
Expand Down Expand Up @@ -221,11 +222,17 @@ private void buildAdditionalMetadata(RequestWrapper<ShareCredentialRequestDto> r
requestDTO.getRequest().getSharableAttributes(), UISchemaTypes.SHARE_CREDENTIAL.getFileIdentifier());
if (Objects.nonNull(requestDTO.getRequest().getSharableAttributes())) {
request.getRequest().setSharableAttributes(sharableAttr);
Map<String, String> formattingAttributes = requestDTO.getRequest().getSharableAttributes()
.stream()
.filter(attrib -> attrib.getFormat() != null && !attrib.getFormat().isEmpty())
.collect(Collectors.toMap(SharableAttributesDTO::getAttributeName, SharableAttributesDTO::getFormat));
request.getRequest()
.setAdditionalData(Map.of("formatingAttributes", requestDTO.getRequest().getSharableAttributes(),
.setAdditionalData(Map.of("formatingAttributes", formattingAttributes,
"maskingAttributes",
requestDTO.getRequest().getSharableAttributes().stream().filter(attr -> attr.isMasked())
.map(attr -> attr.getAttributeName()).collect(Collectors.toList())));
requestDTO.getRequest().getSharableAttributes().stream()
.filter(attr -> attr.isMasked())
.map(attr -> attr.getAttributeName())
.collect(Collectors.toList())));

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private ResponseEntity<Object> revokeVidV2Version(RequestWrapper<? extends BaseV
}

private String getResidentIndividualId() throws ApisResourceAccessException {
return identityServiceImpl.getResidentIndvidualId();
return identityServiceImpl.getResidentIndvidualIdFromSession();
}

@PreAuthorize("@scopeValidator.hasAllScopes("
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package io.mosip.resident.dto;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

/**
Expand All @@ -13,5 +15,6 @@ public class SharableAttributesDTO {

private String format;

@JsonProperty("isMasked")
private boolean isMasked;
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,58 +100,58 @@ List<ResidentTransactionEntity> findByTokenWithoutServiceTypeAndDate(@Param("tok
@Query("update ResidentTransactionEntity set read_status='true' where event_id=:eventId")
int updateReadStatus(@Param("eventId") String eventId);

Page<ResidentTransactionEntity> findByTokenId(String tokenId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndOlvPartnerIdIsNullOrOlvPartnerId(String tokenId, String olvPartnerId,Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndStatusCodeInAndEventIdLike(
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndStatusCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId,
LocalDateTime startDate,
LocalDateTime endDate,
List<String> requestTypeCodes,
List<String> statusCodes,
String eventId,
Pageable pageable
String onlineVerificationPartnerId, Pageable pageable
);

Page<ResidentTransactionEntity> findByEventIdLike(String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndStatusCodeIn(
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndStatusCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> requestTypeCodes,
List<String> statusCodes, Pageable pageable);
List<String> statusCodes, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndEventIdLike(
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate,
LocalDateTime endDate,
List<String> requestTypeCodes, String eventId, Pageable pageable);
List<String> requestTypeCodes, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndStatusCodeInAndEventIdLike(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> statusCodes, String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndStatusCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> statusCodes, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndStatusCodeInAndEventIdLike(
String tokenId, List<String> requestTypeCodes, List<String> statusCodes, String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndStatusCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, List<String> requestTypeCodes, List<String> statusCodes, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndStatusCodeIn(
String tokenId, List<String> requestTypeCodes, List<String> statusCodes, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndStatusCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, List<String> requestTypeCodes, List<String> statusCodes, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndEventIdLike(
String tokenId, List<String> requestTypeCodes, String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, List<String> requestTypeCodes, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndStatusCodeInAndEventIdLike(
String tokenId, List<String> statusCodes, String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndStatusCodeInAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, List<String> statusCodes, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndEventIdLike(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, String eventId, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndEventIdLikeAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, String eventId, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndStatusCodeIn(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> statusCodes, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndStatusCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> statusCodes, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeIn(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> requestTypeCodes, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndRequestTypeCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, List<String> requestTypeCodes, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetween(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndCrDtimesBetweenAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, LocalDateTime startDate, LocalDateTime endDate, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeIn(
String tokenId, List<String> requestTypeCodes, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndRequestTypeCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(
String tokenId, List<String> requestTypeCodes, String onlineVerificationPartnerId, Pageable pageable);

Page<ResidentTransactionEntity> findByTokenIdAndStatusCodeIn(String tokenId, List<String> statusCodes, Pageable pageable);
Page<ResidentTransactionEntity> findByTokenIdAndStatusCodeInAndOlvPartnerIdIsNullOrOlvPartnerId(String tokenId, List<String> statusCodes, String onlineVerificationPartnerId, Pageable pageable);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public interface IdentityService {
*/
Map<String, Object> getIdentityAttributes(String id, String schemaType) throws ResidentServiceCheckedException, IOException;

public String getResidentIndvidualId() throws ApisResourceAccessException;
public String getResidentIndvidualIdFromSession() throws ApisResourceAccessException;

Map<String, Object> getIdentityAttributes(String id, String schemaType,
List<String> additionalAttributes) throws ResidentServiceCheckedException;
Expand Down
Loading