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

HLM-5117 Plan service Changes #734

Closed
wants to merge 59 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9d0610d
HLM-5117 codegen generated code changes
Priyanka-eGov Mar 5, 2024
7173370
HLM-5117 renaming output folder to plan-service
Priyanka-eGov Mar 5, 2024
1d7b717
[HLM-5129] Cleaned up code for plan service
shashwat-egov Mar 5, 2024
c9f2f27
HLM-5117 Formatting all models
Priyanka-eGov Mar 5, 2024
b60ed42
[HLM-5129] Cleaned code for plan service
shashwat-egov Mar 5, 2024
9d6333a
[HLM-5129] Removed unused imports and cleaned up code
shashwat-egov Mar 5, 2024
a770b28
[HLM-5129] Cleaned up starter code
shashwat-egov Mar 5, 2024
cabe7dc
HLM-5117 Removing unnecessary integrations
Priyanka-eGov Mar 5, 2024
c69a505
[HLM-5129] Made changes to plan POJOs and db schema files
shashwat-egov Mar 6, 2024
5d555f1
Code cleanup
shashwat-egov Mar 6, 2024
d40e262
HLM-5184 adding validations
Priyanka-eGov Mar 6, 2024
8f644bb
HLM-5184 removing digit.models import
Priyanka-eGov Mar 6, 2024
face0ab
[HLM-5129] Added validations and made changes in database migration f…
shashwat-egov Mar 7, 2024
93ef7b4
[HLM-5129] Added plan repository interface and its implementation cla…
shashwat-egov Mar 7, 2024
547d1a7
HLM-5184 adding modifications for validations and enrichments.
Priyanka-eGov Mar 7, 2024
2c11b36
[HLM-5129] Added enrichment and validations in plan create API
shashwat-egov Mar 7, 2024
2d149ea
Merge remote-tracking branch 'origin/HLM-5117' into HLM-5117
Priyanka-eGov Mar 7, 2024
fc80c8e
HLM-5184 adding modifications for validations and enrichments.
Priyanka-eGov Mar 7, 2024
07054e5
[HLM-5129] Enabled field level validations on plan related POJOs
shashwat-egov Mar 7, 2024
242af62
HLM-5184 modifying validations
Priyanka-eGov Mar 7, 2024
c44db87
HLM-5184 cleaned up javax imports
Priyanka-eGov Mar 8, 2024
c7dcc1e
HLM-5143 adding plan-service to build config
Priyanka-eGov Mar 8, 2024
b2668c4
HLM-5143 adding changes for validation
Priyanka-eGov Mar 8, 2024
8aca49a
HLM-5143 adding springboot maven plugin related changes in pom for pl…
Priyanka-eGov Mar 11, 2024
27acced
[HLM-5187] Added plan enrichments and search endpoint
shashwat-egov Mar 11, 2024
b433c44
[HLM-5187] Modified row mapper implementation
shashwat-egov Mar 11, 2024
e1d9925
[HLM-5134] Implemented update API for plan service
shashwat-egov Mar 12, 2024
0107f27
[HLM-5129] Added validations in update API
shashwat-egov Mar 12, 2024
136b212
HLM-5116 changes for search API
Priyanka-eGov Mar 12, 2024
75e7cf0
Merge remote-tracking branch 'origin/HLM-5117' into HLM-5117
Priyanka-eGov Mar 12, 2024
9deb13d
HLM-5143 adding different Dockerfile for Java 17
Priyanka-eGov Mar 13, 2024
c57fde7
HLM-5143 removing start.sh
Priyanka-eGov Mar 13, 2024
5b819ce
HLM-5116 added tenantId related validations
Priyanka-eGov Mar 13, 2024
66dba87
HLM-5116 added tenantId related validations
Priyanka-eGov Mar 13, 2024
00f7a87
HLM-5121 adding changes for update API
Priyanka-eGov Mar 15, 2024
51058f8
HLM-5121 adding code comments
Priyanka-eGov Mar 15, 2024
d46760a
HLM-5535 changes for field validations
Priyanka-eGov Mar 27, 2024
b05bf7e
HLM-5116 changing response status.
Priyanka-eGov Apr 1, 2024
925306d
HLM-5117 adding changes for resource mapping filestore id and search …
Priyanka-eGov Apr 4, 2024
600b7e5
HLM-5607 changes for adding template identifier to file
Priyanka-eGov Apr 4, 2024
1f1bc09
HLM-5607 adding validation for useruuid search
Priyanka-eGov Apr 4, 2024
52572ed
HLM-5607 modifying assumptions master
Priyanka-eGov Apr 5, 2024
65175c1
HLM-5607 modifying assumptions master
Priyanka-eGov Apr 5, 2024
ebeecf2
HLM-5607 removing useruuid validation
Priyanka-eGov Apr 15, 2024
2fbbcac
HLM-5607 adding validations for resource mapping and operation
Priyanka-eGov Apr 16, 2024
af176d0
HLM-5607 adding validations for resource mapping and operation
Priyanka-eGov Apr 16, 2024
ca0710e
HLM-5607 adding new field status in plan configuration
Priyanka-eGov Apr 16, 2024
7577524
HLM-5692 add totalCount in plan config search query
Priyanka-eGov Apr 18, 2024
3839c45
HLM-5711 added validation related changes for metric value
Priyanka-eGov Apr 18, 2024
c2c881b
HLM-5740 validation whether plan configuration exists while create plan
Priyanka-eGov Apr 24, 2024
df2ac46
HLM-5765 making metricComparator an enum
Priyanka-eGov Apr 29, 2024
95ed775
HLM-5117 changes in operation input validation against mdms data and …
siddhant-nawale-egov May 2, 2024
60e1dc3
Merge pull request #722 from egovernments/HLM-5117-operations-input-m…
Priyanka-eGov May 2, 2024
8289220
HLM-5117 changing localhost
Priyanka-eGov May 2, 2024
f8be869
Merge remote-tracking branch 'origin/HLM-5117' into HLM-5117
Priyanka-eGov May 2, 2024
c64b14f
HLM-5765 making changes to planrowmapper
Priyanka-eGov May 2, 2024
6b9a2ab
HLM-5117 changes in operation input validation with section and filet…
siddhant-nawale-egov May 2, 2024
659a660
Merge pull request #723 from egovernments/HLM-5117-operations-input-m…
Priyanka-eGov May 6, 2024
49b0f3f
HLM-5180 making activities and resources empty instead of null in sea…
Priyanka-eGov May 14, 2024
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
34 changes: 34 additions & 0 deletions build/17/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

FROM egovio/amazoncorretto:17-alpine3.19 AS build
# FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
#FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
ARG WORK_DIR
WORKDIR /app

# Install Maven
RUN apk add --no-cache maven

# copy the project files
COPY ${WORK_DIR}/pom.xml ./pom.xml
COPY build/maven/start.sh ./start.sh

# not useful for stateless builds
# RUN mvn -B dependency:go-offline

COPY ${WORK_DIR}/src ./src
RUN mvn -B -f /app/pom.xml package


# Create runtime image
#FROM egovio/8-openjdk-alpine
#FROM ghcr.io/egovernments/8-openjdk-alpine:latest
FROM egovio/amazoncorretto:17-alpine3.19


WORKDIR /opt/egov

COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/

RUN chmod +x /opt/egov/start.sh

CMD ["/opt/egov/start.sh"]
7 changes: 7 additions & 0 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,10 @@ config:
dockerfile: "build/maven/Dockerfile"
- work-dir: "core-services/egov-hrms/src/main/resources/db"
image-name: "health-hrms-db"
- name: "builds/health-campaign-services/health-services/plan-service"
build:
- work-dir: "health-services/plan-service"
image-name: "plan-service"
dockerfile: "build/17/maven/Dockerfile"
- work-dir: "health-services/plan-service/src/main/resources/db"
image-name: "plan-service-db"
18 changes: 18 additions & 0 deletions health-services/plan-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Swagger generated server

Spring Boot Server


## Overview
This server was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project.
By using the [OpenAPI-Spec](https://github.com/swagger-api/swagger-core), you can easily generate a server stub.
This is an example of building a swagger-enabled server in Java using the SpringBoot framework.

The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the unpaired symbol.

- The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
+ The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox).

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox)
The underlying library integrating swagger to SpringBoot is [springfox](https://github.com/springfox/springfox).


Start your server as an simple java application
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use "a" instead of "an".

- Start your server as an simple java application
+ Start your server as a simple java application

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
Start your server as an simple java application
Start your server as a simple java application


You can view the api documentation in swagger-ui by pointing to
http://localhost:8080/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "the" before "default port value".

- Change default port value in application.properties
+ Change the default port value in application.properties

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
http://localhost:8080/


Change default port value in application.properties
115 changes: 115 additions & 0 deletions health-services/plan-service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.egov</groupId>
<artifactId>plan-service</artifactId>
<packaging>jar</packaging>
<name>plan-service</name>
<version>1.0.0</version>
<properties>
<java.version>17</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
</properties>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
</parent>
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>9.22.3</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>42.7.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-core</artifactId>
<version>1.5.18</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>2.2.8</version>
</dependency>

<dependency>
<groupId>org.egov.services</groupId>
<artifactId>tracer</artifactId>
<version>2.9.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.egov</groupId>
<artifactId>mdms-client</artifactId>
<version>2.9.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>repo.egovernments.org</id>
<name>eGov ERP Releases Repository</name>
<url>https://nexus-repo.egovernments.org/nexus/content/repositories/releases/</url>
</repository>
<repository>
<id>repo.egovernments.org.snapshots</id>
<name>eGov ERP Releases Repository</name>
<url>https://nexus-repo.egovernments.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>repo.egovernments.org.public</id>
<name>eGov Public Repository Group</name>
<url>https://nexus-repo.egovernments.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>repo.digit.org</id>
<name>eGov DIGIT Releases Repository</name>
<url>https://nexus-repo.digit.org/nexus/content/repositories/snapshots/</url>
</repository>
</repositories>
</project>
19 changes: 19 additions & 0 deletions health-services/plan-service/src/main/java/digit/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package digit;


import org.egov.tracer.config.TracerConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

@Import({ TracerConfiguration.class })
@SpringBootApplication
@ComponentScan(basePackages = { "digit", "digit.web.controllers" , "digit.config"})
public class Main {

public static void main(String[] args) throws Exception {
SpringApplication.run(Main.class, args);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package digit.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.*;
import org.egov.tracer.config.TracerConfiguration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.stereotype.Component;

import java.util.TimeZone;

@Component
@Data
@Import({TracerConfiguration.class})
@NoArgsConstructor
@AllArgsConstructor
@Setter
@Getter
public class Configuration {

//Workflow Config
@Value("${egov.workflow.host}")
private String wfHost;

@Value("${egov.workflow.transition.path}")
private String wfTransitionPath;

@Value("${egov.workflow.businessservice.search.path}")
private String wfBusinessServiceSearchPath;

@Value("${egov.workflow.processinstance.search.path}")
private String wfProcessInstanceSearchPath;


//MDMS
@Value("${egov.mdms.host}")
private String mdmsHost;

@Value("${egov.mdms.search.endpoint}")
private String mdmsEndPoint;


//Persister Topic
@Value("${plan.configuration.create.topic}")
private String planConfigCreateTopic;

@Value("${plan.configuration.update.topic}")
private String planConfigUpdateTopic;

@Value("${plan.default.offset}")
private Integer defaultOffset;

@Value("${plan.default.limit}")
private Integer defaultLimit;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package digit.config;

import jakarta.annotation.PostConstruct;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import java.util.TimeZone;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.egov.tracer.config.TracerConfiguration;
import org.springframework.jdbc.core.SingleColumnRowMapper;


@Import({TracerConfiguration.class})
public class MainConfiguration {

@Value("${app.timezone}")
private String timeZone;

@PostConstruct
public void initialize() {
TimeZone.setDefault(TimeZone.getTimeZone(timeZone));
}

@Bean
public ObjectMapper objectMapper(){
return new ObjectMapper().disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES).setTimeZone(TimeZone.getTimeZone(timeZone));
}

@Bean
@Autowired
public MappingJackson2HttpMessageConverter jacksonConverter(ObjectMapper objectMapper) {
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
converter.setObjectMapper(objectMapper);
return converter;
}

@Bean
public SingleColumnRowMapper singleColumnRowMapper() {
return new SingleColumnRowMapper<>(String.class);
}

}
Loading
Loading