Skip to content

Commit

Permalink
nira (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Karthik-TF authored Aug 30, 2024
1 parent d7e7266 commit 6d843df
Show file tree
Hide file tree
Showing 89 changed files with 256 additions and 3,963 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Maven Package upon a push](https://github.com/mosip/admin-services/actions/workflows/push-trigger.yml/badge.svg?branch=master)](https://github.com/mosip/admin-services/actions/workflows/push-trigger.yml)
[![Maven Package upon a push](https://github.com/mosip/admin-services/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0.1)](https://github.com/mosip/admin-services/actions/workflows/push_trigger.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=mosip_admin-services&id=mosip_admin-services&metric=alert_status)](https://sonarcloud.io/dashboard?id=mosip_admin-services)


Expand Down
6 changes: 3 additions & 3 deletions admin/admin-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>io.mosip.admin</groupId>
<artifactId>admin-parent</artifactId>
<version>1.2.1.0</version>
<version>1.2.0.1</version>
</parent>
<artifactId>admin-service</artifactId>
<name>admin-service</name>
<version>1.2.1.0</version>
<version>1.2.0.1</version>
<url>http://maven.apache.org</url>
<packaging>jar</packaging>
<properties>
Expand Down Expand Up @@ -216,7 +216,7 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down
4 changes: 2 additions & 2 deletions admin/hotlist-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>io.mosip.hotlist</groupId>
<artifactId>hotlist-service</artifactId>
<version>1.2.1.0</version>
<version>1.2.0.1</version>
<name>Hotlist Service</name>
<description>Service to block/unblock ids in MOSIP</description>
<url>https://github.com/mosip/admin-services</url>
Expand Down Expand Up @@ -362,7 +362,7 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
<version>${kernel.version}</version>
</dependency>
</dependencies>
<build>
Expand Down
4 changes: 2 additions & 2 deletions admin/kernel-masterdata-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<name>kernel-masterdata-service</name>
<description>Mosip commons project </description>
<url>https://github.com/mosip/commons</url>
<version>1.2.1.0</version>
<version>1.2.0.1</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Expand Down Expand Up @@ -475,7 +475,7 @@
<dependency>
<groupId>io.mosip.kernel</groupId>
<artifactId>kernel-auth-adapter</artifactId>
<version>${kernel-auth-adapter.version}</version>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.List;

import javax.validation.Valid;
import javax.websocket.server.PathParam;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
Expand Down Expand Up @@ -38,6 +39,7 @@
import io.mosip.kernel.masterdata.dto.response.FilterResponseCodeDto;
import io.mosip.kernel.masterdata.dto.response.FilterResponseDto;
import io.mosip.kernel.masterdata.dto.response.PageResponseDto;
import io.mosip.kernel.masterdata.entity.DynamicField;
import io.mosip.kernel.masterdata.service.DynamicFieldService;
import io.mosip.kernel.masterdata.service.GenericService;
import io.mosip.kernel.masterdata.utils.AuditUtil;
Expand Down Expand Up @@ -91,16 +93,6 @@ public ResponseWrapper<DynamicFieldConsolidateResponseDto> getDynamicFieldByName
responseWrapper.setResponse(dynamicFieldService.getDynamicFieldByNameAndLangcode(fieldName,langCode,withValue));
return responseWrapper;
}

@ResponseFilter
@GetMapping("/{fieldName}")
@ApiOperation(value = " Service to fetch one dynamic field in all the languages")
public ResponseWrapper<List<DynamicFieldExtnDto>> getAllDynamicFieldByName(
@PathVariable("fieldName") String fieldName){
ResponseWrapper<List<DynamicFieldExtnDto>> responseWrapper = new ResponseWrapper<>();
responseWrapper.setResponse(dynamicFieldService.getAllDynamicFieldByName(fieldName));
return responseWrapper;
}


@ResponseFilter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,23 +230,6 @@ public ResponseWrapper<LocationResponseDto> getImmediateChildrenByLocCodeAndLang
return responseWrapper;
}

/**
*
* @param locationCode location code
* @param languageCodes language codes
* @return list of location hierarchies
*/
@ResponseFilter
@GetMapping(value = "/immediatechildren/{locationcode}")
public ResponseWrapper<LocationResponseDto> getImmediateChildrenByLocCode(
@PathVariable("locationcode") String locationCode, @RequestParam("languageCodes") List<String> languageCodes) {

ResponseWrapper<LocationResponseDto> responseWrapper = new ResponseWrapper<>();
responseWrapper
.setResponse(locationHierarchyService.getImmediateChildrenByLocCode(locationCode, languageCodes));
return responseWrapper;
}

/**
* checks whether the given location name is valid or not
*
Expand Down Expand Up @@ -372,5 +355,26 @@ public ResponseWrapper<List<MissingDataDto>> getMissingLocationDetails(
responseWrapper.setResponse(genericService.getMissingData(Location.class, langCode, "code", fieldName));
return responseWrapper;
}


/**
*
* @param locationCode location code
* @param hierarchyName hierarchy name
* @param langCode language code
* @return list of location hierarchies
*/
@ResponseFilter
//@PreAuthorize("hasAnyRole(@authorizedRoles.getGetlocationsimmediatechildrenlocationcodehierarchyNamelangcode())")
@GetMapping(value = "/immediatechildren/{locationcode}/{hierarchyName}/{langcode}")
public ResponseWrapper<LocationResponseDto> getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(
@PathVariable("locationcode") String locationCode, @PathVariable("hierarchyName") String hierarchyName, @PathVariable("langcode") String langCode) {

ResponseWrapper<LocationResponseDto> responseWrapper = new ResponseWrapper<>();
responseWrapper
.setResponse(locationHierarchyService.getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(locationCode, hierarchyName, langCode));
return responseWrapper;
}


}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package io.mosip.kernel.masterdata.dto;

import java.util.List;

import org.json.JSONArray;

import com.fasterxml.jackson.annotation.JsonIgnore;
Expand All @@ -21,6 +19,7 @@ public class DynamicFieldConsolidateResponseDto {

private String description;

private List<DynamicFieldCodeValueDTO> values;
@JsonIgnore
private JSONArray jsonValues;

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.fasterxml.jackson.databind.JsonNode;
import lombok.Data;
import org.json.JSONArray;

import java.time.LocalDateTime;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ int updateDynamicField(String id, String description, String langCode, String da

/**
* update isDeleted as true
* @param id
* @param updatedDateTime
* @param updatedBy
* @return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ List<Location> findLocationByHierarchyLevelStartsWith(Short hierarchyLevel, Stri
@Query(value = "FROM Location l where l.langCode=?1 and l.hierarchyLevel=?2")
List<Location> getAllLocationsByLangCodeWithHierarchyLevel(String langCode, Short level);

@Query(value = "FROM Location l WHERE parentLocCode = ?1 AND l.langCode IN (?2) AND (l.isDeleted IS NULL OR l.isDeleted = false) AND l.isActive = true")
List<Location> findLocationHierarchyByParentLocCode(String parentLocCode, List<String> languageCodes);

@Query(value = "FROM Location l where parentLocCode=?1 and hierarchyName=?2 and langCode=?3 and (l.isDeleted is null or l.isDeleted=false) and l.isActive=true")
List<Location> findLocationHierarchyByParentLocCodeAndHierarchyNameAndLanguageCode(String parentLocCode, String hierarchyName, String languageCode);


}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.mosip.kernel.masterdata.dto.request.SearchDto;
import io.mosip.kernel.masterdata.dto.response.FilterResponseCodeDto;
import io.mosip.kernel.masterdata.dto.response.PageResponseDto;
import io.mosip.kernel.masterdata.entity.DynamicField;

/**
* Methods to create / update / inactivate / addValues dynamic field
Expand Down Expand Up @@ -82,5 +83,4 @@ public PageDto<DynamicFieldExtnDto> getAllDynamicField(int pageNumber, int pageS
public DynamicFieldConsolidateResponseDto getDynamicFieldByNameAndLangcode(String fieldName,String langCode,boolean withValue);


List<DynamicFieldExtnDto> getAllDynamicFieldByName(String fieldName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ public interface LocationService {
public StatusResponseDto updateLocationStatus(String code, boolean isActive);

public FilterResponseCodeDto locFilterValues(FilterValueDto filterValueDto);
/*
* (non-Javadoc)
*
* @param locCode - location code
* @param hierarchyName - hierarchyName
* @param langCode - language code
* @return {@link LocationResponseDto}
*/
LocationResponseDto getImmediateChildrenByLocCodeAndHierarchyNameAndLangCode(String locCode, String hierarchyName, String langCode);

LocationResponseDto getImmediateChildrenByLocCode(String locationCode, List<String> languageCodes);
}
Loading

0 comments on commit 6d843df

Please sign in to comment.