Skip to content

Commit

Permalink
PR to develop branch for Microplanning v0.1 (changes in plan-service,…
Browse files Browse the repository at this point in the history
… resource-generator service) (#1176)

* HCMPRE-599 updating Plan service models

* HCMPRE-599 updating Plan service models

* HCMPRE-599 changes

* HCMPRE-599 adding census POJOs

* HCMPRE-599changes for triggering pland census records on workflow status

* HCMPRE-599 app.prop changes for resource generator service

* Renaming resource-estimation-service to resource-generator

* HCMPRE-1078  enrichment of resource mapping

* HCMPRE-1122 changing processing logic

* HCMPRE-1122 changing processing logic

* HCMPRE-1122 updating operation related validations

* HCMPRE-1122 adding method comments

* enhancement in facilityCatchmentConsumer

* enhancement in facilityCatchmentConsumer

* removing catchement topic that was added before

* added wf validation for approving estimations

* adding additionalDetails as string while preparing rows for batchUpdate

* adding additionalDetails as string while preparing rows for batchUpdate

* HCMPRE-1094 changes for facility mapping create trigger on workflow

* reverting the change in census-bulk-api

* parsing additional details in bulk update api

* Added plan config name in plan employee's and plan facility's search criteria

* Bypassing validations for operations when source is CUSTOM

* added workflow validations

* removing unused service constants

* Changes for triggering plan-facility mapping

* adding project factory data create host

* handling case for empty areaCodes in search criteria

* handling case for empty areaCodes in search criteria

* adding project factory data create host

* Adding facility create trigger status

* Adding additionalField table in census

* adding plan config name in plan employee and plan facility pojo

* Adding additionalField table in census

* implemented partial search in plan config name

* Changing datatype of value

* HCMPRE-1162 enrich additionalfieldForCensus

* HCMPRE-1162 enrich additionalfieldForCensus

* updated query builder for census

* handling null pointer exception on updating additional details

* Changes to allow assumption values in input

* Removing older method for getting input value

* Making editable false for uploaded additional field during census create

* HCMPRE-853 removing lat long fields from additional field overridekeys

* Changes for adding execution order for operations

* Changes for adding execution order for operations

* Adding facilityName column and enriching servingPop

* HCMPRE-853 added chnages for census search and fetching boundarycodes from one sheet

* HCMPRE-853 changes for updating file with approved census data

* HCMPRE-853 adding logs

* pull from microplanning-dev

* HCMPRE-853 integrating with project factory with updated resources

* modification in wf-service

* workflow auto-assignee issue

* HCMPRE-853 commenting project factory integration

* adding pagination for plan-employee api

* changed the data type of BigDecimal

* HCMPRE-1282 changes for updating estimates into plan

* HCMPRE-1282 app.prop changes

* Adding case for when celltype is formula.

* enriching additional details with additional field key-value

* modified orderBy clause

* made changes in order by clause

* added facilityType

* pull from microplanning-dev

* making fuzzy search cAse-insenSItive

* making fuzzy search cAse-insenSItive

* making fuzzy search cAse-insenSItive

* pull from microplanning-dev

* pull from microplanning-dev

* modified pagination

* HCMPRE-1282 changes for updating approved plans into file for campaign integration

* added planConfigStatus in search criteria

* HCMPRE-1282 changes for updating approved plans into file for campaign integration

* HCMPRE-771 merging multiple alter table migration scripts into create table scripts.

* Adding workflow restricted roles in census

* Adding workflow restricted roles in census

* Fixing limit and adding check for empty row

* Fixing limit and adding check for empty row

* added ranked query for plan employee assignment

* added ranked query for plan employee assignment

* HCMPRE-1300 DB migration script cleanup

* adding plan bulk update topic

* Adding facility name in census additional details

* Wf auto assignment to multiple people

* Wf auto assignment to multiple people

* Adding boundaryTypeHierarchy Pojos and search endpoint

* enriching jurisdiction mapping in census

* changing jurisdictionMapping from jsonIgnore to jsonProperty

* optimizing the enrichment functions and adding comments

* handling null pointer exception

* Wf auto assignment to multiple people

* Set last modified time on update call

* enriching serving population with sum of confirmed target population of serving boundaries

* Reverting campaign update at the end.

* modifying Wf for send back actions

* enriching jurisdiction mapping in plan

* setting assignees separetly for send back actions

* Changing assignee column to Text in db

* Changing assignee column to Text in db

* enriching jurisdiction mapping

* Changing validation logic for operations

* enriching jurisdiction mapping

* Changes for only validating when operation is active

* Sort operations in planconfig search by execution order

* Sort operations in planconfig search by execution order

* Sort operations in planconfig search by execution order

* Sort operations in planconfig search by execution order

* type casting jurisdiction into list

* Adding census changelog

* Adding census changelog

* Adding census changelog

* Adding census changelog

* Adding census changelog

* Show on UI false for lat long fields

* Updated plan service CHANGELOG

* update plan config validation

* Adding jurisdiction mapping in plan facility

* Changing all collection dataType from list to set in API search criteria

* Changing all collection dataType from list to set in API search criteria

* removing validation for operation source

* adding overloaded method for query builder in plan

* adding overloaded method for query builder in plan

* Adding validation to check for duplicates

* pull from census-bulk-api

* pull from census-bulk-api

* Removing comments from WF in resource generator

* Decreasing min size of assumptionvalue in Operation POJO to 1.

* Changing mdms master in plan service for hierarchyConfig

* changing min size of resource type in resource pojo

* increasing request size for producer

* changed version from 1.1.0 to 1.0.0

* changed version from 1.1.0 to 1.0.0

* changing the order

* changing the order

* changing the order

* Increasing request size in application.properties

* Updating resource generator changelog

* Updating resource generator changelog

* Adding boundaryAncestralPath for Plan Facility API

* Adding boundaryAncestralPath for Plan Facility API

* Adding ProjectFactory consumer in Plan Facility Service

* Adding ProjectFactory consumer in Plan Facility Service

* Adding plan changelog

* Adding empty list as service boundary when null in consumer for project-factory

* Increasing the max-request-size in census producer configuration

* Increasing the max-request-size in plan producer configuration

* Adding orderBy clause for plan search query

* Removing unused census consumer

* Replacing map from set for duplicate check in census row mapper

* Replacing map from set for duplicate check in plan config row mapper

* Replacing map from set for duplicate check in census row mapper

* Replacing map from set for duplicate check in census row mapper

* Replacing map from set for duplicate check in plan config row mapper

* Replacing map from set for duplicate check in plan row mapper

* Clearing set on new census entry

* Clearing set on new plan entry

* Clearing set on new plan config entry

---------

Co-authored-by: Shashwat Mishra <[email protected]>
Co-authored-by: Tanishi Goyal <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent ff4c11b commit 7d3c4cb
Show file tree
Hide file tree
Showing 279 changed files with 14,914 additions and 1,303 deletions.
13 changes: 10 additions & 3 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -250,15 +250,22 @@ config:
dockerfile: "build/17/maven/Dockerfile"
- work-dir: "health-services/plan-service/src/main/resources/db"
image-name: "plan-service-db"
- name: "builds/health-campaign-services/health-services/resource-estimation-service"
- name: "builds/health-campaign-services/health-services/resource-generator"
build:
- work-dir: "health-services/resource-estimation-service"
image-name: "resource-estimation-service"
- work-dir: "health-services/resource-generator"
image-name: "resource-generator"
dockerfile: "build/17/maven/Dockerfile"
- name: "builds/health-campaign-services/analytics/auth-proxy"
build:
- work-dir: "analytics/auth-proxy"
image-name: "auth-proxy"
- name: "builds/health-campaign-services/health-services/census-service"
build:
- work-dir: "health-services/census-service"
image-name: "census-service"
dockerfile: "build/17/maven/Dockerfile"
- work-dir: "health-services/census-service/src/main/resources/db"
image-name: "census-service-db"

# frontend
- name: builds/health-campaign-services/frontend/workbench-ui
Expand Down
13 changes: 13 additions & 0 deletions health-services/census-service/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog
All notable changes to this module will be documented in this file.

## 1.0.0 - 2024-11-28
#### Census Service
The Census Service introduces core functionalities for managing census data:

1. Validation of Census: Ensures data integrity by validating all census requests before processing.
2. Census Create: Creates new census records after validation and enrichment, publishing request to the designated Kafka topic to handle the creation process asynchronously.
3. Census Update: Updates existing records post-validation and enrichment by sending request to the designated Kafka update topic.
4. Census Bulk Update: Updates multiple census records in one operation after successful validation.
5. Census Search: Enables searching for census records with the provided search criteria.
6. Plan Facility Consumer: Listens to Plan Facility Update topic to assign facility to a boundary in census.
18 changes: 18 additions & 0 deletions health-services/census-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)

Start your server as an simple java application

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

Change default port value in application.properties
141 changes: 141 additions & 0 deletions health-services/census-service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<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>census-service</artifactId>
<packaging>jar</packaging>
<name>census-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>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.21-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
</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>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>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.5.0</version>
</dependency>
<!-- Egov dependencies -->
<dependency>
<groupId>org.egov.services</groupId>
<artifactId>tracer</artifactId>
<version>2.9.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.egov.services</groupId>-->
<!-- <artifactId>digit-models</artifactId>-->
<!-- <version>1.0.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>
<!-- Bean Validation API support -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</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>
20 changes: 20 additions & 0 deletions health-services/census-service/src/main/java/digit/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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,86 @@
package digit.config;

import lombok.*;
import org.egov.tracer.config.TracerConfiguration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Import;
import org.springframework.stereotype.Component;

import java.util.List;

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

// Allowed roles for census
@Value("#{${allowed.census.roles}}")
private List<String> allowedCensusRoles;

@Value("#{${workflow.restricted.roles}}")
private List<String> workflowRestrictedRoles;

// Persister Topic
@Value("${census.create.topic}")
private String censusCreateTopic;

@Value("${census.update.topic}")
private String censusUpdateTopic;

@Value("${census.bulk.update.topic}")
private String censusBulkUpdateTopic;

@Value("${plan.facility.update.topic}")
private String planFcailityUpdateTopic;

// Boundary Service
@Value("${egov.boundary.service.host}")
private String boundaryServiceHost;

@Value("${egov.boundary.relationship.search.endpoint}")
private String boundaryRelationshipSearchEndpoint;

@Value("${egov.boundary.hierarchy.search.endpoint}")
private String boundaryHierarchySearchEndpoint;

// Plan Service
@Value("${egov.plan.service.host}")
private String planServiceHost;

@Value("${egov.plan.employee.assignment.search.endpoint}")
private String planEmployeeAssignmentSearchEndpoint;

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

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

@Value("${egov.business.service.search.endpoint}")
private String businessServiceSearchEndpoint;

@Value("${workflow.initiate.action}")
private List<String> wfInitiateActions;

@Value("${workflow.intermediate.action}")
private List<String> wfIntermediateActions;

@Value("${workflow.send.back.actions}")
private List<String> wfSendBackActions;

//SMSNotification
@Value("${egov.sms.notification.topic}")
private String smsNotificationTopic;

//Pagination
@Value("${census.default.offset}")
private Integer defaultOffset;

@Value("${census.default.limit}")
private Integer defaultLimit;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package digit.config;

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 jakarta.annotation.PostConstruct;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.egov.tracer.config.TracerConfiguration;


@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;
}
}
Loading

0 comments on commit 7d3c4cb

Please sign in to comment.