Skip to content

Commit

Permalink
4.8.14 dev v3 (#563)
Browse files Browse the repository at this point in the history
* Added string handling in admin patch API

* 4.8.14 v4 bulk (#561)

* Update the filed

* Update the filed

* KB-4295 bug fix

---------

Co-authored-by: Sahil-tarento <140611066+Sahil-tarento@users.noreply.github.com>
  • Loading branch information
karthik-tarento and Sahil-tarento authored May 22, 2024
1 parent a0aa7ac commit 3e28f9f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/sunbird/common/util/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -1053,6 +1053,8 @@ public class Constants {
public static final String DOMICILE_MEDIUM = "domicileMedium";
public static final String PINCODE = "pinCode";
public static final String EMPLOYEE_CODE = "employeeCode";
public static final String PROFILE_STATUS = "profileStatus";
public static final String NOT_VERIFIED = "NOT-VERIFIED";

private Constants() {
throw new IllegalStateException("Utility class");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1776,8 +1776,42 @@ public SBApiResponse profileMDOAdminUpdate(Map<String, Object> request, String u
listOfChangedDetails.add(keys);
}
for (String changedObj : listOfChangedDetails) {
if (profileDetailsMap.get(changedObj) instanceof ArrayList) {
if (profileDetailsMap.get(changedObj) instanceof String) {
existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj));
} else if (profileDetailsMap.get(changedObj) instanceof ArrayList) {
// KB-3718
if (Constants.PROFESSIONAL_DETAILS.equalsIgnoreCase(changedObj)) {
List<Map<String, Object>> professionalList = (List<Map<String, Object>>) existingProfileDetails
.get(Constants.PROFESSIONAL_DETAILS);
;
Map<String, Object> existingProfessionalDetailsMap = null;
// professional detail is empty... just replace...
if (CollectionUtils.isEmpty(professionalList)) {
existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj));
professionalList = (List<Map<String, Object>>) existingProfileDetails
.get(Constants.PROFESSIONAL_DETAILS);
existingProfessionalDetailsMap = professionalList.get(0);
} else {
existingProfessionalDetailsMap = professionalList.get(0);
Map<String, Object> updatedProfessionalDetailsMap = ((List<Map<String, Object>>) profileDetailsMap
.get(changedObj)).get(0);
for (String childKey : updatedProfessionalDetailsMap.keySet()) {
existingProfessionalDetailsMap.put(childKey,
updatedProfessionalDetailsMap.get(childKey));
}
}
if (StringUtils
.isNotBlank((String) existingProfessionalDetailsMap.get(Constants.GROUP)) &&
StringUtils
.isNotBlank((String) existingProfessionalDetailsMap
.get(Constants.DESIGNATION))) {
existingProfileDetails.put(Constants.PROFILE_STATUS, Constants.VERIFIED);
} else {
existingProfileDetails.put(Constants.PROFILE_STATUS, Constants.NOT_VERIFIED);
}
} else {
existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj));
}
} else if (profileDetailsMap.get(changedObj) instanceof Boolean) {
existingProfileDetails.put(changedObj, profileDetailsMap.get(changedObj));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ public String updateBulkUploadUser(UserRegistration userRegistration) {
profileDetails.put(Constants.ADDITIONAL_PROPERTIES, additionalProperties);
profileDetails.put(Constants.VERIFIED_KARMAYOGI, false);
profileDetails.put(Constants.MANDATORY_FIELDS_EXISTS, false);
profileDetails.put(Constants.PROFILE_STATUS, Constants.NOT_VERIFIED);
requestBody.put(Constants.PROFILE_DETAILS, profileDetails);
request.put(Constants.REQUEST, requestBody);
Map<String, Object> readData = (Map<String, Object>) outboundRequestHandlerService.fetchResultUsingPatch(
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ server.tomcat.accept-count=500
server.port=7001

#spring data jpa for postgres
spring.datasource.jdbc-url=jdbc:postgresql://localhost:5432/sunbird
spring.datasource.jdbc-url=jdbc:postgresql://postgresIP:5432/sunbird
spring.datasource.username=sunbird
spring.datasource.password=sunbird
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
Expand All @@ -23,7 +23,7 @@ wf.service.update.pendingRequestsToNewMDO = v1/workflow/update/pendingRequestsTo
user.enable.multidept.mapping=false

#learner.service.url=learner-service:9000
sb.service.url=http://localhost:9000
sb.service.url=http://learnerServiceIP:9010
sb.org.search.path=/v1/org/search
sb.org.create.path=/private/v1/org/create
sb.service.user.create.path=/v3/user/create
Expand All @@ -38,7 +38,7 @@ sb.otp.generate.path=/v1/otp/generate
sb.role.read=/v1/user/role/read/

spring.data.cassandra.sb.startupTimeoutInSeconds=100000
spring.data.cassandra.sb.contact-points=localhost
spring.data.cassandra.sb.contact-points=cassandraIP
sb.data.sync.path=/v1/data/sync
spring.data.cassandra.sb.port=9042
spring.data.cassandra.sb.keyspace-name=sunbird
Expand Down Expand Up @@ -207,7 +207,7 @@ sender.mail=igot-support@tarento.com
notification.event.endpoint=/v1/notification/send/sync
notification.service.host=http://notification-service:9000
last.access.time.gap.millis=259200000
cassandra.config.host=localhost
cassandra.config.host=cassandraIP

sso.url=https://karmayogi.nic.in/auth/
sso.realm=sunbird
Expand Down

0 comments on commit 3e28f9f

Please sign in to comment.